I have received a wsdl from a client for which I need to create a SOAP service.
The Request message is defined as below ->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://xmlns.kt/testservice/V4"
xmlns:servicestype="http://xmlns.kt/testservice2/V4"
targetNamespace="http://xmlns.kt/testservice/V4"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="ReceiveDataReqMsg" type="servicestype:ReceiveDataRequestType">
<xs:annotation>
<xs:documentation>Request message</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>
I am using spring boot ws and maven jaxb plugin to generate the service. The problem is the plugin generates the RequestMessage class as ReceiveDataRequestType instead of ReceiveDataReqMsg.
For this i use a binding xjb and then the plugin creates the class as ReceiveDataReqMsg
<bindings xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1">
<bindings schemaLocation="myschema.xsd">
<bindings node="//xs:element[@name='ReceiveDataReqMsg']">
<class name="ReceiveDataReqMsg">
</class>
</bindings>
</bindings>
But the problem is when i call the service it just gives an error that no adapter found for the endpoint.(I have the endpoint correctly configured).
If i edit and add a @XMLRootelement to the generated class then i get a nullpointerexception.
Can someone please help.
The generated class looks like this
public class ReceiveDataReqMsg
extends JAXBElement<ReceiveDataRequestType>
{
protected final static QName NAME = new QName("http://xmlns.kt/testservice/V4", "ReceiveDataReqMsg");
public ReceiveDataReqMsg(ReceiveDataRequestType value) {
super(NAME, ((Class) ReceiveDataRequestType.class), null, value);
}
public ReceiveReferenceDataReqMsg() {
super(NAME, ((Class) ReceiveDataRequestType.class), null, null);
}
}