Jonathan, I updated my source from svn, executed maven eclipse using maven1 (earlier I was using maven2) and the problem with namespace seems to be solved. But the issue regarding SaajMarshaller.createSOAP remains. I need to have document.importNode(node,true) instead of node.cloneNode(true). Cheers, Simon
"Simon Carni" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Jonathan, > First of all thank you for your reply! > > I'll put my comments inline... >>... >> What is the revision number of the SaajMarshaler you are working with? >>... > The revision number of SaajMarshaller is same as yours - 367116. > > ... >>If you run ServiceMix with log4j set to DEBUG, can you tell if the output >>of >> SaajMarshaler.toNMS and SaajMarshaler.createSOAP are correct? Have you >> verified that the issue is not with the HttpSoapConnector? > ... > > Outputs from both, SaajMarshaller.createSOAP and toNMS are correct. > SaajBinding returns correct message. Things go wrong after the message is > returned to HttpSoapConnector. Text bellow is printed right before src is > returned in invokeInOut method in HttpSoapConnector > (... > Source src = exchange.getOutMessage().getContent(); > exchange.setStatus(ExchangeStatus.DONE); > channel.send(exchange); > src = transformer.toDOMSource(src); > System.out.println("Body is: " + transformer.toString(src)); > return src; > ... > ) > That's the output: > Body is: <?xml version="1.0" encoding="UTF-8"?><ns1:serviceMethodResponse > xmlns:ns1="http://example3.userguide.samples" > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><serviceMethodReturn > > xsi:type="xsd:string">test > me</serviceMethodReturn></ns1:serviceMethodResponse> > > As you can see the namespace attribute is there. Following line in output > is this: > DEBUG - HandlerPipeline.invoke(95) | Invoking handler > org.codehaus.xfire.soap.handler.SoapSerializerHandler in phase post-invoke > I guess that's the spot where something goes wrong. > >> ....". Does this namespace issue arise once you replace >> node.cloneNode(true) with document.importNode(node,true)? The change to >> cloneNode() was implemented precisely to avoid the namespace issue that >> you >> are describing. > > Yes the issue arised after the change . Before the change the message > wasn't even sent from SaajBinding to WS. Now the things go wrong > somewhere on the "return path" of the message. > Looking at log we can say it's somewhere in HttpSoapConnector > (org.codehaus.xfire.soap.handler.SoapSerializerHandler more precisely) > > p.s. : I've tested document.appendChild(node.cloneNode(true)); and in the > case that parent document of cloned node is not the same as the document > we were going to append it to, it allways throws Exception. > > Cheers, > Simon > > > > > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Simon, >> >> What is the revision number of the SaajMarshaler you are working with? I >> am >> using the same xfire-all version, and revision 367116 with Systinet >> clients >> and services, and am not experiencing any of the problems that you seem >> to >> be encountering with Axis. In fact, the changes to the SaajMarshaler were >> put in place to fix the namespace problem that you are describing below. >> If >> you run ServiceMix with log4j set to DEBUG, can you tell if the output of >> SaajMarshaler.toNMS and SaajMarshaler.createSOAP are correct? Have you >> verified that the issue is not with the HttpSoapConnector? As an >> alternative, have you tried substituting your SOAP/XML data in to the >> SaajMarshalerTest? >> >> To clarify your situation a bit, in your note you say "Now there's >> another >> issue:...". Does this namespace issue arise once you replace >> node.cloneNode(true) with document.importNode(node,true)? The change to >> cloneNode() was implemented precisely to avoid the namespace issue that >> you >> are describing. >> >> regards, >> /jonathan >> >>> -----Original Message----- >>> From: news [mailto:[EMAIL PROTECTED] >>> Behalf Of Simon Carni >>> Sent: Thursday, January 12, 2006 10:39 PM >>> To: [email protected] >>> Subject: [servicemix-user] Re: Re: Exception in SaajMarshaler... >>> >>> >>> Hi Jonathan, >>> >>> The build is 3.0-SNAPSHOT and the xfire-all-1.0-20060106.jar. >>> I'm running it >>> on java 1.5.0-b64. >>> Thanx, >>> Simon >>> >>> <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>> northamerica.cexp.com... >>> Which version of the xfire-all jar are you running with? >>> Also, which build >>> of the various components are you running off of? >>> >>> > -----Original Message----- >>> > From: news [mailto:[EMAIL PROTECTED] >>> > Behalf >>> > Of Simon Carni >>> > Sent: Thursday, January 12, 2006 4:01 PM >>> > To: [email protected] >>> > Subject: [servicemix-user] Re: Exception in SaajMarshaler... >>> > >>> > >>> > Hi Guillaume, >>> > >>> > I think I know where the problem is : >>> > >>> > document.appendChild(node.cloneNode(true)); >>> > in method createSOAPMessage in SaajMarshaller throws A node >>> > is used in a >>> > different document than the one that created it exception. >>> > The workaround is to replace this with >>> > document.appendChild(document.importNode(node,true)); >>> > I had simillar issue on some other project... >>> > >>> > Now there's another issue: >>> > when the message is routed back to Axis client seems like >>> > xmlns attribute >>> > gets gets lost. >>> > Here's the document returned to AxisClient when the WS is >>> > called directly: >>> > >>> > <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope >>> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >>> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv >>> > :Body><ns1:serviceMethodResponse >>> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >>> > xmlns:ns1="http://example3.userguide.samples"><serviceMethodReturn >>> > xsi:type="xsd:string">simon</serviceMethodReturn></ns1:service >>> > MethodResponse></soapenv:Body></soapenv:Envelope> >>> > >>> > and here's the document returned when using SM as a "broker": >>> > <?xml version='1.0' encoding='UTF-8'?><soap:Envelope >>> > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" >>> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Bo >>> > dy><ns1:serviceMethodResponse >>> > soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >>> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >>> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><service >>> > MethodReturn >>> > xsi:type="xsd:string">simon</serviceMethodReturn></ns1:service >>> > MethodResponse></soap:Body></soap:Envelope> >>> > >>> > You can see xmlns:ns1="http://example3.userguide.samples" >>> > missing in second >>> > doc. >>> > As result I get org.xml.sax.SAXParseException: The prefix >>> > "ns1" for element >>> > "ns1:serviceMethodResponse" is not bound >>> > at Axis client. >>> > The attribute exists before >>> > org.codehaus.xfire.soap.handler.SoapSerializerHandler is >>> > invoked, so that >>> > could be the spot. >>> > >>> > Maybe I just missed something... >>> > Anyway thanx in advance >>> > Cheers, >>> > Simon >>> > >>> > >>> > "Guillaume Nodet" >>> > <[EMAIL PROTECTED]> >>> > wrote in message >>> > news:[EMAIL PROTECTED] >>> > > Could you raise a jira, specifying this stacktrace and the >>> > exact classpath >>> > > used. >>> > > The most important is the saaj implementation and dom >>> > implementation. >>> > > >>> > > Cheers, >>> > > Guillaume Nodet >>> > > >>> > > Simon Èarni wrote: >>> > > >>> > >>Hi, >>> > >> >>> > >>While trying to execute following scenario on SM 3.0-SNAPSHOT; >>> > >> >>> > >>Axis SOAP Client --> HttpSoapConnector --> SaajBinding >>> --> SOAP WS, >>> > >> >>> > >>I get exception: >>> > >> >>> > >>DEBUG - DefaultEndpoint.handleException(76) | Fault occurred! >>> > >>org.codehaus.xfire.fault.XFireFault: WRONG_DOCUMENT_ERR: A >>> > node is used in >>> > >>a dif >>> > >>ferent document than the one that created it. >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.components.http.HttpSoapInOutBinding.invokeInOu >>> > >>t(HttpSoapInOutBinding.java:143) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.components.http.HttpSoapInOutBinding$InOutServi >>> > >>ce.invokeInOut(HttpSoapInOutBinding.java:221) >>> > >> at sun.reflect.NativeMethodAccessorImpl.invoke0 >>> > (Native Method) >>> > >> at >>> > >> >>> > >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. >>> > >>java:39) >>> > >> at >>> > >> >>> > >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces >>> > >>sorImpl.java:25) >>> > >> at java.lang.reflect.Method.invoke(Method.java:585) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.service.binding.ObjectInvoker.invoke(ObjectInvoker >>> > >>.java:87) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessa >>> > >>ge(ServiceInvocationHandler.java:110) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(Se >>> > >>rviceInvocationHandler.java:72) >>> > >> at org.codehaus.xfire.handler.HandlerPipeline.invoke >>> > >> (HandlerPipeline.jav >>> > >>a:97) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoin >>> > >>t.java:58) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel. >>> > >>java:38) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.transport.http.XFireServletController.invoke(XFire >>> > >>ServletController.java:278) >>> > >> at >>> > >> >>> > >>> org.codehaus.xfire.transport.http.XFireServletController.doService(XF >>> > >>ireServletController.java :144) >>> > >> at org.apache.servicemix.component >>> > >> s.http.HttpSoapInOutBinding.process(Ht >>> > >>tpSoapInOutBinding.java:94) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.components.http.BindingServlet.doPost(BindingSe >>> > >>rvlet.java:75) >>> > >> at >>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:615) >>> > >> at >>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:688) >>> > >> at >>> > >> >>> > >>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java :428 >>> > >>) >>> > >> at >>> > >> >>> > >>> org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java >>> > >>:666) >>> > >> at >>> > >> >>> > >>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5 >>> > >>68) >>> > >> at org.mortbay.http.HttpContext.handle >>> > (HttpContext.java:1530) >>> > >> at >>> > org.mortbay.http.HttpContext.handle(HttpContext.java:1482) >>> > >> at >>> org.mortbay.http.HttpServer.service(HttpServer.java:909) >>> > >> at org.mortbay.http.HttpConnection.service >>> > >> (HttpConnection.java:816) >>> > >> at >>> > >> >>> org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) >>> > >> at >>> > org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) >>> > >> at org.mortbay.http.SocketListener.handleConnection >>> > >> (SocketListener.java: >>> > >>244) >>> > >> at >>> > org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) >>> > >> at >>> > org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) >>> > >>Caused by: org.w3c.dom.DOMException : WRONG_DOCUMENT_ERR: A >>> > node is used >>> > >>in a dif >>> > >>ferent document than the one that created it. >>> > >> at >>> > org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown >>> > >> Source) >>> > >> >>> > >> at >>> > org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source) >>> > >> at >>> > org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown >>> > >> Source) >>> > >> at >>> > org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.components.saaj.SaajMarshaler.createSOAPMessage >>> > >>(SaajMarshaler.java:140) >>> > >> at >>> > org.apache.servicemix.components.saaj.SaajBinding.onMessageExc >>> > >> hange(S >>> > >>aajBinding.java:88) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun >>> > >>d(DeliveryChannelImpl.java:587) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo >>> > >>w.java:179) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doSend(SedaFlow.java >>> > >>:137) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.jav >>> > >>a:121) >>> > >> at org.apache.servicemix.jbi.nmr.Broker.sendExchangePacket >>> > >> (Broker.java:2 >>> > >>85) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.container.JBIContainer.sendExchange(JBICont >>> > >>ainer.java:586) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(Delive >>> > >>ryChannelImpl.java :346) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli >>> > >>veryChannelImpl.java:420) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(Deli >>> > >>veryChannelImpl.java :397) >>> > >> at >>> > >> >>> > >>> org.apache.servicemix.components.http.HttpSoapInOutBinding.invokeInOu >>> > >>t(HttpSoapInOutBinding.java:132) >>> > >> ... 29 more >>> > >>DEBUG - HandlerPipeline.invoke(95) | Invoking handler >>> > >>org.codehaus.xfire.soap.ha >>> > >>ndler.FaultSoapSerializerHandler in phase post-invoke >>> > >>DEBUG - HandlerPipeline.invoke(95) | Invoking handler >>> > >>org.codehaus.xfire.handler >>> > >> >>> > >>... >>> > >> >>> > >>Any ideas??? >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > > >>> > > >>> > >>> > >>> > >>> >>> >>> >> > > > >
