> 1. I think there's a default <soap:binding /> when this element is not
> explicitly included.

Not sure where you got that impression.  From the WSDL spec:

http://www.w3.org/TR/wsdl#_soap:binding

"The soap:binding element MUST be present when using the SOAP binding."

If it's not there, the WSDL is invalid and CXF (and other toolkits) will not 
likely be able to work with it.

Dan



On Sep 26, 2012, at 4:47 AM, Jinhua Wang <[email protected]> wrote:

> Hello
> 
> I'm migrating a web service from existing wsdl.
> There's no <soap:binding /> element in the <wsdl:binding /> section.
> When deployed, there's an Bus exception thrown out.
> Stack:
> Caused by: org.apache.cxf.*BusException*:* NO_BINDING_FACTORY_EXC*
> at
> org.apache.cxf.bus.managers.BindingFactoryManagerImpl.getBindingFactory(BindingFactoryManagerImpl.java:123)
> at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:115)
> at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
> ... 16 more
> 
> *wsdl:*
>        <wsdl:binding name="SampleTestSOAP" type="tns:SampleTestPortType">
>        <!--
>        <soap:binding style="document" transport="
> http://schemas.xmlsoap.org/soap/http";></soap:binding>
>        -->
>                <wsdl:operation name="test">
>                        <soap:operation
>                                soapAction="http://sample.org/test"; />
>                        <wsdl:input>
>                                <soap:body use="literal"
> parts="testRequest" />
>                        </wsdl:input>
>                        <wsdl:output>
>                                <soap:body use="literal"
> parts="testResponse" />
>                        </wsdl:output>
>                </wsdl:operation>
>        </wsdl:binding>
> 
> *web service:*
> @WebService(targetNamespace = "http://sample.org";,
> serviceName = "SampleTest",
> portName = "SampleTestPort",
> wsdlLocation = "WEB-INF/wsdl/SampleTest.wsdl")
> public class SampleTest { xxxxxxxx}
> 
> 1. I think there's a default <soap:binding /> when this element is not
> explicitly included.
> 2. I tried to give a default wsdl binding "
> http://schemas.xmlsoap.org/wsdl/soap/"; when debugging in cxf code.
> 
> A new exception is thorwn out:
> java.lang.*RuntimeException*: Can not initialize SoapBinding, BindingInfo
> is not SoapBindingInfo
> at
> org.apache.cxf.binding.soap.SoapBindingFactory.createBinding(SoapBindingFactory.java:384)
> at org.apache.cxf.endpoint.EndpointImpl.createBinding(EndpointImpl.java:135)
> at org.apache.cxf.endpoint.EndpointImpl.<init>(EndpointImpl.java:82)
> at
> org.apache.cxf.jaxws.support.JaxWsEndpointImpl.<init>(JaxWsEndpointImpl.java:132)
> at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.createEndpoint(JaxWsServiceFactoryBean.java:238)
> at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createEndpoints(ReflectionServiceFactoryBean.java:335)
> at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:267)
> at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
> 
> *Related class:*
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildBinding(xxxxx)
>    bi = new BindingInfo(service, ns.toString());   // *change ns value
> from empty string to "http://schemas.xmlsoap.org/wsdl/soap/"*
> org.apache.cxf.binding.soap.SoapBindingFactory.createBinding(xxxxxx)
>    if (binding instanceof SoapBindingInfo) {xx}
>    throw new RuntimeException("Can not initialize SoapBinding, BindingInfo
> is not SoapBindingInfo");
> 
> 
> *3.* Can we register a default BindingFactory to BindingFactoryManager?
> 
> 
> Best Regards

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to