You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Bence <a0...@unet.univie.ac.at> on 2008/05/08 19:16:27 UTC
Servicemix as single access point to several web services
Hi all,
I am currently trying to configure apache service mix as a single access
point to a collection of web services. my goal is that any user agent
wanting to message a web service has to send that message to servicemix,
which will then route it to the appropriate web service. These web services
should be able to dynamically register and unregister themselves somehow
to/from servicemix, as they are outside of it and can be anywhere on the
internet.
My question is: which technology should I use to accomplish that?
So far I have been trying to use drools to route the messages to the
according web services based on a set of simple rules. But I'm not sure if I
am on the right path, because it's not 100% what I need. I have to manually
fill the drl files with the routing rule to each web service, I cannot
expose the wsdl files of the web services accordingly and I have problems
with HTTP authentication required by some of the web services.
What would be the best practice for my solution? I take it that this is one
of the main uses of servicemix, so I guess many of you have implemented
something similar?
Thanks in advance,
BR
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17129303.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by mattrpav <ma...@airband.com>.
Bence-
How did the requirement to have the ability to dynamically add and remove
services come about? I ask this, because it may be more work that it is
worth to implement and I'm not aware of any technology that would make this
practical on either end.
I don't know of any tool that can dynamically generate a WSDL based on a
dynamic list of available services, so you either have to write that, or
manually update the WSDL file every time you deploy an internal service.
Secondly, most clients need to have the WSDL defined ahead of time in order
to code against it. Having the services change dynamically will break
clients that have coded against a service that has since been removed.
I would suggest first implementing the base service and get that working,
and then consider implementing an authentication system that limits access
to methods based on a role or user scheme for additional services that are
deployed. There is little damage a client can do if they just 'know' of the
service, but don't have permission to execute it. You can also have a check
down by logging access to services and methods by user so you'll be able to
see if customers access something they are not supposed to.
Just a thought.
Matt Pavlovich
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17347695.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by Bence <a0...@unet.univie.ac.at>.
First of all, thank you both for your help. I will check that book out if I
can get my hands on it.
Matt: Your use case looks interesting, but I think it is more complex than
what I'm looking at. I will definitely try installing apache httpd in front
of servicemix for authentication, maybe that will solve a few problems
already.
But I think what I need is something like this:
http://www.enterpriseintegrationpatterns.com/DynamicRouter.html
The important thing is not that it should only be one WSDL to the outside, I
can expose each service on its own through a http endpoint. But what I need
is the possibility to dynamically add and remove services.
Now I've read this conversation:
http://markmail.org/message/tsnmrl6qbh7zdc6m#query:servicemix%20%22dynamic%20routing%22+page:1+mid:6qsk6s2erwffmzhx+state:results
It is said that endpoints can be added on the fly, but I couldn't find any
reference to that anywhere else. So that would be also be an option, to poll
a registry (maybe also outside servicemix itself) and create a new endpoint
when a new service arrives. But how to create those endpoints on the fly
(without altering any BC configuration and restarting servicemix)?
Is there something I might have missed? I couldn't find any implementation
of this dynamic routing pattern neither in servicemix-eip nor camel.
BR
mattrpav wrote:
>
> Bence-
>
> I think I am following you here. I've done something similar, but my
> 'middle box' was a couple of services, and not just one, but we exposed it
> all as one service to the client. I would suggest running something like
> an Apache proxy in front of ServiceMix, and you can add IP access and URL
> restrictions, thus ensuring external folks can only access the resources
> you want (opt-in vs opt-out). Apache can also handle various
> authentication services, and it may be easier to authenticate at that
> layer than at ServiceMix, depending on your auth scheme.
>
> You can use two components for handling SOAP services.. the CXF component
> and the HTTP component. A 'consumer' instance means your project intends
> to expose it essentially as server side. The 'provider' instance means
> your project intends to use the service as a client.
>
> You will want one 'consumer' service defined which is the WSDL you'll
> expose to your customer. For internal services, you just need to
> implement the cxf-se portion of the deployable, as the bc is only needed
> if you intend to allow entry point to the service outside the JBI
> container (HTTP, JMS, etc). Then for the orchestration, you can use a
> Camel component to handle the process flow. If you can get away with
> using XSLT for transformations, it is handy, so you can avoid any Java
> code, otherwise you'll need a Java bean component for doing and data
> manipulation.
>
>
> ExternalWS (consumer) <-> Camel component (pick EIP pattern) <-> various
> logic component(s) (cxf-se ?) <-> internal StockWS (provider)
>
> Does this help?
>
>
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17345213.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by mattrpav <ma...@airband.com>.
Bence-
I think I am following you here. I've done something similar, but my
'middle box' was a couple of services, and not just one, but we exposed it
all as one service to the client. I would suggest running something like an
Apache proxy in front of ServiceMix, and you can add IP access and URL
restrictions, thus ensuring external folks can only access the resources you
want (opt-in vs opt-out). Apache can also handle various authentication
services, and it may be easier to authenticate at that layer than at
ServiceMix, depending on your auth scheme.
You can use two components for handling SOAP services.. the CXF component
and the HTTP component. A 'consumer' instance means your project intends to
expose it essentially as server side. The 'provider' instance means your
project intends to use the service as a client.
You will want one 'consumer' service defined which is the WSDL you'll expose
to your customer. For internal services, you just need to implement the
cxf-se portion of the deployable, as the bc is only needed if you intend to
allow entry point to the service outside the JBI container (HTTP, JMS, etc).
Then for the orchestration, you can use a Camel component to handle the
process flow. If you can get away with using XSLT for transformations, it
is handy, so you can avoid any Java code, otherwise you'll need a Java bean
component for doing and data manipulation.
ExternalWS (consumer) <-> Camel component (pick EIP pattern) <-> various
logic component(s) (cxf-se ?) <-> internal StockWS (provider)
Does this help?
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17238777.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by Bence <a0...@unet.univie.ac.at>.
mattrpav wrote:
>
> If you just want processes within ServiceMix to have access to the web
> services, than just deploy the service-engine side of things and do not
> expose the binding component.
>
>
>
How to do that was my initial question, in a sense.
I want Servicemix to act as a gateway and proxy the webservices. The client
shouldn't even know what's happening behind the curtain.
Something like this (ignore the "firewall"):
http://www.nabble.com/file/p17236372/fig1.gif
The client can see a WSDL file and send SOAP messages to the endpoint
defined in it. But that "WSDL for Export" should be a dynamically created
replicate of the real WSDL file, which can be anywhere.
How could I achieve this setup with servicemix?
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17236372.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by mattrpav <ma...@airband.com>.
If you just want processes within ServiceMix to have access to the web
services, than just deploy the service-engine side of things and do not
expose the binding component.
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17155528.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by Bence <a0...@unet.univie.ac.at>.
mattrpav wrote:
>
> Bence-
>
> Can you help me understand what problem this solves? Why not just expose
> the web services individually and have the clients interact directly?
>
> Matt Pavlovich
>
Single point of access, single point of authentication, web services won't
accept messages from anywhere else than servicemix. Basically it should be a
middleware that at some point will do more than just route messages, but
first I'd like to solve it the easiest way.
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17144653.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Servicemix as single access point to several web services
Posted by mattrpav <ma...@airband.com>.
Bence-
Can you help me understand what problem this solves? Why not just expose
the web services individually and have the clients interact directly?
Matt Pavlovich
--
View this message in context: http://www.nabble.com/Servicemix-as-single-access-point-to-several-web-services-tp17129303p17135212.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.