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 / December 2004

Tip: Looking for answers? Try searching our database.

SoapEnvelope SetBodyObject() ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarkoH - 05 Dec 2004 21:09 GMT
SoapEnveloper.SetBodyObject() allows to add only one object instance into
the body. Calling it twice with different instance it won't add another
instance into body. What if messages have multiple parts ?
Myself, for instance, read schema from WSDL, use xsd.exe tool to generate
classes file and then use those classes to create class instances, assign
values to properties and then add such an object with SetBodyObject. But if
message has two or more parts, this doesn't work anymore.

Please provide help on this subject.
Thank you
Roman Kiss [MVP] - 06 Dec 2004 20:06 GMT
That's true, and it's done by design. The SetBodyObject/GetBodyObject pair
will work only for one (first) XmlElement Child in the soap.Body.
In your case, you can still use the SetBodyObject method adding a first
child and then simply add  XmlElement(s) to the soap.Body using for instance
method:
AppendChild(envelope.Body.ImportNode((XmlNode) yourObject, true));

HTH

Roman

> SoapEnveloper.SetBodyObject() allows to add only one object instance into
> the body. Calling it twice with different instance it won't add another
[quoted text clipped - 6 lines]
> Please provide help on this subject.
> Thank you
Dan Rogers - 06 Dec 2004 21:06 GMT
Hi,

SOAP only allows one element child under the Body element.  This means you
cannot box-car items into the SOAP body.  Doing so can result in
unexpected/unsupported behaviors.  If you want to have multiple children
under body, define another element to contain them, and then put this
element under body as the only child.

Dan Rogers
Microsoft Corporation
--------------------
From: "Roman Kiss [MVP]" <rkiss@pathcom.com>
References: <O00e56w2EHA.824@TK2MSFTNGP11.phx.gbl>
Subject: Re: SoapEnvelope SetBodyObject() ?
Date: Mon, 6 Dec 2004 12:06:03 -0800
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Message-ID: <ehqSt882EHA.208@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: 66.161.34.129
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5043
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

That's true, and it's done by design. The SetBodyObject/GetBodyObject pair
will work only for one (first) XmlElement Child in the soap.Body.
In your case, you can still use the SetBodyObject method adding a first
child and then simply add  XmlElement(s) to the soap.Body using for
instance
method:
AppendChild(envelope.Body.ImportNode((XmlNode) yourObject, true));

HTH

Roman

> SoapEnveloper.SetBodyObject() allows to add only one object instance into
> the body. Calling it twice with different instance it won't add another
[quoted text clipped - 6 lines]
> Please provide help on this subject.
> Thank you
Roman Kiss [MVP] - 06 Dec 2004 22:04 GMT
I agree with you - the best and clear solution is to package all XmlElements
under one child.

Roman

> Hi,
>
[quoted text clipped - 49 lines]
>> Please provide help on this subject.
>> Thank you
Dan Rogers - 07 Dec 2004 00:43 GMT
Thanks... Any other solution is a bug.

--------------------
From: "Roman Kiss [MVP]" <rkiss@pathcom.com>
References: <O00e56w2EHA.824@TK2MSFTNGP11.phx.gbl>
<ehqSt882EHA.208@TK2MSFTNGP12.phx.gbl>
<UXFsEe92EHA.3440@cpmsftngxa10.phx.gbl>
Subject: Re: SoapEnvelope SetBodyObject() ?
Date: Mon, 6 Dec 2004 14:04:47 -0800
Lines: 72
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <uwFcD$92EHA.2012@TK2MSFTNGP15.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: 66.161.34.129
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5047
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

I agree with you - the best and clear solution is to package all
XmlElements
under one child.

Roman

> Hi,
>
[quoted text clipped - 21 lines]
> NNTP-Posting-Host: 66.161.34.129
> Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
> phx.gbl
> Xref: cpmsftngxa10.phx.gbl
[quoted text clipped - 23 lines]
>> Please provide help on this subject.
>> Thank you

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.