Hi there,
I'm working on a project, where I received a WSDL of a WS that is not yet up and running.
As I'm new to Spring WS I decided to set up a dummy web service by myself, so I can test my client implementation in the meantime.
Using wsimport I generated some Java classes out of the WSDL. Then I pretty much followed the steps described in krams nice tutorial:
http://krams915.blogspot.com/2010/12...t-200-rc2.html
Also using Castor as the marshaller (even though JAXB might have bee less work, because wsimport does already generate some annotations for JAXB?)
When consuming the WS in SOAP UI, everything works fine.
When writing the client I noticed that the request and response class generated by wsimport are not annotated with @XmlRootElement. So I need to wrap them with a JAXBElementCode:@PayloadRoot(localPart = REQUEST_LOCAL_NAME, namespace = NAMESPACE_URI) @ResponsePayload public Response getResponse getArtikelBestand(@RequestPayload Request) { ... }
Using TCP/IP Monitor in Eclipse I see that the request and response are successful:Code:JAXBElement<Response> jaxbResponse = (JAXBElement<Response>) webServiceTemplate.marshalSendAndReceive(jaxbRequest);
Code:<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns3:getInformation xmlns:ns3="..."> <id>123</id> </ns3:getInformation> </SOAP-ENV:Body> </SOAP-ENV:Envelope>The weird thing now is that when i callCode:<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns3:getInformationResponse xmlns:ns3="http://pim.migros.net/migrosinout/services/v2/pimDataExport"> <getInformationResponseDto> <id>123</id> <information> ... </information> </getInformationResponseDto> </ns3:getInformationResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I receive a object of type Response. However the child of it is null.Code:Response response = jaxbResponse.getValue();
However if I change my web service toCode:response.getInformationDto() == null
It works fine.Code:@PayloadRoot(localPart = REQUEST_LOCAL_NAME, namespace = NAMESPACE_URI) @ResponsePayload public JAXBElement<Response> getResponse getArtikelBestand(@RequestPayload JAXBElement<Request>) { ... }
What is wrong here?
Cheers,
wi.lee


Reply With Quote
)