2 Replies Latest reply: Oct 11, 2012 8:27 AM by jwenting RSS

    Netbeans generated JAX-WS client does not work if Axis2 library is present

    963945
      I generated a JAX-WS web service client using Netbeans, every thing works fine except if i add Axis2 library to the project the UsernameToken is removed from the soap header and the soap message looks slightly different. I'm quite new to Java web services so i would really like to understand what is going on and how to solve this. The reason why i need to have the Axis2 library is that I'm adding a client to an large project that has many Axis2 clients.

      Generated SOAP when Axis2 library is present:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
      </soapenv:Header>
      <soapenv:Body>
      <ns2:AddOrUpdate xmlns:ns2="http://tempuri.org/" xmlns="http://schemas.datacontract.org/2004/07/Service.DataTransferObjects" xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns3="http://schemas.datacontract.org/2004/07/Service.ServiceUtils">
      <ns2:employee />
      </ns2:AddOrUpdate>
      </soapenv:Body>

      Generated SOAP without Axis2 library:

      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <S:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken>
      <wsse:Username>username</wsse:Username>
      <wsse:Password>password1</wsse:Password>
      </wsse:UsernameToken>
      </wsse:Security>
      </S:Header>
      <S:Body>
      <AddOrUpdate xmlns="http://tempuri.org/" xmlns:ns2="http://schemas.datacontract.org/2004/07/Service.DataTransferObjects" xmlns:ns3="http://schemas.datacontract.org/2004/07/Service.ServiceUtils" xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/">
      <employee/>
      </AddOrUpdate>
      </S:Body>