Hi,

Thanks for this quick answer.

I impacted the momdifications you are talking about and there is no difference. 
The client still generates SOAP 1.1 messages....


-----Message d'origine-----
De : Freeman Fang [mailto:[email protected]] 
Envoyé : mercredi 19 janvier 2011 10:06
À : [email protected]
Objet : Re: Unable to set Soap Version to 1.2

Hi,

My comment inline
On 2011-1-19, at 下午4:54, MARTELLI Julien wrote:

> Hi all,
>
> I am facing a problem with the SOAP message version.
> I am really stuck with this problem so any help would be appreciated.
>
> OK so here is the context.
>
> I have a WSDL file from which I generate sources using the wsdl2java  
> CXF Maven plugin.
> Here is an extract of my WSDL file :
>
> <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>  xmlns="http://schemas.xmlsoap.org/wsdl/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema 
> "
>  xmlns:ihe="urn:ihe:iti:xds-b:2007" 
> xmlns:rs="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0 
> "
>  targetNamespace="urn:ihe:iti:xds-b:2007" 
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/ 
> "
>  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl";  
> name="DocumentRepository">
> ...
> <binding name="DocumentRepository_Binding"  
> type="ihe:DocumentRepository_PortType">
>    <soap12:binding style="document" 
> transport="http://schemas.xmlsoap.org/soap/http 
> "/>
I think transport here should be
transport="http://www.w3.org/2003/05/soap/bindings/HTTP/";
>    <operation name="DocumentRepository_ProvideAndRegisterDocumentSet- 
> b">
>      <soap12:operation 
> soapAction="urn:ihe:iti:2007:ProvideAndRegisterDocumentSet-b 
> "/>
>      <input>
>        <soap12:body use="literal"/>
>      </input>
>      <output>
>        <soap12:body use="literal"/>
>      </output>
>    </operation>
>    <operation name="DocumentRepository_RetrieveDocumentSet">
>      <soap12:operation soapAction="urn:ihe:iti:2007:RetrieveDocumentSet 
> "/>
>      <input>
>        <soap12:body use="literal"/>
>      </input>
>      <output>
>        <soap12:body use="literal"/>
>      </output>
>    </operation>
>  </binding>
> ;;;
> <service name="DocumentRepository_Service">
>    <port name="DocumentRepository_Port_Soap12"  
> binding="ihe:DocumentRepository_Binding">
>      <soap12:address 
> location="https://servicelocation/DocumentRepository_Service 
> "/>
>    </port>
>  </service>
>
>
> On the generated interface there is no annotation concerning the  
> Binding :
>
> @WebService(targetNamespace = "urn:ihe:iti:xds-b:2007", name =  
> "DocumentRepository_PortType")
> @XmlSeeAlso 
> ({oasis.names.tc.ebxml_regrep.xsd.query._3.ObjectFactory.class,  
> oasis.names.tc.ebxml_regrep.xsd.rs._3.ObjectFactory.class,  
> ObjectFactory.class,  
> oasis.names.tc.ebxml_regrep.xsd.lcm._3.ObjectFactory.class,  
> oasis.names.tc.ebxml_regrep.xsd.rim._3.ObjectFactory.class})
> public interface DocumentRepositoryPortType {
> ...
>
>
> Then I use the generated classes to contact the Web Service and my  
> client is not configured via Spring but build programmatically.
>
> The problem is that the generated SOAP message is a SOAP 1.1  
> message...
> I am not able to find a way to configure my client to use a SOAP 1.2  
> binding, and I tried to add the annotation  
> @BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)  
> on the generated interface (as someone suggested to me on this  
> stackoverflow post :
You should add annotation like
@javax.xml.ws.BindingType(value = 
"http://www.w3.org/2003/05/soap/bindings/HTTP/ 
")

You can get more details from the wsdl_first_soap12 example shipped  
with kit.

Freeman
> http://stackoverflow.com/questions/4248098/cxf-how-to-set-soapversion-on-cxf-port-without-spring)
>  
>  but it didn't change anything...
> Maybe it's because I configure my client without Spring and thus the  
> default Soap 1.1 version is used...
> I really don't know...
>
>
> Do you guys have an idea ?
>
> Thanks in advance !
> J.


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org

Reply via email to