0
votes

I have a axis2 (v 1.5.6) generated stub using wsdl2java and the request generated from the stub consists of unwanted soap web service addressing (wsa) attributes which are not required in the request,the endpoint which receives this request does not support this.

I have seen lot of methods to remove the elements by iterating the entire soap envelope manually,but i need some method to disable it completely from the stub or entire axis2 itself.Below is the elements generated in the request.

PS:The wsdl does'nt even define wsa is required.

Any answer is appreciated.Thanks.

   <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">


  <wsa:To>url</wsa:To>
  <wsa:MessageID>F94EAE5F6CECC13E7F1610961403620</wsa:MessageID>
  <wsa:Action>Upload</wsa:Action>

Completely removing wsa elements manually

1

1 Answers

0
votes

Answering my own question, After digging around the source code of axis2 i tried setting this in the options of the service client of the stub and it worked, the wsa elements are now removed from the request.

        _serviceClient.getOptions().setProperty(org.apache.axis2.addressing.AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES
            , Constants.VALUE_TRUE);