You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Hoffer <dh...@gmail.com> on 2016/03/17 23:14:00 UTC

CXF client for service with SWA file attachment

I have an existing (AXIS) service that transfers a binary file using SWA,
the schema looks like this:

<xs:sequence>
    <xs:element name="ingestFile" type="wsi:swaRef" minOccurs="1"
maxOccurs="unbounded"/>
</xs:sequence>

I'm trying to create a new CXF client instead of the old AXIS one that can
communicate with the server just like the old client (I can't change the
server in any way).

When I run wsdl2java on this it maps this to a DataHandler which is allows
me to send the binary data but this doesn't match what the server is
expecting.  The old client created a MessageContent and then added an
attachment of a contentID string the the DataHandler with the binary data.
It then created an OMElement with ingestFile name and then added a child
text node to that with a custom CID text.  The server parses that CID text
string to get the DataHandler from the MessageContext's list of attachments.

I'm not clear how to do this with a CXF client.  Hopefully someone can
point me in the right direction.

-Dave