[
https://issues.apache.org/jira/browse/CXF-3363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13019139#comment-13019139
]
Gladwin commented on CXF-3363:
------------------------------
Tested and verified this fix on Weblogic 11g with CXF-2.3.4
> Use MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL) instead of
> MessageFactory.newInstance()
> -------------------------------------------------------------------------------------------------------
>
> Key: CXF-3363
> URL: https://issues.apache.org/jira/browse/CXF-3363
> Project: CXF
> Issue Type: Improvement
> Components: JAX-WS Runtime, Soap Binding
> Affects Versions: 2.3.2
> Reporter: Gladwin
> Assignee: Daniel Kulp
> Fix For: 2.4, 2.3.4
>
>
> When it is known that SOAP version used is 1.1 [ {{instanceof Soap11}} ], CXF
> should use {{MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL)}}
> instead of {{MessageFactory.newInstance()}}
> Further more by default when version is neither of 1.1 or 1.2, then instead
> of returning {{null}}, CXF should return
> {{MessageFactory.newInstance(SOAPConstants.DEFAULT_SOAP_PROTOCOL)}} or
> {{MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL)}}
> *Given below is an example of cxf code where this refactoring can be done*
> {code:title=org.apache.cxf.jaxws.binding.soap.SOAPBindingImpl.java|borderStyle=solid}
> public MessageFactory getMessageFactory()
> {
> if (this.soapBinding instanceof SoapBindingInfo) {
> SoapBindingInfo bindingInfo = (SoapBindingInfo) this.soapBinding;
> try {
> if (bindingInfo.getSoapVersion() instanceof Soap11) {
> return MessageFactory.newInstance();
> } else if (bindingInfo.getSoapVersion() instanceof Soap12) {
> return
> MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
> }
> } catch (SOAPException e) {
> throw new
> WebServiceException(BUNDLE.getString("SAAJ_FACTORY_ERR"), e);
> }
> }
> return null;
> }
> {code}
> *Advantages*
> * In future, {{MessageFactory.newInstance()}} may not return object instance
> of the default implementation that does not supports "SOAP 1.1 Protocol"
> * Some JEE Appserver implementations of {{MessageFactory.newInstance()}},
> currently do not return factory that supports "SOAP 1.1 Protocol"
> ** Weblogic 10.3.x [ {{weblogic.webservice.core.soap.MessageFactoryImpl}} ]
> does not support SAAJ "SOAP 1.1 Protocol" ->
> "{{java.lang.UnsupportedOperationException: This class does not support SAAJ
> 1.1}}"
> * This could help ease use of CXF libraries in JEE applications even if
> Application Server has it's own SOAP/SAAJ implementation. By above method,
> CXF will always get {{MessageFactory}} that supports required protocol.
> *Related Isues*
> * https://issues.apache.org/jira/browse/CXF-976
> * https://issues.apache.org/jira/browse/CXF-1750
> * https://issues.apache.org/jira/browse/CXF-3307
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira