You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ForCripeSake <pm...@gmail.com> on 2013/03/26 16:40:39 UTC

consuming attachments from a service client generated by wsdl2java

I was given a wsdl by a client from which I've generated a service and
related classes. The expected attachment is a PDF.

This is the structure of the response from their service:

------=_Part_127_1.2
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <ro...@ws.jboss.org>
<env:Envelope>
....
<ns2:FetchDocumentPayload>
<ns2:attachment>cid:0-1234@ws.jboss.org</ns2:attachment>     
</ns2:FetchDocumentPayload>
....
</env:Envelope>

------=_Part_127_1.2
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <0-...@ws.jboss.org>
...pdf byte content....
------=_Part_127_1.2--
The client side generated service usage looks something like this:

FetchDocumentResponse response = getDocService().fetchDocument(request);
Object attachment = response.getFetchDocumentPayloadType().getAttachment();
There are no MTOM annotations on the generated FetchDocumentResponse class.
How do I read byte[] data from the response?

Additionally, I get a “Content is not allowed in prolog” error when trying
to consume the service.



--
View this message in context: http://cxf.547215.n5.nabble.com/consuming-attachments-from-a-service-client-generated-by-wsdl2java-tp5725306.html
Sent from the cxf-user mailing list archive at Nabble.com.