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

Non-blocking WS call with CXF

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 3.0.0-milestone1
    • Invalid
    • Transports
    • Moderate

    Description

      It is not clear which are the use cases when one can use asynchronous client calls. The possible use cases would be:

      • server-side implemented callback transport
      • server-side implemented polling transport
      • client-side only callback using non-blocking IO

      However http.asyncclient supports all of them, I see no sign of CXF supporting the last one. Is there a way of calling a server this way?

      Using the configuration below I tried to call a WS this way, but CXF is always looking for async binding on the server side (javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method getDataFromWebService_Async).

      Client configuration:

      <jaxws:client id="client"
      serviceClass="my.sample.SampleWebService"
      address="http://localhost:8080/sample-ws-cxf/SampleWebService">
      <jaxws:properties>
      <entry key="javax.xml.ws.client.connectionTimeout" value="10" />
      <entry key="javax.xml.ws.client.receiveTimeout" value="11000" />
      <entry key="org.apache.cxf.transport.http.async.usePolicy" value="ALWAYS" />
      <entry key="org.apache.cxf.transport.http.async.ioThreadCount" value="2" />
      </jaxws:properties>
      </jaxws:client>

      code:

      client.getDataFromWebService_Async("" + id.getAndIncrement(), new AsyncHandler<Person>() {
          @Override
          public void handleResponse(Response<Person> resp) {
              Person person;
              try {
                  person = resp.get();
                  ...
              } catch (InterruptedException | ExecutionException e) {
                  ...
              }
          }
      });
      

      If I log out the conduit, it tells that it is: org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit ( log.info(ClientProxy.getClient(client).getConduit().getClass().getName()); )

      I'm using cxf 3.0.1, and httpasyncclient version 4.0.1 with spring 3.2.2.RELEASE

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            bence.takacs Bence Takács
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: