0

I have this class generated from a WSDL:

/**                                                                                                                                                               
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.9-b14002
 * Generated source version: 2.2
 *
 */
@WebService(name = "SI_Message_SYN_OUT", targetNamespace = "http://V2/B/ISP/Global")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@XmlSeeAlso({
    ObjectFactory.class
})
public interface SIMessageSYNOUT {


    /**
     *
     * @param myMessage
     */
    @WebMethod(operationName = "SI_Message_SYN_OUT", action = "http://sap.com/xi/WebService/soap1.1")
    public void siMessageSYNOUT(
        @WebParam(name = "my-message", targetNamespace = "", mode = WebParam.Mode.INOUT, partName = "my-message")
        Holder<myMessage> myMessage);

}   

The WSDL is this:

<?xml version="1.0" encoding="UTF-8"?>                                                                                                                            
<wsdl:definitions xmlns:p1="http://V2/B/ISP/Global" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/   oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SI_Message_SYN_OUT" targetNamespace="http://V2/B/ISP/Global">
  <wsdl:documentation/>
  <wsp:UsingPolicy wsdl:required="true"/>
  <wsp:Policy wsu:Id="OP_SI_Message_SYN_OUT"/>
  <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:element name="my-message" type="myMessage"/>
      <xsd:complexType name="myMessage">
        <xsd:sequence>
          <xsd:element name="message-header" type="MessageHeader"/>
          <xsd:element name="message-content" type="MessageContent"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="MessageHeader">
        <xsd:annotation>
          <xsd:documentation>Message header</xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
          <xsd:element name="id" type="xsd:string" />
          <xsd:element name="timestamp" type="xsd:dateTime" />
          <xsd:element name="user" type="xsd:string" />
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="MessageContent">
        <xsd:choice>
          <xsd:element name="ping-message" type="PingMessage"/>
        </xsd:choice>
      </xsd:complexType>
      <xsd:complexType name="PingMessage"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="xmln.my-message">
    <wsdl:documentation/>
    <wsdl:part xmlns="" name="my-message" element="my-message"/>
  </wsdl:message>
  <wsdl:portType name="SI_Message_SYN_OUT">
    <jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws">
        <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
    </jaxws:bindings>
    <wsdl:documentation/>
    <wsdl:operation name="SI_Message_SYN_OUT">
      <wsdl:documentation/>
      <wsp:Policy>
        <wsp:PolicyReference URI="#OP_SI_Message_SYN_OUT"/>
      </wsp:Policy>
      <wsdl:input message="p1:xmln.my-message"/>
      <wsdl:output message="p1:xmln.my-message"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="SI_Message_SYN_OUTBinding" type="p1:SI_Message_SYN_OUT">
    <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="SI_Message_SYN_OUT">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://sap.com/xi/WebService/soap1.1"/>
      <wsdl:input>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="SI_Message_SYN_OUTService">
    <wsdl:port name="HTTP_Port" binding="p1:SI_Message_SYN_OUTBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://127.0.0.1:8888/XISOAPAdapter/MessageServlet?senderParty=&amp;             senderService=SRV_ISP&amp;receiverParty=&amp;receiverService=&amp;interface=SI_Message_SYN_OUT&amp;interfaceNamespace=http%3A%2F%2FV2%2FB%2FISP%2FGlobal"/>
    </wsdl:port>
    <wsdl:port name="HTTPS_Port" binding="p1:SI_Message_SYN_OUTBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="https://127.0.0.1:9999/XISOAPAdapter/MessageServlet?senderParty=&amp;            senderService=SRV_ISP&amp;receiverParty=&amp;receiverService=&amp;interface=SI_Message_SYN_OUT&amp;interfaceNamespace=http%3A%2F%2FV2%2FB%2FISP%2FGlobal"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>                                            

When sending a message over this webservice, the XML that is actually send, looks like this:

<?xml version="1.0"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
    <ns2:my-message xmlns:ns2="http://V2/B/ISP/Global">
      <message-header>
        <id>9f45a507-3f56-4a30-aefe-28368282bcbe</id>
        <timestamp>2015-10-16T16:31:27</timestamp>
        <user>BFR</user>
      </message-header>
      <message-content>
        <ping-message/>
      </message-content>
    </ns2:my-message>                                                                                                                                             
  </S:Body>
</S:Envelope>

This message is rejected by the server and it seems that the problem is the additional namespace on the my-message tag: xmlns:ns2="http://V2/B/ISP/Global". This should apparently not be present.

Now, my question is: Should this namespace be there or not? When I look at the webservice interface generated by JAX-WS, it see the targetNamespace of my-message is empty. So shouldn't the my-message tag in the XML also have no namespace?

radlan
  • 2,393
  • 4
  • 33
  • 53
  • You should post the WSDL, without the WSDL is difficult to find if a problem exists or not. – minus Feb 28 '17 at 18:21
  • Possible duplicate of [Customising JAX-WS prefix of a SOAP response](http://stackoverflow.com/questions/12889943/customising-jax-ws-prefix-of-a-soap-response) – kolossus Mar 03 '17 at 13:36

0 Answers0