0 Replies Latest reply on Apr 3, 2015 8:11 PM by sriram sundararajan

    wrong addition of xsi:type in soap message - jax-ws

    sriram sundararajan Newbie


      I am facing a weird issue in my project. I searched through several forums, but nothing helped. Need your experts help to solve this issue.


      I am working on a migration project to move an application from websphere 7 to JBOSS EAP6.2.4 We have a couple of JAX-WS based webservices. The services are working fine in websphere. But when the same is deployed to JBOSS, the soap message that is produced is different and because of which the service is failing. The reason being in the SOAP message an attribute xsi:type is being added and the element is missing, where as in websphere the same was produced as an eIement. I understand that the webservice provider in websphere is axis whereas for JBoss it is CXF. I compared the stubs that were created using axis and the jboss wsconsume. The stubs looks the same.


      Here is the example,

      SOAP Message from JBOSS:

      <soap:Body><getLocations xmlns="http://xxxx/V1/getLocations" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="RequestType"><ID>1234</ID><DepInd>Y</DepInd></getLocations></soap:Body>


      SOAP Message from Websphere:

      <soap:Body><getLocations xmlns="http://xxxx/V1/getLocations" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Request"><ID>1234</ID><DepInd>Y</DepInd></Request></getLocations></soap:Body>


        WSDL Snippet :


      <wsdl:message name="getLocationsReqMsg">

        <wsdl:part element="gbl:getLocations" name="getLocationsReq"/>


        <wsdl:message name="getLocationsRespMsg">

        <wsdl:part element="gbl:getLocationsResponse" name="getLocationsResp"/>



      Schema Definition:

      <xs:element name="getLocations" type="tns:GetLocationsType" />


      <xs:complexType name="GetLocationsType">


        <xs:element name="Request" type="tns:RequestType" />




      <xs:complexType name="RequestType">


        <xs:element name="ID" type="xs:string" minOccurs="0" />

        <xs:element name="DepInd" type="xs:string" minOccurs="0" />






      Based on  the above wsdl and schema, i was expecting the element "Request" to be present in the SOAP body, but it went missing. Instead of it xsi:type=RequestType is added for the element getLocations which is not the case.  I went through some blogs. This issue is similar to the one posted in  http://stackoverflow.com/questions/26413179/jax-ws-client-incorrect-soap-request-the-markup-in-the-document-following-the


      I went through the cases when an xsi:type will be added, but i dint find those suitable for the above wsdl snippet.