Reputation: 1178
I am new to Java SOAP web services. My questions are-
1) How can i expose and endpoint with SOAP, does WSDL definition always required? What is the content of that WSDL?
2) How my web service will know that it has to except a byte array? In REST, it was easy to get a file submitted using Multipart
3) What is the process of writing a SOAP server, the configurations
? For REST using SPRING, it is declaring the servletTransport Beans
in serverContext.xml
and in web.xml
give the 'servlet mapping'
4) Also, i need to know the scenarios where one cannot use REST web service
5) In SO
, i read REST and SOAP are not mutually exclusive. A RESTful architecture may use HTTP or SOAP as the underlying communication protocol
. How?
Upvotes: 0
Views: 1402
Reputation: 4757
1) An endpoint using SOAP does not require a WSDL to operate but it is almost always there as it is very tightly coupled to the webservice. The WSDL contains a description of what the service looks like so basically which input and output parameters there are, their types etc. Actually exposing the endpoint is usually the task of the server so it will depend on what software you are running.
2) In SOAP you can use Multipart as well (google for XOP+MTOM) but unless you are talking really big files, you will probably use a base64 encoded string for byte[]. Depending on the framework this is not really your concern as the framework will see that you are trying to get a byte[] and will generate the base64 string automatically.
3) Don't know about spring, but for Java EE, the spec is JAX-WS. It is almost as easy as a JAX-RS (rest) service but there are a few additional things to keep in mind.
4) REST is easier than SOAP, but SOAP has the massive advantage that there is a WSDL. This allows client generation which reduces development time. REST has WADL but it's not there yet. For this reason SOAP is actually pretty much the de facto standard for business-level webservices.
5) REST is always HTTP as it basically reuses the entire HTTP "stack" (e.g. http authentication etc). SOAP however can run on anything (e.g. JMS, HTTP,...) though in practice people almost only use it on HTTP. However because it can not rely on a fixed protocol, it has reinvented every wheel. Whereas REST reuses HTTP authentication, SOAP has a spec to follow (WS-Security). There are a number of WS-* standards.
Upvotes: 2