Hi,

I've checked the JAXWS 2.2 spec, the related part is like

6.5.3 javax.xml.ws.RespectBindingFeature

The RespectBindingFeature is used to control whether a JAX-WS implementation 
MUST respect/honor the contents of the wsdl:binding associated with an 
endpoint. It has a corresponding RespectBinding annotation described in section 
7.14.3.

♦ Conformance (javax.xml.ws.RespectBindingFeature): When the 
javax.xml.ws.RespectBindingFeature is enabled, a JAX-WS implementation MUST 
inspect the wsdl:binding at runtime to determine result and parameter bindings 
as well as any wsdl:extensions that have the required=true attribute. All 
required wsdl:extensions MUST be supported and honored by a JAX-WS 
implementation unless a specific wsdl:extension has be explicitly disabled via 
a WebServiceFeature.

Per the spec, yeah, I'd say this is something CXF should follow, would you 
please create a jira to track it? And patch is welcomed, as always.

-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-3-5, at 下午3:36, Min Yang wrote:

> Hi,
> 
> When we test our application that enabled the RespectBinding feature, we
> found an issue in cxf-2.6.2. The issue is if we add an invalid binding
> under wsdl:binding element as you can see in below, a WebServiceException
> will be throw out when accessing the endpoint first time, and the endpoint
> will not be accessed, this is behavior is correct.
> 
>  <binding name="EchoPortBinding" type="tns:Echo">
>    <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
> style="document"/>
>    <tns:badBinding wsdl:required="true" uri="http://bad/bad"; xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/"; />
>    <operation name="echo">
>      <soap:operation soapAction=""/>
>      <input>
>        <soap:body use="literal"/>
>      </input>
>      <output>
>        <soap:body use="literal"/>
>      </output>
>      <fault name="Exception">
>        <soap:fault name="Exception" use="literal"/>
>      </fault>
>    </operation>
>  </binding>
> 
> But if we add the invalid binding under operation or its sub element
> (input, output or fault), like the example in below, then cxf will not
> check it, and the endpoint would be access after deployment, although the
> wsdl4j has deserialize it as an unkown element. So I think this should be a
> cxf defect, please confirm it. Thanks!
> 
>  <binding name="EchoPortBinding" type="tns:Echo">
>    <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
> style="document"/>
>    <operation name="echo">
>      <soap:operation soapAction=""/>
>      <tns:badBinding wsdl:required="true" uri="http://bad/bad"; xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/"; />
>      <input>
>        <soap:body use="literal"/>
>      </input>
>      <output>
>        <soap:body use="literal"/>
>      </output>
>      <fault name="Exception">
>        <soap:fault name="Exception" use="literal"/>
>      </fault>
>    </operation>
>  </binding>

Reply via email to