Please help me with building SOAP ENVELOPE

K

kaush

I am using WSE to send SOAP messages. I am very new to SOAP
Actually I have a sample SOAP message from my client with envelope
element, header and a big body. I am not sure how to construct an
envelope using the SOAPENVELOPE class.

Since I have this one sample message from my client which I want to
send it across and test, I am just copying the header part and
populating "envelope.Header.InnerText" and copying the body part and
populating the "envelope.SetBodyObject()" method. I tried many other
ways with other methods. This seems not to be working.
Could someone please help me in constructing the SOAPENVELOPE ? Is
there any way to load the sample SOAP message I have into a
SOAPENVELOPE object?

Please help me out. I am not able to find proper documentation for the
SOAPENVELOPE methods or properties. Any links would really help.

Thanks,
kaush
 
N

Nirosh

Hey,

You don't have to manually contruct the SOAP envelop. it just created
automatically what you have to do is construct the object you need to send
in side your code and throw it out, and the system will automatically
created the envelop for that.

Soap envelop is some container that use to transfer your data via the SOAP
protocol, let me give you a sample

This is a soap envelop that send a string value

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld2Response xmlns="http://tempuri.org/">
<HelloWorld2Result>string</HelloWorld2Result>
</HelloWorld2Response>
</soap:Body>
</soap:Envelope>

but you don't have to create this.. see the web method for this..

[WebMethod]
public string HelloWorld2()
{
return "hello";
}

Nirosh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top