users@jersey.java.net

[Jersey] Re: Jersey Client API as transport for JAX-WS requests

From: Maarten Boekhold <boekhold_at_gmx.com>
Date: Wed, 25 Feb 2015 11:23:44 +0400

Hi Marek,

Initially the motivation behind this was that I was investigating how i
could consolidate in internal application (more like a framework
actually) onto a single API to configure things like SSL, authentication
and proxy stuff. This internal application currently uses plain HTTP
requests (HttpURLConnection), JAX-WS (CXF), REST client calls (Jersey)
and SAAJ (plain URLConnection, also the reason for my other question on
this list about manipulating HTTP headers in a MessageBodyWriter). The
more I looked into this, the more I got interested as well how the
JAX-WS RI handled its underlying HTTP communication as well, so I got a
bit fixated on this :)

So far it looks like the below implementation works, but I've only done
limited testing. I'd be really interested in having an expert take a
quick look at this, to see if I'm doing anything stupid.

Maarten

On 2015-02-24 20:42, Marek Potociar wrote:
> I wonder what was your motivation behind this? My first guess is that
> you wanted to do something more low-level and loosely coupled. If so,
> did you consider JAX-WS Dispatch
> <http://docs.oracle.com/javaee/5/api/javax/xml/ws/Dispatch.html> API?
>
> Marek
>
>> On 23 Feb 2015, at 14:28, Maarten Boekhold <boekhold_at_gmx.com
>> <mailto:boekhold_at_gmx.com>> wrote:
>>
>> Hi all,
>>
>> I've cleaned up my code a bit, and published it at
>> https://github.com/boekhold/jaxws-jersey-client-api. I'd be very
>> interested to hear your feedback on this!
>>
>> One note, the
>> maarten.jaxws.jersey.client.JerseyClientTransportTube.checkStatusCode()
>> method was copied pretty much verbatim from the JAX-WS RI at
>> https://java.net/projects/jax-ws/sources/sources/content/tags/JAXWS_2_2_5_07282011/jaxws-ri/rt/src/com/sun/xml/ws/transport/http/client/HttpTransportPipe.java?rev=14203.
>> I have no idea what implications that has on any licensing. If
>> anybody can comment on that I'd be very grateful.
>>
>> Maarten
>>
>> On 2015-02-23 15:46, Maarten Boekhold wrote:
>>>
>>> On 2015-02-22 16:37, Maarten Boekhold wrote:
>>>> Hi all,
>>>>
>>>> I'm wondering if it is in any way possible to use the Jersey Client
>>>> API as the 'entry point' for HTTP communication for JAX-WS *client
>>>> requests*, eg:
>>>
>>> I've managed to implement this. My code is currently on a
>>> company-internal server. I suppose I should clean it up a bit
>>> (remove company references) and push it to my github account. And
>>> also, I'm sure there's still bugs in it. But the thing works in
>>> principle (at least using the
>>> http://www.webservicex.net/ws/WSDetails.aspx?CATID=2&WSID=9
>>> StockQuote example).
>>>
>>> Maarten
>>
>