Building a Soap Message

  • Thread starter Christopher D. Wiederspan
  • Start date
C

Christopher D. Wiederspan

I have a simple project in which I need to build a Soap message "by hand".
Essentially I'm using a System.Net.HttpWebRequest to post data to a
webservice. Everything is working well, but I'm currently using a
StringBuilder to build the Content (the Soap message) portion of the post.
I've got to believe that there is a better way to accomplish this. The
message that I need to build is something like this:

<?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>
<Execute xmlns="http://tempuri.org/">
<message>string</message>
</Execute>
</soap:Body>
</soap:Envelope>

Is my best bet to build an XmlDocument object that happens to contain the
Soap namespace, or is there some sort of object somewhere else in the
framework that makes building the Soap message easier?

Please let me know if you have any ideas.

Thanks,
Chris
 
G

Gary Chang

Hi Christopher,

Thanks for posting in the community.

I notice you have posted this problem aspnet.webservice, our colleagues
will reply you there. Please take a look of that queue,

If you have any more concerns on it, please feel free to post here.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

You can build soap messages using the .NET XML classes, which is a more
attractive method to build it, as you will be certain to have the correct
formatting when you are finished. Create the SOAP message as an XML doc and
add nodes to build the entire envelope hierarchy.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************************************************
Think outside the box!
***************************************************************
 
A

Ads

Could you post a sample piece of code. I searched quite a bit and
couldnt get hold of any. I need to send a digitally signed SOAP message
to a weblogic webservice from a vb.net application. If any one could
post or point me in the right direction, it is much appreciated.

thanks
 

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

Top