Is a client SOAP request simply the use of HTTP POST to send a correctly formatted HTTP header followed by the correctly formatted XML SOAP content to the web service server over a TCP/IP socket connection and then waiting for and parsing the response?
Is it this 'simple' or is there more going on behind the scenes?
I ask because of difficulty using gSOAP with C++ for multiple WSDL files and am considering writing a client from scratch.
SOAP can be used over any transport protocol like TCP, HTTP, SMTP etc with HTTP being the most popular.
SOAP over HTTP basically translates to a valid POST HTTP request with a SOAP envelope inside it, there where the form parameters would have been if we were to talk about a classic POST from the browser. The response body also contains a SOAP envelope, there where you would expect the HTML to be as response to the request from the browser.
You just have to use the proper content type for the SOAP version you are using (text/xml for SOAP 1.1 and application/soap+xml for SOAP 1.2) and maybe specify the SOAPAction header if needed (for SOAP 1.1), but that's about it as HTTP communication is concerned.
Then the receiver of the envelope (be it the server on a request or the client on a response) must make use of the SOAP message, but this has nothing to do with HTTP any more, HTTP just got the message there.
Related
I'm working with an old ERP system that is capable of sending SOAP requests.
Unfortunately the endpoints I would like to send my requests to uses REST.
Is it possible to send a SOAP request to a REST endpoint?
BR Kresten
You can send whatever you want to a REST endpoint.
You could have a "gatekeeper" REST endpoint that accepted SOAP in a POST payload and converted it to whatever representation the other endpoints required and returned that representation. e.g. JSON. So in effect it becomes a SOAP to JSON converter.
If you can only send SOAP direct from an ERP system to your endpoint, your endpoint could accept the SOAP in a POST request and do whatever it wanted with it. SOAP is just XML, so the endpoint could just parse it to get the info it would "normally" get via "traditional" REST such as JSON.
You could combine the two approaches. Your ERP system could send SOAP to the "gatekeeper" endpoint which converts the SOAP to JSON and sends the converted content to the intended endpoint.
I would like what happen when an web service receive part of data by SOAP header. What's the diference between receive data by SOAP header and SOAP body (Before the web service receive all of data by SOAP body)
I don't understand at all what are benefits of this new version.
PD: My web service is based on Java with JAX-WS
Thanks a lot.
Same as any request SOAP has header and body. generally SOAP has all data in body.
Body is highly documented so you can not send additional data in SOAP body.
If you are doing It may break the other end code(Implementation in different for different technologies).
SO if you want to send additional data in SOAP without effecting the WSDL you can use SOAP header.
Headers are like to send additional information.
these header and values can be accessed from message context.
to access these value code may vary from technology to technology
I am having confusion around http text 'post' in terms of webservice context. We are having a web service which is built on SOAP protocol, now the integration partner wants to eliminate the SOAP portion of the XML message and wants us to post XML message as 'http text post'.
Is this REST HTTP POST? Please clarify.
POST is an HTTP request method, of which there are many (ex. GET, PUT, DELETE, HEAD...). POST is used to submit data to a server for processing, whereas GET (for example) is used to retrieve data for reading. You can read more here. These methods are used for all HTTP communication, whether the target is a SOAP/REST web service or an Apache server hosting a regular website.
SOAP normally operates using POST requests, although it is possible to use GET with SOAP 1.2 as well. GET requests have more restrictive size limitations than POST requests.
I have a very basic Rest Server which returns JSON object. I tested it with Poster Firefox extension and I get both header and response.
But we have a test javascript client, which calls the service and when checked with Firebug, we see there is a header but no response.
To be sure, we tested the client with another JSON server and the client can read both the header and response.
As I mentioned, it is a very basic Apache CXF, Jax-RS service, so we are not sure what could be missing , that prevents from sending response or prevents client from reading response.
Will appreciate any help or input.
thank you
Walker
It wasn't the server it was the client which was not able to read the response properly.
Can someone confirm or clarify:
WSDL describes a web service's API to the outside world
SOAP represents an actual transmission of a web service request/response
So, if I understand correctly, WSDL-compliant XML is wrapped inside of SOAP and passed over HTTP to the web service interface, unwrapped, validated against the WSDL, processed, and responded to.
Yes? No? Close?
You're close.
The WSDL describes the contract that a Web Service adheres to or, in other words, the format that the service expects to receive and transmit data in.
SOAP (Simple Object Access Protocol) is one protocol by which Web Services communicate. SOAP will wrap the message with additional information. The message with the SOAP body carries must comply with the service's WSDL for the service to properly process the message.