Reputation: 13698
I want to send a request to a web service, and read the response. So far, I used JAXB to generate Java classes from an XSD, which I am assuming I will use to read the response?
What is the best way for me to implement the request? The web service I am using is a servlet and requires a POST. Is my only option to send a string that is a SOAP request using HttpURLConnection?
Upvotes: 1
Views: 288
Reputation: 100050
I recommend a visit to Apache CXF. What you want is not just naked JAX-B, but a JAX-WS+JAX-B service, which will take care of all this for you. In particular, you can use a JAX-WS provider to create a soap endpoint when there is no WSDL.
Upvotes: 1
Reputation: 1633
If you say you're in control of the other party - or actually you are that party because you just want to do remoting between two JVMs, then use another remoting solution. Depending on your needs, you could use something like protobuf, hessian, or something like Terracotta. These frameworks are much easier to use and far more efficient.
Upvotes: 0