Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4876

CXF RespectBinding feature does not support the customized binding info under operation and its sub element.

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      The RespectBinding description in the JAXWS 2.2 spec is:

      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.

      But 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.

      <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>

      Attachments

        1. JaxWsEndpointImpl.java.patch
          4 kB
          Alan Yang
        2. CXF-4876-checkstyle.patch
          4 kB
          Freeman Yue Fang
        3. cxf-4876.patch
          28 kB
          Alan Yang

        Activity

          People

            ffang Freeman Yue Fang
            mg0432062 Alan Yang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: