You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ramya Manian <ra...@persistent.co.in> on 2004/06/30 11:27:41 UTC

RE: Very urgent: "Read timed out" error while parsing the response

Hi

Furthur to my earlier problem given below, I found out that the "Read timed out"
error occurs
when XML parser is trying to fetch the document version from the response. By
default EasySOAP (which is used by our server) does not include the XML
declaration in the response. Once the XML declaration (<?xml version="1.0"
encoding="UTF-8"?>) was included, the timed out exception got resolved.
But now I get a SAX parser exception as "Content is not allowed in prolog". I
have included the response that I receive from the server and the stack trace of
the exception. Can someone please explain why I get this error? Is anything
wrong in the response?

Thanks
Ramya

RESPONSE
----------
HTTP/1.1 200 OK Accept: application/soap+xml, application/dime,
multipart/related, text/* Cache-Control: no-cache Content-Type: text/xml;
charset="UTF-8" Host: 127.0.0.1 Pragma: no-cache User-Agent: enlistSrv
Content-Length: 728
<?xml version="1.0" encoding="UTF-8"?>
   <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.w3.org/2001/XMLSchema"
E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <E:Body>
         <m:ConnectResponse xmlns:m="http://www.PersistentData.com/enList">
            <m:connectionid s:type="y:int">3</m:connectionid>
            <m:result>
               <m:resultCode s:type="y:int">0</m:resultCode>
               <m:errorCode s:type="y:int">0</m:errorCode>
               <m:errorMessage s:type="y:string"></m:errorMessage>
               <m:diagonsticMessage s:type="y:string"></m:diagonsticMessage>
               <m:size s:type="y:int">0</m:size>
            </m:result>
         </m:ConnectResponse>
      </E:Body>
   </E:Envelope>


STACKTRACE
----------
" org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:562)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2600)
        at org.apache.axis.client.Call.invoke(Call.java:2565)
        at org.apache.axis.client.Call.invoke(Call.java:2254)
        at org.apache.axis.client.Call.invoke(Call.java:2177)
        at org.apache.axis.client.Call.invoke(Call.java:1694)
        at
com.PersistentData.www.enList.ServiceBindingStub.connect(ServiceBindingStub.java
:312)
        at Client.main(Client.java:32)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerW
rapper.ja
va:236)
        at
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:2
15)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:314)
        at
org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocum
entScanne
rImpl.java:857)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFr
agmentSca
nnerImpl.java:338)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:828)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:758)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1178)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContext
Impl.java
:272)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:554)
        ... 8 more
"

-----Original Message-----
From: Ramya Manian [mailto:ramya_manian@persistent.co.in]
Sent: Monday, June 21, 2004 5:54 PM
To: axis-user@ws.apache.org
Subject: Very urgent: "Read timed out" error while parsing the response
using JAxis 1-1


Hi

We have written our client using JAxis to send requests and our SOAP server uses
EasySOAP library
for providing the SOAP interface.

But the client throws a "Read timed out" error while parsing the response from
the server.

I tried increasing the timeout value but it did not work.
The error occurs just before parsing the response using Xerces SAX parser. I
also
printed the contents of the response before sending it for parsing and it seemed
to be
complete and OK. I am not able to figure out what is causing the error.

Any pointers on why is this occurring?

Are there any compatibility issues between JAxis1-1 and EasySOAP or Xerces ?
Are there any known issues that must be taken care of?

We need answers to the questions ASAP.

Thanks in advance
Ramya


Re: "Content is not allowed in prolog" exception

Posted by "NJ Rogers, Learning and Research Technology" <Ni...@bristol.ac.uk>.
Hi

It's a prob I've had before & to do with the leading xml declaration
see e.g.

http://java2.5341.com/msg/44393.html

- a case which might have something in common with yours?

Nikki

--On Thursday, July 01, 2004 10:38:08 +0530 Ramya Manian 
<ra...@persistent.co.in> wrote:

> Hi
>
> I get a SAX parser exception as "Content is not allowed in prolog"
> while parsing the response. I have included the response that I
> receive from the server and the stack trace of the exception. Also
> there are no junk characters before or after the response.
>
> Can someone please explain what can cause this exception? Is anything
> wrong in the response?
>
> This is a repost as there were no replies for the earlier one. I need to
> get this working ASAP.
>
> Thanks
> Ramya
>
> RESPONSE
> ----------
> HTTP/1.1 200 OK Accept: application/soap+xml, application/dime,
> multipart/related, text/* Cache-Control: no-cache Content-Type: text/xml;
> charset="UTF-8" Host: 127.0.0.1 Pragma: no-cache User-Agent: enlistSrv
> Content-Length: 728
> <?xml version="1.0" encoding="UTF-8"?>
>    <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:y="http://www.w3.org/2001/XMLSchema"
> E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>       <E:Body>
>          <m:ConnectResponse
> xmlns:m="http://www.PersistentData.com/enList">
> <m:connectionid s:type="y:int">3</m:connectionid>
>             <m:result>
>                <m:resultCode s:type="y:int">0</m:resultCode>
>                <m:errorCode s:type="y:int">0</m:errorCode>
>                <m:errorMessage s:type="y:string"></m:errorMessage>
>                <m:diagonsticMessage
> s:type="y:string"></m:diagonsticMessage>                <m:size
> s:type="y:int">0</m:size>
>             </m:result>
>          </m:ConnectResponse>
>       </E:Body>
>    </E:Envelope>
>
>
> STACKTRACE
> ----------
> " org.xml.sax.SAXParseException: Content is not allowed in prolog.
>         at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:562)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2600)
>         at org.apache.axis.client.Call.invoke(Call.java:2565)
>         at org.apache.axis.client.Call.invoke(Call.java:2254)
>         at org.apache.axis.client.Call.invoke(Call.java:2177)
>         at org.apache.axis.client.Call.invoke(Call.java:1694)
>         at
> com.PersistentData.www.enList.ServiceBindingStub.connect(ServiceBindingSt
> ub.java :312)
>         at Client.main(Client.java:32)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in
> prolog.         at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorH
> andlerW rapper.ja
> va:236)
>         at
> org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper
> .java:2 15)
>         at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java
> :384)         at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java
> :314)         at
> org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
>         at
> org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(X
> MLDocum entScanne
> rImpl.java:857)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDoc
> umentFr agmentSca
> nnerImpl.java:338)
>         at
> org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.jav
> a:828)         at
> org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.jav
> a:758)         at
> org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)         at
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
> 1178)         at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>         at
> org.apache.axis.encoding.DeserializationContextImpl.parse(Deserialization
> Context Impl.java
> :272)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:554)
>         ... 8 more
> "
>



----------------------
NJ Rogers, Technical Researcher
(Semantic Web Applications Developer)
Institute for Learning and Research Technology (ILRT)
Email:nikki.rogers@bristol.ac.uk
Tel: +44(0)117 9287096 (Direct)
Tel: +44(0)117 9287193 (Office)

"Content is not allowed in prolog" exception

Posted by Ramya Manian <ra...@persistent.co.in>.
Hi

I get a SAX parser exception as "Content is not allowed in prolog"
while parsing the response. I have included the response that I
receive from the server and the stack trace of the exception. Also
there are no junk characters before or after the response.

Can someone please explain what can cause this exception? Is anything
wrong in the response?

This is a repost as there were no replies for the earlier one. I need to get
this working ASAP.

Thanks
Ramya

RESPONSE
----------
HTTP/1.1 200 OK Accept: application/soap+xml, application/dime,
multipart/related, text/* Cache-Control: no-cache Content-Type: text/xml;
charset="UTF-8" Host: 127.0.0.1 Pragma: no-cache User-Agent: enlistSrv
Content-Length: 728
<?xml version="1.0" encoding="UTF-8"?>
   <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:A="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.w3.org/2001/XMLSchema"
E:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <E:Body>
         <m:ConnectResponse xmlns:m="http://www.PersistentData.com/enList">
            <m:connectionid s:type="y:int">3</m:connectionid>
            <m:result>
               <m:resultCode s:type="y:int">0</m:resultCode>
               <m:errorCode s:type="y:int">0</m:errorCode>
               <m:errorMessage s:type="y:string"></m:errorMessage>
               <m:diagonsticMessage s:type="y:string"></m:diagonsticMessage>
               <m:size s:type="y:int">0</m:size>
            </m:result>
         </m:ConnectResponse>
      </E:Body>
   </E:Envelope>


STACKTRACE
----------
" org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:562)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2600)
        at org.apache.axis.client.Call.invoke(Call.java:2565)
        at org.apache.axis.client.Call.invoke(Call.java:2254)
        at org.apache.axis.client.Call.invoke(Call.java:2177)
        at org.apache.axis.client.Call.invoke(Call.java:1694)
        at
com.PersistentData.www.enList.ServiceBindingStub.connect(ServiceBindingStub.java
:312)
        at Client.main(Client.java:32)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerW
rapper.ja
va:236)
        at
org.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:2
15)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
        at
org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:314)
        at
org.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocum
entScanne
rImpl.java:857)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFr
agmentSca
nnerImpl.java:338)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:828)
        at
org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:758)
        at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148)
        at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1178)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContext
Impl.java
:272)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:554)
        ... 8 more
"