I understand what you're saying, but I don't understand why
Body.unmarshall() throws out the root element of what you are passing in.  I
expected unmarshall to automatically add the Body tag to whatever XML I
passed to it (which it does).  But I surely did not expect it to remove the
root element to whatever I sent it.  That's why I'm wondering if unmarshall
expects to get the body tag as the root element?  But then I would think it
better for the method to check if the root element is the body tag - if so
do NOTHING, if not then just add in the body tag...

Second, if Body.unmarshall automatically adds the body tag - then it seems
logical that Body.marshall should automatically remove it??? 

Just trying to figure out the reasoning behind this...

Thanks

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 8:03 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Body.marshall and Body.unmarshall confusion 
> [Virus Checked]
> 
> 
> The reason why Body has marshall() and unmarshall() methods 
> is so that an object
> of that type can be converted to XML as specified in the SOAP 
> protocol. So when
> you marshall() a Body you should expect it to generate a 
> valid SOAP body in XML.
> The unmarshall() method is to allow a Body object to be 
> created from SOAP XML
> that arrives over the wire. This particular implementation 
> expects the calling
> code to separate the whole body subpart from the message and 
> hand it to the
> unmarshall() method. It's that simple. The intelligence to 
> handle the body
> subpart is contained in the Body class.
> 
> Now, this is not the most convenient thing for people working 
> at the messaging
> level, but it's not too bad either - just put SOAP body tags 
> around the things
> you are using to load the body. That makes sense in a way, 
> you're loading the
> body just as if your strings had just arrived off the wire.
> 
> Does that answer your question?
> 
> S-
> 
> 
> 
> 
> 
> "Rafert, Tim" <[EMAIL PROTECTED]> on 02/13/2002 07:35:20 PM
> 
> Please respond to [EMAIL PROTECTED]
> 
> To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> cc:    (bcc: Steve Salkin/3rd/US/AON)
> 
> Subject:  Body.marshall and Body.unmarshall confusion  [Virus Checked]
> 
> 
> 
> I'm still very  confused by the Body.unmarshall() and now 
> also  Body.marshall().
> 
> With unmarshall - I  still don't understand why it is 
> throwing out the root
> element of the  xml...
> 

Reply via email to