I opened a JIRA https://issues.apache.org/jira/browse/AXIS2-5039, and very appreciated with any comment ! Thanks.
2011/5/12 Ivan <[email protected]> > Hi, > While using RI SAAJ impl with Axis2, it seems that RI SAAJ will always > adds a SOAPAction header with the value "" if it is a SOAP 1.1 message. I > found that if the action is configured in the requestContext by the > BindingProvider.SOAPACTION_USE_PROPERTY and > BindingProvider.SOAPACTION_URI_PROPERTY will be ignored. And it looks to me > that it makes sense to override the soap action if it is explicitly > configured with the later way. > I did a text search for the setSOAPAction method for the > MessageContext, and its initial values are from SOAPMessage. > a. o.a.axis2.saaj.SOAPConnectionImpl Line 185 > b. o.a.axis2.jaxws.message.util.MessageUtils Line 206 > Also, for the SOAPAction in the OperationClient, it is configured in > o.a.axis2.jaxws.core.control.impl.AxisInvocationController.initOperationClient > method > ---> > String soapAction = ClientUtils.findSOAPAction(requestMsgCtx); > <--- > The codes in the ClientUtils.findSOAPAction will check the > configurations in the RequestContext, and even the action configured in the > Operation, it looks to me that the SOAPAction here is more valuable. > > The proposed the changes are in the > OperationClient.prepareMessageContext > From > ---> > if (mc.getSoapAction() == null || "".equals(mc.getSoapAction())) { > mc.setSoapAction(options.getAction()); > } > <--- > To > if (options.getAction() != null || options.getAction().length() > 0) { > mc.setSoapAction(options.getAction()); > } > <--- > Thoughts ? > Thanks. > -- > Ivan > -- Ivan
