cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Cool <>
Subject Exception in ReadHeadersInterceptor
Date Fri, 12 Jun 2015 14:21:09 GMT
[reposting to dev; I had previously posted to<>]

I am making a Web Service call using CXF 2.7.8 where the response consists of a 302 response-code
with header information but no SOAP payload. When the ReadHeadersInterceptor attempts to parse
the response, the following exception is thrown:

Caused by: ParseError at [row,col]:[1,1]

Message: Premature end of file.



               at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(

               at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(

I turned on debugging to see the incoming response, and the LoggingInInterceptor outputs the

Inbound Message


ID: 2

Response-Code: 302

Encoding: ISO-8859-1


Headers: {connection=[Close], Content-Length=[0], Location=[/acme.policy], Server=[AcmeServer],
Set-Cookie=[MRHSHint=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/, MRHSession=XXXXX;path=/;secure,


I took a look at the ReadHeadersInterceptor source, and it appears to me that it expects a
SOAP message. I may be interpreting the code incorrectly, but unfortunately, I cannot connect
a debugger to the server making the WS call, so I can't interact with it.

I am not sure if this is an issue in ReadHeadersInterceptor or if I am not correctly configuring
the HTTPConduit to handle redirects. I am calling

HTTPClientPolicy.setAutoRedirect(true) in my code.

>From the debugging message I see, I think the PolicyInInterceptor is called and the message
is handled and then eventually passed to the


Invoking handleMessage on interceptor<>

Adding interceptor<>
to phase pre-invoke Chain org.apache.cxf.phase.PhaseInterceptorChain@1aee3c4<mailto:org.apache.cxf.phase.PhaseInterceptorChain@1aee3c4>
was modified.

Current flow:

  receive [PolicyInInterceptor, LoggingInInterceptor, AttachmentInInterceptor]

  post-stream [StaxInInterceptor]

  read [WSDLGetInterceptor, ReadHeadersInterceptor, SoapActionInInterceptor, StartBodyInterceptor]

  pre-protocol [MustUnderstandInterceptor]

post-protocol [CheckFaultInterceptor, JAXBAttachmentSchemaValidationHack]

  unmarshal [DocLiteralInInterceptor, SoapHeaderInterceptor]

  post-logical [WrapperClassInInterceptor]

  pre-invoke [SwAInInterceptor, HolderInInterceptor, PolicyVerificationInInterceptor] Invoking
handleMessage on interceptor org.apache.cxf.interceptor.LoggingInInterceptor@527a4a<mailto:org.apache.cxf.interceptor.LoggingInInterceptor@527a4a>

Invoking handleMessage on interceptor


Invoking handleMessage on interceptor


Invoking handleMessage on interceptor


Invoking handleMessage on interceptor


Invoking handleFault on interceptor


Any thoughts on if this is a problem in how I make the WS call or if this could be a problem
in the ReadHeadersInterceptor?



This e-mail message and all attachments transmitted with it may contain privileged and/or
confidential information intended solely for the use of the addressee(s). If the reader of
this message is not the intended recipient, you are hereby notified that any reading, dissemination,
distribution, copying, forwarding or other use of this message or its attachments is strictly
prohibited. If you have received this message in error, please notify the sender immediately
and delete this message, all attachments and all copies and backups thereof.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message