Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2005

Tip: Looking for answers? Try searching our database.

problem in creating SOAP Envelop in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
naveed - 05 Jul 2005 16:34 GMT
Hi,
I am trying to create a SOAP Envelop in C# . The output of the SOPA Envelop
should be like this :

----------------------------------------------------------------------------------
<soap:Envelope xmlns:wsa=".."
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<wsa:Action>
    http://schemas.microsoft.com/wse/2003/06/RequestDescription
<wsa:Action>
</soap:Header>
<soap:Body />
</soap:Envelope>

----------------------------------------------------------------------------------

I have this code to make SOAP Envelop :

private static SoapEnvelope CreateEmptyEnvelope()
{

SoapEnvelope env = new SoapEnvelope();

XmlElement header = env.CreateHeader();

XmlElement body = env.CreateBody();

env.Header.InnerXml = String.Format("<wsa:Action
xmlns:wsa='urn:MyReceiver'>http://schemas.microsoft.com/wse/2003/06/RequestDescription</wsa:Action>");

return env;

}

But When i see the output of my code the   xmlns:wsa  is missing there .

How to add this attribute in my code to make the complete SOAP Envelop .

thanks in advance.

Naveed.
Nathan Anderson [MSFT] - 08 Jul 2005 17:30 GMT
To change the addressing headers on the envelope you should the Addressing
property of the envelope's SoapContext property, otherwise the pipeline will
overwrite it when it's processed.  So instead of accessing the headers
directly, try something like this:

env.Context.Addressing.Action =
"http://schemas.microsoft.com/wse/2003/06/RequestDescription";

HTH.

Nathan Anderson [MSFT]

> Hi,
> I am trying to create a SOAP Envelop in C# . The output of the SOPA Envelop
[quoted text clipped - 25 lines]
>
> env.Header.InnerXml = String.Format("<wsa:Action

xmlns:wsa='urn:MyReceiver'>http://schemas.microsoft.com/wse/2003/06/RequestD
escription</wsa:Action>");

> return env;
>
[quoted text clipped - 7 lines]
>
> Naveed.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.