On 3/30/07, Owen Thomas <[EMAIL PROTECTED]> wrote:

Hi there.



I have written a java module that that allows me to run a shell script
as though it was a command line, and this module returns the results of
the execution back to the caller in an object containing the standard
out, standard error, and the processes operating system return value.



From my research, I have chosen to implement a web service using
ServiceMix as the container. ServiceMix provides me a small footprint
because it only implements WSDL and SOAP messaging. I have to host this
web service on the machine in which I will be executing my coveted shell
script. I wish to impose as little as possible on whatever else is
running on the machine. This appears architecturally appropriate.



So, I will have a ServiceMix container on this host. Inside, I want it
to run a jsr-181 service engine which will call my Java module, convert
what is returned into XML, and put this information on to the NMR bus,
to be picked up by an HTTP BC which will return the information to
whomever made the initial request through said BC. As I understand, the
jsr-181 SE needs to be a web service because JBI components use web
services internally to communicate with the NMR.



Okay, all good. Now, I appeal to know of some suggestions and hints as
to the strategy I might use to realise my jsr-181 component. Should I
use a WSDL first strategy, which will give me a web method stub that I
can then code out with the functionality needed to execute the shell
script, or should I code the class first, and generate the WSDL and
schemas for the function's parameters and return values as part of the
build process?



I think I should go class-first. This is because in this situation, I
feel that the WSDL interface is so far buried away as an internal
component of the deployment, it will bear absolutely no reason to
change, and development and maintenance would be easier. I'm sure this
is be all very simple to the experienced web services programmer. This
is my first try at a maven project (using the servicemix-jsr181
archetype), and the first time I will have written anything for
ServiceMix.



So, given that I'm going to be writing my jsr-181 service engine module
class-first, here are my questions:



1. How do I go about getting schemas from the parameter and return types
of the web method that I will be writing to sit within the jsr-181
container?


The jsr181 component will generate it on the fly at runtime.
As it uses xfire, you should also be able to use xfire at build time
to generate the schema if needed.  There is a maven archetype
for creating a SU based on jsr181 with an annotated pojo
(though it may have problem wrt to schema generation afaik).

2. How do I generate the WSDL that the NMR will need to talk to it?


Same answer.  The wsdl and the xm schemas are both generated  at
the same time.

3. Can I get this all to work together so that I can get Maven to create
all these items as part of one effortless build process?


Sure :-)

Thank you for your consideration,



  Owen.




--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Reply via email to