I used to work with Web Services the simple way: create a java class (or EJB), expose it as Web Service through Axis or RAD, generating the WSDL in the process. And then a client would just be the reverse, take the WSDL, use a tool (Axis or RAD) that creates client Java classes from it automatically. Simple, easy.
But this process starts to fail if you have
- several very similar WSDL: you want reuse instead of copy.
- other means of communicating XML represented by the XML schema embedded in the WSDL, for example via direct MQ use.
I found 2 techs that can help:
- SDOs (Service Data Objects): from my short experience, I find it a bit too verbose, and not yet fully mature, as you depend on libraries external to SDO ones for it to work in the case of web services. It can work, and if you use IBM products, it could be a good way to write Web Services Providers/Clients.
- Spring Web Services: I have not tried it yet, but it seems to solve exactly the kind of problems I described earlier. And you can plug-in any marshalling/unmarshalling framework you want :).
You can use any marshalling technology with Axis. I used JAXB with Axis 1.x quite a while ago. The "trick" is to tell Axis to not process the XML document (document type=XML iirc), and it will give it to you as is. Details are sketchy (that was a while ago), but it is doable!
ReplyDelete