axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Fremantle" <pzf...@gmail.com>
Subject Re: Embedding XML into SOAP
Date Fri, 16 Mar 2007 16:38:18 GMT
Rich

Can you let us see the WSDL? I don't understand the usecase.

Paul

On 3/16/07, Rich Adili <Rich.Adili@xata.com> wrote:
> Thanks for the suggestions, Paul. I tried the nodatabinding approach and
> it got me past my original problem. Unfortunately, both suggested
> approaches return an OMElement and I have 48 web methods to implement.
> I'm not keen on writing that much unwrapping code.
>
> So, can someone tell me what I did wrong in the first place?
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Friday, March 16, 2007 8:57 AM
> To: axis-user@ws.apache.org
> Subject: Re: Embedding XML into SOAP
>
> Rich
>
> Is the XML the whole of the SOAP body? Because its much simpler to use
> the ServiceClient API which takes an OMElement directly.
>
> ServiceClient sc = new ServiceClient(url);
> // if the service needs an action:
> sc.getOptions().setAction("http://whatever");
> OMElement response = sc.sendReceive(omElement);
>
> The other option is to generate the stub using the nodatabinding
> approach which will mean you don't have all those classes.
>
> Try wsdl2java -d none
>
> Paul
>
> On 3/16/07, Rich Adili <Rich.Adili@xata.com> wrote:
> >
> >
> >
> > I'm writing a client for a service that takes an XML document as
> input. I'm
> > using WSDL2Java-generated code for my client. The generated code wants
> an
> > OMElement for the XML data. This snippet attempts to supply that.
> Clearly,
> > it ain't right as the send throws an exception. What am I doing wrong?
> >
> >
> >
> >         public void testme(final InputStream xmlStream) throws
> Exception
> >
> >         {
> >
> >                 DispatchImportServiceStub stub = new
> > DispatchImportServiceStub();
> >
> >                 DispatchImportServiceStub.ImportTripPlan
> > dataObject =
> >
> >                                 new
> > DispatchImportServiceStub.ImportTripPlan();
> >
> >                 DispatchImportServiceStub.Plan_type0 Plan =
> > new DispatchImportServiceStub.Plan_type0();
> >
> >                 XMLStreamReader parser =
> > XMLInputFactory.newInstance().createXMLStreamReader(xmlStream);
> >
> >                 StAXOMBuilder builder = new StAXOMBuilder(parser);
> >
> >                 OMElement documentElement =
> builder.getDocumentElement();
> >
> >                 Plan.setExtraElement(documentElement);
> >
> >                 dataObject.setPlan(Plan);
> >
> >                 stub.ImportTripPlan(dataObject);
> >
> >         }
> >
> >
> >
> > org.apache.axis2.AxisFault: Error in extracting message properties;
> nested
> > exception is:
> >
> >         org.apache.rampart.RampartException: Error in
> > extracting message properties
> >
> >         at
> > org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
> >
> >         at
> > org.apache.axis2.engine.Phase.invoke(Phase.java:382)
> >
> >         at
> > org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:522)
> >
> >         at
> > org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:655)
> >
> >         at
> >
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
> ation.java:237)
> >
> >         at
> >
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO
> peration.java:202)
> >
> >         at
> >
> net.xatanet.axisstubs.DispatchImportServiceStub.ImportTripPlan(DispatchI
> mportServiceStub.java:141)
> >
> >         at
> >
> net.xatanet.services.DispatchImportService.ImportTripPlan(DispatchImport
> Service.java:82)
> >
> >         at test.TestImportTripPlan.run(TestImportTripPlan.java:33)
> >
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> >         at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
> >
> >         at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
> >
> >         at java.lang.reflect.Method.invoke(Method.java:597)
> >
> >         at test.GUI$2$1.run(GUI.java:97)
> >
> >         at java.lang.Thread.run(Thread.java:619)
> >
> > Caused by: org.apache.rampart.RampartException: Error in
> > extracting message properties
> >
> >         at
> >
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:294
> )
> >
> >         at
> > org.apache.rampart.MessageBuilder.build(MessageBuilder.java:56)
> >
> >         at
> > org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:59)
> >
> >         ... 14 more
> >
> > Caused by: org.apache.ws.security.WSSecurityException:
> > Error in converting SOAP Envelope to Document; nested exception is:
> >
> >         org.apache.axiom.om.OMException:
> > javax.xml.stream.XMLStreamException:
> > org.apache.axiom.om.OMException: Parser has already reached end of the
> > document. No siblings found
> >
> >         at
> >
> org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.
> java:121)
> >
> >         at
> >
> org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:146
> )
> >
> >         ... 16 more
> >
> > Caused by: org.apache.axiom.om.OMException:
> > javax.xml.stream.XMLStreamException:
> > org.apache.axiom.om.OMException: Parser has already reached end of the
> > document. No siblings found
> >
> >         at
> >
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:1
> 99)
> >
> >         at
> > org.apache.axiom.om.impl.dom.NodeImpl.build(NodeImpl.java:469)
> >
> >         at
> > org.apache.axiom.om.impl.dom.DocumentImpl.build(DocumentImpl.java:476)
> >
> >         at
> >
> org.apache.rampart.util.Axis2Util.getDocumentFromSOAPEnvelope(Axis2Util.
> java:107)
> >
> >         ... 17 more
> >
> > Caused by: javax.xml.stream.XMLStreamException:
> > org.apache.axiom.om.OMException: Parser has already reached end of the
> > document. No siblings found
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMStAXWrapper.updateLastNode(OMStAXWrapper
> .java:952)
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:913)
> >
> >         at
> >
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:1
> 16)
> >
> >         ... 20 more
> >
> > Caused by: org.apache.axiom.om.OMException: Parser has already reached
> end
> > of the document. No siblings found
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementIm
> pl.java:269)
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMNavigator._getFirstChild(OMNavigator.jav
> a:159)
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMNavigator.updateNextNode(OMNavigator.jav
> a:128)
> >
> >         at
> > org.apache.axiom.om.impl.llom.OMNavigator.next(OMNavigator.java:109)
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMStAXWrapper.updateNextNode(OMStAXWrapper
> .java:961)
> >
> >         at
> >
> org.apache.axiom.om.impl.llom.OMStAXWrapper.updateLastNode(OMStAXWrapper
> .java:950)
> >
> >         ... 22 more
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message