Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1243 Resolve JBoss common jax-ws testsuite issues
  3. CXF-2006

RespectBinding feature and not understood required extensibility elements

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.3
    • 2.4.3, 2.5
    • JAX-WS Runtime
    • None

    Description

      As per jaxws spec , the wsdl:extension that have the required=true should be checked :
      " When the javax.xml.ws.RespectB-
      indingFeature 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."

      [alessio@localhost trunk]$ mvn -Ptestsuite,jboss424,hudson -Dtest=JBWS2449TestCase test
      ...
      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running org.jboss.test.ws.jaxws.jbws2449.JBWS2449TestCase
      Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 7.585 sec <<< FAILURE!

      Results :

      Failed tests:
      testWithRespectBinding(org.jboss.test.ws.jaxws.jbws2449.JBWS2449TestCase)

      Tests run: 3, Failures: 1, Errors: 0, Skipped: 0

      The testcase basically deploy an EJB3 webservice endpoint with its own user specified wsdl contract. Here is an extract from the wsdl, there's a foo:bar required extensibility element:
      <binding name='EndpointBinding' type='tns:Endpoint'>
      <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
      <foo:bar wsdl:required="true"/>
      <operation name='echo'>
      <soap:operation soapAction=''/>
      <input>
      <soap:body use='literal'/>
      </input>
      <output>
      <soap:body use='literal'/>
      </output>
      </operation>
      </binding>
      <service name='EndpointService'>
      <port binding='tns:EndpointBinding' name='EndpointPort'>
      <soap:address location='http://127.0.0.1:8080/jaxws-jbws2449'/>
      </port>
      </service>

      The testcase gets the port specifing a RequestBindingFeature(true) so that it expects an error because of the foo:bar unknown ext element.

      public void testWithRespectBinding() throws Exception
      {
      URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
      QName serviceName = new QName("http://org.jboss.ws/jbws2449", "EndpointService");
      try

      { Service.create(wsdlURL, serviceName).getPort(Endpoint.class, new RespectBindingFeature(true)); fail("Exception expected, the wsdl has a not understood required extensibility element!"); }

      catch (Exception e)

      { //NOOP }

      }

      Attachments

        Activity

          People

            ema Jim Ma
            asoldano Alessio Soldano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: