Forum Discussion

selma's avatar
selma
New Contributor
8 years ago

SOAUPui attchement send from java

I'm trying to send attachments from my java app to soapui.

 

I used Apache cxf for my ws soap, i enabled the MTOM.

 

I used javax.xml.ws  as follows:

javax.xml.ws 

@Resource
private WebServiceContext webServiceContext;

 

DataHandler dataHandler = new DataHandler(
new AttachDataSource(fileContentType, zipName, new ByteArrayInputStream(out.toByteArray())));
attachs.put(allZip.getEmbeddedFileRef(), dataHandler);

webServiceContext.getMessageContext().put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, attachs);

 

The content Mime  of my file allZip is not empty also the ByteArrayOutputStream out .

 

 

I alwayse get empty attchemts in soaupUI but in the response i have:

 

<embedded-file-ref>cid:3a888107-6bf8-413b-a876-cad5dbabe29c</embedded-file-ref>

 

 

I enabled also in soaupui the MTOM to true.

is there any other configuration i must do ?

No RepliesBe the first to reply