• Post Reply Bookmark Topic Watch Topic
  • New Topic

Send Attachment along with SOAP Response  RSS feed

 
Balaji Gururajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All.

I am stuck with this task.

I have a SOAP Client with wsdl to send a query to a SOAP Server. Along with the SOAP response I am supposed to attach a generated csv file (Not required to open and read - just attach).

SOAP Handler has been implemented at server.

Since it is client code I am not supposed to paste the exact contents online.

I can create new SOAPMessage and use AttachmentPart to attach the file but I am stumped regarding where to set it as response. We have used only javax.xml and apache.cxf.

Kindly help me with this!
 
Balaji Gururajan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All.

I have managed to get the attachment to soap client by using org.apache.cxf.binding.soap.SoapMessage.setAttachments(Collections<Attachment>).

However, I have one small problem. The attachment is a <filename>.csv file but is received in client side as <filename>.dat.

I believe this is something to do with "content-type" or some setting like this. Kindly let me know how I can receive the file as .csv.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Obviously it is the responsibility of the SOAP server to decide where to store and what to name the attached data.

Do you have documentation for the server?

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!