Spring Web Service Client Architecture and Design Suggestions
I'm tasked to create a web service client that will access a third-p开发者_如何转开发arty SOAP-based web service.
Our original programmer use Apache Axis to access the web service. He basically had to generate the POJO classes based on the WSDL file.
I'm going to use Spring WS instead to implement the client web service. I've seen examples. I'm not touching any of the Apache Axis stuff. Can someone give me an idea of the architecture and design of the client that I will be implementing?
Here's what I plan to do:
1. Get a copy of the WSDL
2. Generate the POJO classes based on WSDL
3. Implement the web service client using Spring web service template.
4. Use the POJO classes to contain the data that I will be sending, manipulating, and receiving. A marshaller/unmarshaller will do the conversion from XML to Object and vice versa
To generate the POJO classes from the WSDL file what program or jar should I use?
Also, what's the difference between SAAJ and Apache's AXIOM? I know I'm gonna use one of these.
If you are implementing a SOAP web service client then you need a tool for marshaling XML to some POJO objects. have a look at Jax-WS ri and JaxB for the purpose. Both are compatible with Spring web framework and Spring-WS. You need to create a stub using one of the above mentioned tools. More information read this and this
精彩评论