I have the following annotated endpoint method:
Using the following SOAP request:Code:@PayloadRoot(localPart = "GetUserRequest", namespace = "http://mydomain.com/schemas/MyService") public Source provisionDevice( @XPathParam("//ns:Username") String username, @XPathParam("//ns:Password") String password)) { LOG.debug("\n" + "username: " + username + "\n" + "password: " + password + "\n"); return null; }
Code:<?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <GetUserRequest xmlns="http://mydomain.com/schemas/MyService"> <Username>USERNAME</Username> <Password>PASSWORD</Password> </GetUserRequest > </soapenv:Body> </soapenv:Envelope>
... the annotated method is only ever able to get the first GetUserRequest child element from the SOAP request. In the soap request above, only username in the annotated method will be set. But if I switch <Password> and <Username> around like so:
... only password in the annotated endpoint method is set.Code:<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <GetUserRequest xmlns="http://mydomain.com/schemas/MyService"> <Password>PASSWORD</Password> <Username>USERNAME</Username> </GetUserRequest > </soapenv:Body> </soapenv:Envelope>
What's going on here?
BTW: I've tried several different kinds of XPaths (more explicit ones, namespace agnostic ones, etc.), but to no avail.
Here's the log of what's going on:
Code:org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@324b85] to [http://localhost:80/soap/MyService] org.apache.jk.server.JkCoyoteHandler - doRead [B@7f6155 0 0 org.apache.jk.common.JkInputStream - doRead 0 473 473 false 0 0 org.apache.axiom.om.util.StAXUtils - Created XMLInputFactory = class com.ctc.wstx.stax.WstxInputFactory for classloader=WebappClassLoader org.apache.axiom.om.util.StAXUtils - Size of XMLInputFactory map =1 org.apache.axiom.om.util.StAXUtils - XMLStreamReader is com.ctc.wstx.sr.ValidatingStreamReader org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder - Build the OMElelment EnvelopeBy the StaxSOAPModelBuilder org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder - Build the OMElelment BodyBy the StaxSOAPModelBuilder org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder - Build the OMElelment GetUserRequestBy the StaxSOAPModelBuilder org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder - Build the OMElelment UsernameBy the StaxSOAPModelBuilder org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder - Build the OMElelment PasswordBy the StaxSOAPModelBuilder org.springframework.ws.server.MessageTracing.received - Received request [SaajSoapMessage {http://mydomain.com/schemas/MyService}GetUserRequest] org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping - Looking up endpoint for [{http://mydomain.com/schemas/MyService}GetUserRequest] org.springframework.ws.soap.server.SoapMessageDispatcher - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@13cca0e] maps request to endpoint [public javax.xml.transform.Source package.name.endpoint.MyServiceServiceAnnotationEndpoint.getUser(java.lang.String,java.lang.String)] org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor - Request: <GetUserRequest xmlns="http://mydomain.com/schemas/MyService"> <Username>USERNAME org.springframework.ws.soap.server.SoapMessageDispatcher - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.XPathParamAnnotationMethodEndpointAdapter@b481ba] org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'MyServiceAnnotatedEndpoint' package.name.endpoint.MyServiceServiceAnnotationEndpoint - username: USERNAME password: org.springframework.ws.server.MessageTracing.sent - MessageDispatcher with name 'MyService-soap' sends no response for request [SaajSoapMessage {http://mydomain.com/schemas/MyService}GetUserRequest] org.springframework.ws.transport.http.MessageDispatcherServlet - Successfully completed request


Reply With Quote