axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xu cai" <jeffrey...@gmail.com>
Subject Re: Can't generate SOAP Envelope, "org.xml.sax.SAXParseException: Premature end of file"
Date Fri, 21 Jul 2006 01:40:43 GMT
Martin,
     thanks for your reply. I appreciate it.
I know that it's may because the input xml is not well-formed.
but, as you know, I am invoking an web-service through the generatd stub
class by wsdl2java.  the soap request is also generated by Axis, so I even
can't see the content of the generated soap request.

can anybody tell me how can I have a look at the generated soap request ?

if the soap message is not well-formed, what's the possible root cause ?
 what should I do ? should I report a bug to axis ? or it's caused by my own
code or wsdl ?

thanks
-xucai.


On 7/21/06, Martin Gainty <mgainty@hotmail.com> wrote:
>
>  Xu-
> Things to look for are is the input XML contain perhaps
> missing End Tag (e.g. <element> without a </element>)
> Sub elements content clipped or chopped off
> <SOAP:header>
> ...no end tag
> or missing <SOAP:body>
>
> Use any XML Editor such as XMLSpy or even IE in a
> pinch and the XMLParser will tell you where the error/missing content occurs
> Martin
> *********************************************************************
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
>
>
>
>  ----- Original Message -----
> *From:* xu cai <jeffreycai@gmail.com>
> *To:* axis-user@ws.apache.org ; axis-dev@ws.apache.org
>  *Sent:* Thursday, July 20, 2006 5:41 AM
> *Subject:* Can't generate SOAP Envelope, "org.xml.sax.SAXParseException:
> Premature end of file"
>
>
> Hi All , I run a simple test class to access my webservice deployed on
> axis 1.2.1 (Built on Jun 14, 2005 (09:15:57 EDT). and got an exception.The truth is soap
msg can't be generated and an SAX xml exception is thrown.
> Could anyone tell me what happened ? and how to fix that ?
>
> many thanks.
>
>
> the src code SoapPart.java looks as:
>         dser.getEnvelope().setOwnerDocument(this);
>         // This may throw a SAXException
>         try {
>             dser.parse();  // exception
>         } catch (SAXException e) {
>             Exception real = e.getException();
>             if (real == null)
>                 real = e;
>             throw AxisFault.makeFault(real);
>         }
>
> Exception msg:
>
> AxisFault
>  faultCode: {
> http://schemas.xmlsoap.org/soap/envelope/}Server.userException<http://schemas.xmlsoap.org/soap/envelope/%7DServer.userException>
>  faultSubcode:
>  faultString: org.xml.sax.SAXParseException : Premature end of file.
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException
> <http://xml.apache.org/axis/%7DstackTrace:org.xml.sax.SAXParseException>:
> Premature end of file.
>         at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
>         at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown
> Source)
>         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse (Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>         at javax.xml.parsers.SAXParser.parse (SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(
> DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope (Message.java:424)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(
> MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine (Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:2424)
>         at org.apache.axis.client.Call.invoke(Call.java:2347)
>         at org.apache.axis.client.Call.invoke(Call.java:1804)
>         at com.sswitch.oam.soap.intf.Bts10200SoapBindingStub.request(
> Bts10200SoapBindingStub.java:297)
>         at com.sswitch.oam.soap.test.SimpleTest.main(SimpleTest.java :22)
>
>         {http://xml.apache.org/axis/}hostname:sha-view1.cisco.com<http://xml.apache.org/axis/%7Dhostname:sha-view1.cisco.com>
>
> org.xml.sax.SAXParseException: Premature end of file.
>         at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
>         at org.apache.axis.Message.getSOAPEnvelope (Message.java:424)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(
> MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine (Call.java:2765)
>         at org.apache.axis.client.Call.invoke(Call.java:2748)
>         at org.apache.axis.client.Call.invoke(Call.java:2424)
>         at org.apache.axis.client.Call.invoke(Call.java:2347)
>         at org.apache.axis.client.Call.invoke(Call.java:1804)
>         at com.sswitch.oam.soap.intf.Bts10200SoapBindingStub.request(
> Bts10200SoapBindingStub.java:297)
>         at com.sswitch.oam.soap.test.SimpleTest.main(SimpleTest.java :22)
> Caused by: org.xml.sax.SAXParseException: Premature end of file.
>         at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)
>         at org.apache.xerces.util.ErrorHandlerWrapper.fatalError (Unknown
> Source)
>         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>         at org.apache.xerces.parsers.XMLParser.parse (Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
>         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
>         at javax.xml.parsers.SAXParser.parse (SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(
> DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>
>


-- 
- xucai

Mime
View raw message