Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty HTTP Client as transport for JAX-WS requests

Hi,

Done some more research. I think something like the following should be possible:

  • Create a JettyHttpClientFeature extends WebServiceFeature that acts as the container for the HttpClient instance to use
  • Pass that feature as part of the service.getXXXPort(feature) "proxy factory" method
  • Create (and register) a JettyHttpClientTransportTubeFactory/JettyHttpClientTransportTube implementations
  • The factory has access to the ClientTubeAssemblerContext, which has access to WSBinding which has access to the WebServiceFeatures that were provided to the getXXXPort() method.
    • If our JettyHttpClientFeature is enabled, then return an instance of JettyHttpClientTransportTube (initialized with the HttpClient connection)
    • Otherwise return the default HttpTransportPipe (which implements Tube)

Any comments on this?

Maarten

On 2015-02-17 12:58, Maarten Boekhold wrote:
Hi all,

I am wondering if it is in any way possible to use the Jetty HTTP Client to handle the underlying HTTP communication for JAX-WS *client requests*, eg:

HttpClient client = new HttpClient();
// configure HttpClient

Service service = ...;
StockQuote quoteService = (StockQuote)service.getPort(portName);
javax.xml.ws.BindingProvider bp = (javax.xml.ws.BindingProvider)quoteService;
Map<String,Object> context = bp.getRequestContext();
context.setProperty("HTTP.CLIENT", client);
Float quote = quoteService.getPrice(ticker);

And that request would be done using the "client" instance of HttpClient. Also, this would need to work with the JAX-WS reference implementation as included in JSE 7 & 8.

If something like this is not currently possible, does anybody have any idea where to start looking for what needs to be coded? I've been looking at the JAX-WS specifications, specifically chapters 5 & 6 (Service APIs and Core APIs), but I'm getting a bit lost. Googling also has turned up something related to "TransportPipeFactory", which I guess is specific to the reference implementation, because it's not mentioned in the JAX-WS standard specifications.

Maarten


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top