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