cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Content is not allowed in prolog
Date Tue, 16 Sep 2008 19:18:08 GMT

I think you need to move the AttachmentInInterceptor into the beginning of the 
chain.   Certainly before the XMLStream stuff as it would need to pull the 
XML part out of the message.

Dan


On Tuesday 16 September 2008 3:12:50 pm Shah, Jinesh (IT) wrote:
> Please note that the interceptor chain is:
>
>  receive [LoggingInInterceptor, CustomXMLStreamInInterceptor,
> CustomStaxInInterceptor, AttachmentInInterceptor]
>   read [ReadHeadersInterceptor, SoapActionInInterceptor]
>   pre-protocol [SAAJInInterceptor, MustUnderstandInterceptor,
> SOAPHandlerInterceptor, LogicalHandlerInInterceptor]
>   post-protocol [CheckFaultInterceptor]
>   unmarshal [URIMappingInterceptor, RPCInInterceptor,
> SoapHeaderInterceptor]
>   post-logical [WrapperClassInInterceptor]
>   pre-invoke [CustomSwAInInterceptor, HolderInInterceptor]
>
> The exception stack trace:
>
> SCANNER_STATE_PROLOGjavax.xml.ws.soap.SOAPFaultException: Error reading
> XMLStreamReader.
> 	at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> 	at
> .......<internal>........CustomJaxWsClientProxy.invoke(CustomJaxWsClient
> Proxy.java:39)
> 	at $Proxy48.retrieveCurrentBidResults(Unknown Source)
> 	at ...<internal>.........TestClient(TestClient.java:135)
> 	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
> org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
> 	at
> org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:
> 98)
> 	at
> org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
> 	at
> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(Met
> hodRoadie.java:87)
> 	at
> org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
> 	at
> org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4Clas
> sRunner.java:88)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunne
> r.java:51)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.jav
> a:44)
> 	at
> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:2
> 7)
> 	at
> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> 	at
> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:
> 42)
> 	at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4Tes
> tReference.java:38)
> 	at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
> va:38)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
> stRunner.java:460)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
> stRunner.java:673)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
> ner.java:386)
> 	at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
> nner.java:196)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading
> XMLStreamReader.
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:183)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:54)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> hain.java:221)
> 	at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> 	at
> org.apache.cxf.transport.http.MSHTTPConduit$WrappedOutputStream.handleRe
> sponse(MSHTTPConduit.java:1746)
> 	at
> org.apache.cxf.transport.http.MSHTTPConduit$WrappedOutputStream.close(MS
> HTTPConduit.java:1611)
> 	at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutpu
> tStream.java:47)
> 	at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:159)
> 	at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> 	at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> 	at
> org.apache.cxf.transport.http.MSHTTPConduit.close(MSHTTPConduit.java:530
> )
> 	at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI
> nterceptor.handleMessage(MessageSenderInterceptor.java:62)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> hain.java:221)
> 	at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> 	at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> 	at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> 	at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> 	... 26 more
> Caused by: javax.xml.stream.XMLStreamException: ParseError at
> [row,col]:[2,1]
> Message: Content is not allowed in prolog.
> 	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
> 	at
> msjava.msxml.stream.TextMSXMLStreamReader.next(TextMSXMLStreamReader.jav
> a:114)
> 	at
> org.apache.cxf.staxutils.DepthXMLStreamReader.next(DepthXMLStreamReader.
> java:215)
> 	at
> com.ms.commodities.powersched.cxf.staxutils.MSDepthXMLStreamReader.next(
> MSDepthXMLStreamReader.java:42)
> 	at
> org.apache.cxf.staxutils.DepthXMLStreamReader.nextTag(DepthXMLStreamRead
> er.java:227)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:83)
> 	... 42 more
>
> -----Original Message-----
> From: Shah, Jinesh (IT)
> Sent: Tuesday, September 16, 2008 3:06 PM
> To: users@cxf.apache.org
> Subject: Content is not allowed in prolog
>
> Hi all,
>
> We are getting this "Content is not allowed in prolog" exception when we
> are receiving a multi-part soap response.
>
> Info org/apache/cxf/interceptor/LoggingInInterceptor Inbound Message
>    Encoding: UTF-8
> Headers: {content-type=[multipart/related; type="text/xml";
> start="<0957029393920C3CED58D1773A3E9191>";
> boundary="----=_Part_1980_21365090.1221589409760"], Date=[Tue, 16 Sep
> 2008 18:23:28 GMT], Content-Length=[3557], Server=[Jetty/4.2.4rc0 (SunOS
> 5.10 sparc)]}
> Messages:
> Message:
>
> Payload: ^M
> ------=_Part_1980_21365090.1221589409760^M
> Content-Type: text/xml; charset=UTF-8^M
> Content-Transfer-Encoding: binary^M
> Content-Id: <0957029393920C3CED58D1773A3E9191>^M
> ^M
> <?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:Header><c
> aiso:attachmentHash
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> soapenv:mustUnderstand="0"
> xmlns:caiso="http://www.caiso.com/mrtu/soa/schemas/2005/09/attachmenthas
> h"><hashValue>XPjIh1JyCD3aoTYaRNtyr2GGMgk=</hashValue></caiso:attachment
> Hash><caiso:standardAttachmentInfor
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> soapenv:mustUnderstand="0"
> xmlns:caiso="http://www.caiso.com/soa/2005-06-21/StandardAttachmentInfor
> .xsd"><Attachment><id>1</id><compressFlag>yes</compressFlag><compressMet
> hod>gzip</compressMethod></Attachment></caiso:standardAttachmentInfor></
> soapenv:Header><soapenv:Body><ns1:retrieveCurrentBidResultsResponse
> xmlns="http://www.caiso.com/soa/2007-08-15/retrieveCurrentBidResults"
> xmlns:ns1="http://www.caiso.com/soa/2007-08-15/retrieveCurrentBidResults
> "><BidResult_attachment href="cid:8A74A4D4CA58E7D52D2EAD9679AFA9A6"
> xmlns=""/></ns1:retrieveCurrentBidResultsResponse></soapenv:Body></soape
> nv:Envelope>^M
> ------=_Part_1980_21365090.1221589409760^M
> Content-Type: application/octet-stream^M
> Content-Transfer-Encoding: binary^M
> Content-Id: <8A74A4D4CA58E7D52D2EAD9679AFA9A6>^M
> ^M
> H4sIAAAAAAAAAO1cbXOiOhT+Kxm/KwmCb5OyY4vsOnNtvdVt537qUImWWQQvYK3/fgPrC9ZI
> ZEVb
> dvOlNXDOyeN5knNIchB/eZs64JX4ge25VyVUgSVA3JFn2e7kqvR9aJQbJfBFw9e2dU+CuRMC
> Ku8G
> V6WXMJy1JGmxWFRGph14lZE3lQLPlGQI62XYKCNV2ihV3gKrpOEeCQJzQr4R0yK+hof2lOhm
> SDSq
> 0ijDZhnVhgi15GpLbmJpcxcPvLk/ItrAJlPiBlhatbH0zt6q2TeXjmdaGu66IfGHNqEwNOya
> U6Jd
> d/WyXFMVWEMQS/ElPPXpbbVm1G90GXbUhgF1td2BigIhUhRDQchoK1iKxbBjBmGPOmdsEysJ
> GzZb
> sNGS5QqEsAxhC1LzO7I4CE0/jL7TVq0+hPVWLJxU2wpSHW+2q9I4oLKSw1PT/0HC4XJGNL3d
> o6i3
> bTzy3JCyStldtl9N2zEcc6Ld3mGJeQM/29YgNMN5oFE72wa+JxM7oI4l1tq/Kx/2Bjdfnx47
> g+Fj
> 9/arCuFT98l46vYGEMpr90ks5cHohVhzhyK48TyfDjwz9PyEzY3yAcG+71nzURiz3Iu/7+rK
> 2h2r
> ZuyFzu3aKcmrdCjtKlJjq97ozZC6Nob7ajqDiJ0khai6z8e+wo6N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RV
> N3N0/onPCuxVx0lPmafVhIs1c/qambkcPWnNfHt3fXDJ3IBiyXzeJTP1vlgx5/P49xtpMH65
> SASz
> PyeYGXff72/u7m87VUU9HNWQiGrnjWpJGkR4y2dD8Dce1ZAIb39WeEu8PX04uskiup03ujHf
> YRfB
> 7cKnHfVPddqRdd9UzXH76PLvheeJ/vI7GLyRI7JisbJi/yGKyIcTYlUkxPMmxF8EiFz4YblQ
> zi0g
> f0gyRDDHXH75XaS8wH9IKs/P9x+Sy7kjXyTzT5rM17/Otvk5tu3PwWk/AVjjZ2h2TgAA^M
>
>
> Could you please suggest what might be going wrong ?
>
> Any help is much appreciated.
>
> Thank you.
>
> Best,
> Jinesh Shah
> Morgan Stanley | Commodities Trading Technology 2000 Westchester Ave,
> 1st Floor | Purchase, NY  10577
> Phone: +1 914 225-4484
> Jinesh.A.Shah@MorganStanley.com
> <blocked::mailto:Jinesh.A.Shah@MorganStanley.com>
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this email
> is prohibited when received in error.
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does
> not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.



-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message