SOAP Newbie
-
Being extremely comfortable with XML, I'm finally learning some SOAP. I know the following is a SOAP request, but can someone shed some light on what each part represents?
POST /StockQuote HTTP/1.1
Host: www.stockquoteserver.com
Content-Type: text/xml; charset="utf-8"
Content-Length: 323
SOAPAction: Some-Namespace-URI#GetLastTradePrice
<SQ:Envelope
xmlns:SQ="http://schemas.xmlsoap.org/soap/envelope/"
SQ:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
SQ:Body
<m:GetLastTradePrice xmlns:m="Some-Namespace-URI">
<symbol>DIS
</m:GetLastTradePrice>
</SQ:Body>
</SQ:Envelope>Here again with the response package, I could really use some help deciphering it:
HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
<SP:Envelope
xmlns:SP="http://schemas.xmlsoap.org/soap/envelope/"
SP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
SP:Body
<m:GetLastTradePriceResponse
xmlns:m="Some-Namespace-URI">
<Price>34.5</Price>
</m:GetLastTradePriceResponse>
</SP:Body>
</SP:Envelope>Thanks!! Cheers, Tom Archer Author, Inside C# Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
-
Being extremely comfortable with XML, I'm finally learning some SOAP. I know the following is a SOAP request, but can someone shed some light on what each part represents?
POST /StockQuote HTTP/1.1
Host: www.stockquoteserver.com
Content-Type: text/xml; charset="utf-8"
Content-Length: 323
SOAPAction: Some-Namespace-URI#GetLastTradePrice
<SQ:Envelope
xmlns:SQ="http://schemas.xmlsoap.org/soap/envelope/"
SQ:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
SQ:Body
<m:GetLastTradePrice xmlns:m="Some-Namespace-URI">
<symbol>DIS
</m:GetLastTradePrice>
</SQ:Body>
</SQ:Envelope>Here again with the response package, I could really use some help deciphering it:
HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
<SP:Envelope
xmlns:SP="http://schemas.xmlsoap.org/soap/envelope/"
SP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
SP:Body
<m:GetLastTradePriceResponse
xmlns:m="Some-Namespace-URI">
<Price>34.5</Price>
</m:GetLastTradePriceResponse>
</SP:Body>
</SP:Envelope>Thanks!! Cheers, Tom Archer Author, Inside C# Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
First your soap request and responce is packaged as a standard HTTP request and responce that is the first set of data in both of your samples. Then internal to that you have a "data" section that is that meaningful part. POST /StockQuote HTTP/1.1 This line is a stock HTTP post Host: www.stockquoteserver.com Who is it to Content-Type: text/xml; what is the type of data text and xml charset="utf-8" how is the dataset being used Content-Length: 323 how much data is to be read from the socket being used. you have an error in your sample here. The header block should be terminated with a blank line (not a line with blanks ok) SOAPAction: Some-Namespace-URI#GetLastTradePrice define namespace to apply to the child data root element of the XML document being sent. it includes the version etc of the request. start of the body of data to be made available to the soap process What routine on the server is being called and the namespace to use DIS arguments to be made available to the routine processing the request. It will ask for them by name (like an envoriment variable). You only have one and it is not properly terminated. end of info for this process end of body end of data to make it a well formed document. Your responce is identical other than the header is that of a valid http responce vs request. Take Care and when should I start looking for your book a the stores? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
-
First your soap request and responce is packaged as a standard HTTP request and responce that is the first set of data in both of your samples. Then internal to that you have a "data" section that is that meaningful part. POST /StockQuote HTTP/1.1 This line is a stock HTTP post Host: www.stockquoteserver.com Who is it to Content-Type: text/xml; what is the type of data text and xml charset="utf-8" how is the dataset being used Content-Length: 323 how much data is to be read from the socket being used. you have an error in your sample here. The header block should be terminated with a blank line (not a line with blanks ok) SOAPAction: Some-Namespace-URI#GetLastTradePrice define namespace to apply to the child data root element of the XML document being sent. it includes the version etc of the request. start of the body of data to be made available to the soap process What routine on the server is being called and the namespace to use DIS arguments to be made available to the routine processing the request. It will ask for them by name (like an envoriment variable). You only have one and it is not properly terminated. end of info for this process end of body end of data to make it a well formed document. Your responce is identical other than the header is that of a valid http responce vs request. Take Care and when should I start looking for your book a the stores? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
Thanks Michael! Michael A. Barnhart wrote: Take Care and when should I start looking for your book a the stores? Inside C# should be in the stores next week!! Cheers, Tom Archer Author, Inside C# Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.