users@jax-rpc.java.net

Using local transport when hosting JAX-WS services

From: <jastrachan_at_mac.com>
Date: Thu, 1 Sep 2005 18:54:41 +0100

I'd like to be able to create a Service instance which performs local
invocations on in-JVM POJOs using JAX-WS so that I can plug in a
different transport layer into JAX-WS. i.e. using the existing
LocalTransport in both client and server parts.

If you're interested here's my use case on gory detail...

<UseCase>
I work on an open source ESB/JBI project called ServiceMix (http://
servicemix.org). We've a ton of components for working with different
transports (HTTP, JMS, files, Jabber, email, FTP, WebDAV etc)
together with lots of services like smart routing and transformation
etc. We've already got support for various SOAP stacks like SAAJ
(Axis), WSIF, XFire, ActiveSOAP.

I've just got the JAXWS binding for ServiceMix working so any JAX-WS
service can be invoked from inside the JBI bus (yay!) - (though using
my patched version of the JAX-WS RI, see my other recent emails for
details of those patches).

What that means is we can reuse the existing transports in ServiceMix
to do the messaging/transports, then delegate to the JAX-WS Service
to deal with the SOAP protocol & XML marshalling. So kinda like
we're using JBI as the transport with the JAX-WS RI. So we've got the
client side done - the JBI router can invoke JAX-WS services via the
Service/ServiceFactory API - i.e. using the client side of JAX-WS.

What I'd like to do next is to host JAX-WS services inside of JBI/
ServiceMix where JBI takes care of the transports and lets JAX-WS RI
do the SOAP protocol/XML marshalling work and the service can be
implemented locally, rather than going over HTTP.
</UseCase>


So I've been hunting through the code and have seen both http and
local transports are there. Yet the code currently only seems to
support the HTTP transport right? The only Endpoint implementation is
hardwired to use HTTP right now.

So from a fairly brief look at the code it looks like we need some
kind of LocalEndpoint implementation and change the EndpointImpl /
EndpointFactory to use LocalEndpoint if some binding URL is used
right? Is this a planned feature that's on someone's lists of things
to do? I'd be happy to try create a patch if you'd be interested?

Once we've got support for local endpoints on the server side of
things; the next challenge is gonna be, how can we dispatch to the
endpoint from the client side e.g. do we change the ServiceFactory/
Service mechanism to be able to use the LocalTransport? It seems like
most of the work has been done on the local transport it just needs
to be wired into the server side (Endpoint/EndpointFactory) and
client side (Service/ServiceFactory).

Does this all seem reasonable or am I way off base here? :). I'm
willing to help out if someone wants to give me some pointers?

James
-------
http://radio.weblogs.com/0112098/