Sending a SoapEnvelope to a Web Service

H

Hari Menon

Hi,

I have a SoapEnvelope object that needs to be sent to a
web service.

The reason I am not using something like the
SoapHttpClientProtocol to invoke a method is becase I am
using a toolkit that creates the SoapEnvelope for me.

I do not want to call Invoke() with a method name (even
using Microsoft.Web.Services.Messaging.SoapClient) is
because the SoapEnvelope already contains the method and
params for it.

I just need to somehow send that envelope over HTTP to
the web service and get a response back.

Is there any clean way of doing this?

Thanks
Hari
 
B

BruceJohnson

I believe you can send a fully formatted SOAP envelope using the
System.Web.HttpRequest class. The trick is in setting the headers
correctly. The content-type needs to be "text/xml". The method is
"POST". The SoapAction needs to be the namespace associated with the web
service. The SoapAction header is added manually like the following:

req.Headers.Add ("SOAPAction: http://tempuri.org/service";);

HTH

Bruce Johnson
http://www.ObjectSharp.com/Bruce
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top