Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

java - Disable web service addressing attributes in axis2 (v 1.5.6) generated stub

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

question from:https://stackoverflow.com/questions/65920220/disable-web-service-addressing-attributes-in-axis2-v-1-5-6-generated-stub

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...