[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    Re: Problem copying the DOM
From:       David Waite <mass () akuma ! org>
Date:       2005-03-03 18:52:32
Message-ID: 5A77C722-55F4-4388-9B37-B460B455FC29 () akuma ! org
[Download RAW message or body]

Ahh yes, with SAAJ SOAPMessage is (somewhat) equivalent to  
org.w3c.dom.Document. I believe it contains an instance of a Document  
within it.

-David Waite

On Mar 3, 2005, at 11:33 AM, Don Stewart wrote:

> Ian & David thanks for the replies.
>
> David yours got rid of that problem, however, I could only find that  
> API call on the SOAPMessage level.
>
> Ian, afraid I'm not on Axis just using SAAJ direct.
>
> Cheers
>
> Don
>
> From: Springer, Ian P. [mailto:ian.springer@hp.com]
> Sent: 03 March 2005 18:27
> To: dev@xmlbeans.apache.org
> Subject: RE: Problem copying the DOM
>
> Hi Don,
>
> I've encountered the same exception on several occasions. It can be  
> tricky to get around.
>
> For your particular situation (trying to add an XmlObject to a SAAJ  
> SOAPBody), if you happen to be running under Axis, you might want to  
> try doing it the following way:
>
>      body.addChildElement( new  
> org.apache.axis.message.SOAPBodyElement(
>                 (Element)  
> responseBodyXBean.newDomNode().getFirstChild() ) );
>
> This has been working for me. If you want to see the larger context  
> of the above code snippet, see  
> http://svn.apache.org/repos/asf/incubator/apollo/trunk/src/java/org/ 
> apache/ws/resource/handler/ResourceHandler.java.
>
> Regards,
> Ian
>
> From: Don Stewart [mailto:Don.Stewart@corizon.com]
> Sent: Thursday, March 03, 2005 1:02 PM
> To: dev@xmlbeans.apache.org
> Subject: Problem copying the DOM
>
> Hi,
>
> I have created the a Document from WSDL. I am trying to add the  
> instanciated document to the SOAP Element by using:-
>
> svcElem.appendChild(lResolveIPDocument.newDomNode());
>
> Where :-
>
>       Name svcInfo =  
> envelope.createName(operation.getTargetMethodName(), "",  
> targetObjectURI);
>       SOAPElement svcElem = body.addChildElement(svcInfo);
>
> But when I invoke the SOAP call I get the following error which I  
> think is sonething to do with how I'm copying the XMLBeans DOM node  
> into the SOAP document:-
>
> Error invoking operation:
>
> WRONG_DOCUMENT_ERR: A node is used in a different document than the  
> one that created it.
>
>
>
> Anyone got any ideas?
>
>
>
> Regards
>
>
>
> Don


[Attachment #3 (unknown)]

<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: \
after-white-space; "><DIV>Ahh yes, with SAAJ SOAPMessage is (somewhat) equivalent to \
org.w3c.dom.Document. I believe it contains an instance of a Document within \
it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-David \
Waite</DIV><DIV><BR>On Mar 3, 2005, at 11:33 AM, Don Stewart \
wrote:<BR><BR><BLOCKQUOTE type="cite">  <DIV dir="ltr" align="left"><SPAN \
class="170163218-03032005"><FONT face="Arial" color="#0000ff" size="2">Ian &amp; \
David thanks for the replies.</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN \
class="170163218-03032005"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> \
</DIV> <DIV dir="ltr" align="left"><SPAN class="170163218-03032005"><FONT \
face="Arial" color="#0000ff" size="2">David yours got rid of that problem, however, I \
could only find that API call on the SOAPMessage level.</FONT></SPAN></DIV> <DIV \
dir="ltr" align="left"><SPAN class="170163218-03032005"><FONT face="Arial" \
color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN \
class="170163218-03032005"><FONT face="Arial" color="#0000ff" size="2">Ian, afraid \
I'm not on Axis just using SAAJ direct.</FONT></SPAN></DIV> <DIV dir="ltr" \
align="left"><SPAN class="170163218-03032005"><FONT face="Arial" color="#0000ff" \
size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN \
class="170163218-03032005"><FONT face="Arial" color="#0000ff" \
size="2">Cheers</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN \
class="170163218-03032005"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> \
</DIV> <DIV dir="ltr" align="left"><SPAN class="170163218-03032005"><FONT \
face="Arial" color="#0000ff" size="2">Don</FONT></SPAN></DIV><BR> <DIV \
class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <HR tabindex="-1"> \
<FONT face="Tahoma" size="2"><B>From:</B> Springer, Ian P. [<A \
href="mailto:ian.springer@hp.com">mailto:ian.springer@hp.com</A>] <BR><B>Sent:</B> 03 \
March 2005 18:27<BR><B>To:</B> <A \
href="mailto:dev@xmlbeans.apache.org">dev@xmlbeans.apache.org</A><BR><B>Subject:</B> \
RE: Problem copying the DOM<BR></FONT><BR></DIV> <DIV></DIV> <DIV dir="ltr" \
align="left"><SPAN class="871301418-03032005"><FONT face="Arial" color="#0000ff" \
size="2">Hi Don,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> \
</DIV> <DIV dir="ltr" align="left"><SPAN class="871301418-03032005"><FONT \
face="Arial" color="#0000ff" size="2">I've encountered the same exception on several \
occasions. It can be tricky to get around.</FONT></SPAN></DIV> <DIV dir="ltr" \
align="left"><SPAN class="871301418-03032005"><FONT face="Arial" color="#0000ff" \
size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" size="2">For your \
particular situation (trying to add an XmlObject to a SAAJ SOAPBody), if you happen \
to be running under Axis, you might want to try doing it the following \
way:</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> \
</DIV> <DIV dir="ltr" align="left"><SPAN class="871301418-03032005"><FONT \
face="Arial" color="#0000ff" size="2">     body.addChildElement( new \
org.apache.axis.message.SOAPBodyElement(<BR>                (Element) \
responseBodyXBean.newDomNode().getFirstChild() ) );</FONT></SPAN></DIV> <DIV \
dir="ltr" align="left"><SPAN class="871301418-03032005"><FONT face="Arial" \
color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" size="2">This has been \
working for me. If you want to see the larger context of the above code snippet, see \
<A href="http://svn.apache.org/repos/asf/incubator/apollo/trunk/src/java/org/apache/ws \
/resource/handler/ResourceHandler.java">http://svn.apache.org/repos/asf/incubator/apol \
lo/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java</A>.</FONT></SPAN></DIV> \
<DIV dir="ltr" align="left"><SPAN class="871301418-03032005"><FONT face="Arial" \
color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" \
size="2">Regards,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN \
class="871301418-03032005"><FONT face="Arial" color="#0000ff" \
size="2">Ian</FONT></SPAN></DIV><BR> <BLOCKQUOTE dir="ltr" style="padding-left: 5px; \
margin-left: 5px; border-left-color: rgb(0, 0, 255); border-left-width: 2px; \
border-left-style: solid; margin-right: 0px; ">  <DIV class="OutlookMessageHeader" \
lang="en-us" dir="ltr" align="left">  <HR tabindex="-1">  <FONT face="Tahoma" \
size="2"><B>From:</B> Don Stewart   [<A \
href="mailto:Don.Stewart@corizon.com">mailto:Don.Stewart@corizon.com</A>] \
<BR><B>Sent:</B> Thursday, March 03, 2005   1:02 PM<BR><B>To:</B> <A \
href="mailto:dev@xmlbeans.apache.org">dev@xmlbeans.apache.org</A><BR><B>Subject:</B> \
Problem   copying the DOM<BR></FONT><BR></DIV>  <DIV></DIV>  <DIV><SPAN \
class="780033517-03032005"><FONT face="Arial" size="2">Hi,</FONT></SPAN></DIV>  \
<DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2"></FONT></SPAN> \
</DIV>  <DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2">I have \
created the   a Document from WSDL. I am trying to add the instanciated document to \
the   SOAP Element by using:-</FONT></SPAN></DIV>  <DIV><SPAN \
class="780033517-03032005"><FONT face="Arial" size="2"></FONT></SPAN> </DIV>  \
<DIV><SPAN class="780033517-03032005"><FONT face="Arial" \
size="2">svcElem.appendChild(lResolveIPDocument.newDomNode());</FONT></SPAN></DIV>  \
<DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2"></FONT></SPAN> \
</DIV>  <DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2">Where   \
:-</FONT></SPAN></DIV>  <DIV><SPAN class="780033517-03032005"><FONT face="Arial" \
size="2"></FONT></SPAN> </DIV>  <DIV><SPAN class="780033517-03032005"><FONT \
face="Arial" size="2">      Name svcInfo =   \
envelope.createName(operation.getTargetMethodName(), "",   targetObjectURI);<BR>      \
SOAPElement svcElem =   body.addChildElement(svcInfo);</FONT></SPAN></DIV>  \
<DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2"></FONT></SPAN> \
</DIV>  <DIV><SPAN class="780033517-03032005"><FONT face="Arial" size="2">But when I \
invoke   the SOAP call I get the following error which I think is sonething to do \
with   how I'm copying the XMLBeans DOM node into the SOAP   \
document:-</FONT></SPAN></DIV>  <DIV><SPAN class="780033517-03032005"><FONT \
face="Arial" size="2"></FONT></SPAN> </DIV>  <DIV><SPAN \
class="780033517-03032005"><FONT color="#ff0000">  <P><FONT size="2">Error invoking \
operation:</FONT></P>  <P><FONT size="2">WRONG_DOCUMENT_ERR: A node is used in a \
different document   than the one that created it.</FONT></P>  <P><FONT \
size="2"></FONT> </P>  <P><SPAN class="780033517-03032005"><FONT face="Arial" \
color="#000000" size="2">Anyone   got any ideas?</FONT></SPAN></P>  <P><SPAN \
class="780033517-03032005"><FONT face="Arial" color="#000000" size="2"></FONT></SPAN> \
</P>  <P><SPAN class="780033517-03032005"><FONT face="Arial" color="#000000" \
size="2">Regards</FONT></SPAN></P>  <P><SPAN class="780033517-03032005"><FONT \
face="Arial" color="#000000" size="2"></FONT></SPAN> </P>  <P><SPAN \
class="780033517-03032005"><FONT face="Arial" color="#000000" \
size="2">Don</FONT></SPAN></P></FONT></SPAN></DIV></BLOCKQUOTE></BLOCKQUOTE></DIV><BR></BODY></HTML>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic