Well, this response is not an MTOM response.   If it was MTOM, it should have a 
<xop:Include href="….."/> element in there instead of the "cid:…" string as a 
direct child.   Also, the Content-Type should be   multipart/related; 
type="application/xop+xml";…..        Thus, I'm not surprised CXF is having a 
problem with it.     This looks closer to SOAP w/Attachments, but even then, 
the CID would be stuck on an href attribute of the ns2:attachment element.    
What does the schema for the FetchDocumentResponsePayloadType type look like in 
the WSDL?

You may be better off generating the client without the mime stuff enabled, 
maybe modifying the schema so that <ns:attachment> is an xsd:string instead.   
Then, in your own code, grab the CID via that string and then grab the 
Attachments out of the response context of the client and searching for the 
appropriate attachment yourself.

Dan



On Mar 27, 2013, at 1:05 PM, ForCripeSake <[email protected]> wrote:

> I receive this response from a web service, which results in a 
> org.xml.sax.SAXParseException: Content is not allowed in prolog.exception. I
> have enabled mtom on the client before I receive the request and have an
> attachmentInInterceptor. Can anyone lead me in the right direction for
> correctly receiving the response?
> 
> *Server Response*
> 
> HTTP/1.1 200 OK
> Content-Type: multipart/related; type="text/xml";
> start="<[email protected]>";   
> boundary="----=_Part_45_1157014458.1364398357608"
> Connection: close
> Transfer-Encoding: chunked
> 
> 
> ------=_Part_45_1157014458.1364398357608
> Content-Type: text/xml; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Content-ID: <[email protected]>
> 
> <env:Envelope
> xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns2:FetchDocumentResponse
> xmlns="http://client.com/BaseTypes";
> xmlns:ns2="http://client.com/ClientTypes";
> xmlns:ns3="http://client.com/ClientCommonTypes";><ns2:HeaderArea><Status>Success</Status><SystemMessage><Code>000</Code><Description>Success</Description></SystemMessage></ns2:HeaderArea><ns2:DocumentResponsePayloadType><ns2:FileFormat>PDF</ns2:FileFormat><ns2:attachment>cid:[email protected]</ns2:attachment></ns2:FetchDocumentResponsePayloadType></ns2:DocumentResponse></env:Body></env:Envelope>
> ------=_Part_45_1157014458.1364398357608
> Content-Type: application/octet-stream
> Content-Transfer-Encoding: binary
> Content-Id: <[email protected]>
> 
> %PDF-1.4
> ....more pdf data
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/org-xml-sax-SAXParseException-Content-is-not-allowed-in-prolog-tp5725407.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to