I've, tried both the xformat and http, using the wsdl_first, both of which 
point to the XMLBindingFactory.  
The difference between the wsdl_first_xml_wrapped and what I'm trying is I'm 
using the Spring bean syntax (so I can inject the client) instead of the direct 
object invoke. The problem, as far as I can tell, is that the 
JaxWsProxyFactoryBeanDefinitionParser never sets the 
org.apache.cxf.jaxws.JaxWsClientFactoryBean.setBindingId(String), which causes 
the initialization to "default" to soap bindingId instead of looking it up from 
the BindingInfo.  JaxWsServerFactoryBean initialization goes through 
WSDLServiceBuilder to build EndpointInfo/BindingInfo, while 
JaxWsClientFactoryBean doesn't, building it itself in 
AbstractWSDLBasedEndpointFactory, but relying on someone calling setBindingId 
first.

What I'm doing:
        <jaxws:client id="JMS_prototype.Client"
                xmlns:tns="urn:expedia:cc:samples:sampleservice:v2:contract"
                serviceName="tns:SampleService" 
endpointName="tns:SampleServiceJMSBinding"
                address="jms://"
                
serviceClass="expedia.cc.samples.sampleservice.v2.contract.SampleServicePortType">
                <jaxws:features>
                        <ref bean="JMSConfigFeature" />
                </jaxws:features>
        </jaxws:client>

Instead of the sample code:
        SampleService ss = new SampleService(wsdlURL, SERVICE_NAME);
        SampleServicePortType port = ss.getSampleServiceJMSSOAPBinding();  

I want it in bean definition, so that I can leverage the jaxws:features, and 
inject it into other bean definitions.



Wsdl:
xmlns:xformat="http://cxf.apache.org/bindings/xformat";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:jms="http://cxf.apache.org/transports/jms";

        <wsdl:binding name="SampleServiceBinding" 
type="tns:SampleServicePortType">
<!-- xformat does not work -->
                <xformat:binding/>
                <wsdl:operation name="operationConcatenateStrings">
                        <wsdl:input>
                                <mime:content type="application/xml" />
                        </wsdl:input>
                </wsdl:operation>
<!-- soap works.  Commented out
                <soap:binding style="document"
                        transport="http://cxf.apache.org/transports/jms"; />
                <wsdl:operation name="operationConcatenateStrings">
                        <soap:operation 
soapAction="local://operationConcatenateStrings" />
                        <wsdl:input>
                                <mime:content type="application/xml" />
                        </wsdl:input>
                </wsdl:operation>
-->     
        </wsdl:binding>

        <wsdl:service name="SampleService">
                <wsdl:port name="SampleServiceJMS"
                        binding="tns:SampleServiceBinding">
                        <jms:address />
                </wsdl:port>
        </wsdl:service>

ClientImpl.invoke:
        chain.toString()
Chain org.apache.cxf.phase.PhaseInterceptorChain@22cf71b7. Current flow:
  setup [PolicyOutInterceptor]
  pre-logical [HolderOutInterceptor, SwAOutInterceptor, 
WrapperClassOutInterceptor, SoapHeaderOutFilterInterceptor]
  post-logical [SoapPreProtocolOutInterceptor]
  prepare-send [MessageSenderInterceptor]
  pre-stream [AttachmentOutInterceptor, StaxOutInterceptor]
  write [SoapOutInterceptor]
  marshal [BareOutInterceptor]


ChainInitiationObserver.onMessage:
        phaseChain.toString()
Chain org.apache.cxf.phase.PhaseInterceptorChain@32e6e42e. Current flow:
  receive [PolicyInInterceptor, AttachmentInInterceptor]
  post-stream [StaxInInterceptor]
  post-protocol [JAXBAttachmentSchemaValidationHack]
  unmarshal [URIMappingInterceptor, XMLMessageInInterceptor, 
DocLiteralInInterceptor]
  pre-logical [OneWayProcessorInterceptor]
  post-logical [WrapperClassInInterceptor]
  pre-invoke [HolderInInterceptor]
  invoke [ServiceInvokerInterceptor]
  post-invoke [OutgoingChainInterceptor]


-----Original Message-----
From: Freeman Fang [mailto:[email protected]] 
Sent: Thursday, May 05, 2011 6:33 PM
To: [email protected]
Subject: Re: jaxws:client with non-soap binding?

Hi,

Do your wsdl follow the wsdl_first_xml_wrapped example we shipped with  
kit? That's an example how to specify xmlbinding in wsdl.
More importantly, for the binding part, you should have  
<xformat:binding />

Freeman


On 2011-5-6, at 上午1:24, Sven Zethelius wrote:

> Is it possible to use the spring jaxws:client declaration with a non- 
> soap binding, like XMLBinding?
>
> I'm using cxf 2.3.2, and even though the WSDL is using namespace 
> "http://schemas.xmlsoap.org/wsdl/http/ 
> " it's falling back to the default binding of soap binding.  This  
> causes it to not use the right protocol when talking to the service  
> created by spring declaration of jaxws:endpoint, since it is  
> initialized with XMLBinding, given the same WSDL.
>
> Is this  a bug, or just not a supported configuration, or something  
> extra I have to set to specifically control the binding?
>

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference








Reply via email to