MikeCombe
asked on
How do I write the WebMethod() to generate the "The SOAP response" like below ?
I am having trouble writing a SOAP response.
I can write the SOAP WebMethod, which looks like the "A SOAP request" indicated below.
<WebMethod()> _
Public Function GetStockPrice(StockName As String) As String
Return "<m:Price>34.5</m:Price>"
End Function
I don't know how to write the WebMethod() to generate this...
<m:Price>34.5</m:Price>
---> How do I write the WebMethod() to generate the "The SOAP response" like below ?
Reference:
http://www.w3schools.com/soap/soap_example.asp
A SOAP request:
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockN ame>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
The SOAP response:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>
</m:GetStockPriceResponse>
</soap:Body
</soap:Envelope>
---- end ---
I can write the SOAP WebMethod, which looks like the "A SOAP request" indicated below.
<WebMethod()> _
Public Function GetStockPrice(StockName As String) As String
Return "<m:Price>34.5</m:Price>"
End Function
I don't know how to write the WebMethod() to generate this...
<m:Price>34.5</m:Price>
---> How do I write the WebMethod() to generate the "The SOAP response" like below ?
Reference:
http://www.w3schools.com/soap/soap_example.asp
A SOAP request:
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockN
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
The SOAP response:
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>
</m:GetStockPriceResponse>
</soap:Body
</soap:Envelope>
---- end ---
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks