I have a use case for a legacy application that wants to access SOAP web services. They are on an AS400 with a bespoke protocol. They can use that protocol to embed and send XML over JMS.
I have written a Camel / Java bridge that neutralizes the protocol and is able to call the web services based on the XML information and transmits the results returned from the service. The web service calls are made through the client generated by the wsdl2java from CXF. Although this initial design works my issue comes with how to make this solution maintainable. I can of course map one to one all of the service methods calls to the incoming XML. This would however lack the flexibility we need in the face of changes to the WSDL. We do need to wrap a login/logout to each call (for server license reasons) and a security token must be used for 'real' service calls. On the whole however, the bridge should be a pass through. At the moment my solution uses some reflection on the JAXB classes to ensure the parameters are correctly ordered. It then parses the XML to match and convert the XML to the correct types (using xstream) for the service call. Although this works I am sure there must be a more elegant solution. I am seeking a solution that does something like this: - Paste the XML into a SOAP message, determined solely from the WSDL - Adds the appropriate namespace (maybe I could just do that with a little Camel XSLT) - does not rely on JAXB (though I might use that for the login / logout as they are very stable) - allows injection of new elements (the security token) The idea is to have minimal code dependencies to generate the WS call. I have looked at the various CXF clients and cannot find anything appropriate. The interceptor model looks interesting but I am not sure that I have sufficiently grokked it (OK I know I have not fully grokked it!) so that I can make these kind of design choices. It seems hard ;-) But maybe I have it wrong ... maybe one of you guys has done this kind of thing before and can sooth my aching head with a little sprinkle of CXF magic dust ;-) I hope my objectives and the problems are clear but I will be happy to clarify any points... Thanks in advance CXFers (bizarrely that sounds kinda insulting - don't take it that way!!) Ray -- View this message in context: http://cxf.547215.n5.nabble.com/xml-as-soap-body-tp2800258p2800258.html Sent from the cxf-user mailing list archive at Nabble.com.
