My goal is to set up a generic web service. By “generic” in this context I mean that, one should be able to run an arbitrary sequence of tools on the input (let’s say a file).
These tools are compiled programms installed on the server.
My idea was to specify each tool in a central WSDL File. This WSDL File is parsed and for each tool, included in the WSDL file, a separate Service Class is created, which executes the respective tool via apache commons exec.
Is it then possible to manually create a SOAP Message in which the sequence of tools, one wants to perform on the input, is specified ? This SOAP Message should then be parsed and the respective Service Classes should be started.
I have to say I’m completely new to Web Service programming and I’m gratefuly for any advice. The above is just an idea and I’m open for any better advice 😉
greetings,
You can create, modify
SOAPmessages manually (programmatically) by implementingSOAPHandler<SOAPMessageContext>interface. Then you need to override this method:You get the
SOAPmessage fromSOAPMessageContextobject passed into this method:From your message you can get
SOAP Body,SOAP Envelope,SOAP Header. You can add as many element as you like by doing this. But do not forget that every element you add manually must match yourXSDof yourWSDLfile.To declare this handler into
JAX-WScontext you canSpringconfiguration as follows:More information about how to configure
JAX-WSendpoint you can find here. Also information about handlers you can find here.Hope this helps for a start.