Skip to main content
Participant
April 13, 2011
Question

Sending SOAP attachment

  • April 13, 2011
  • 1 reply
  • 820 views

Has anyone successfully done this? I haven't been able to find a solution in ColdFusion. I've also read that since ColdFusion still runs on Apache Axis1 and SOAP attachments with MOTM (which is needed for the API we're communicating with) need Axis2 it won't work.

Is there a way to do this with Java?

Any help would be appreciated!

This topic has been closed for replies.

1 reply

Inspiring
April 13, 2011

I do a lot with SOAP webservice interfacing on CF - can you give a little more detail on what exactly you are having problems with?  What is the webservice you are trying to access?

-reed

Chris_HofAuthor
Participant
April 13, 2011

Well, after a lot of searching I've read that to split up the SOAP envelope and the actual file contents, one should use an httpparam of formfield and one of type file.

The steps I've taken so far to not get an error from the API:

  • set multipartType='related' on the HTTP request
  • Used HttpConnection.addParam( type='formfield', name='xmldata', value=XmlParse( RequestContent ) ) to set the actual SOAP envelope and contents
  • Set HttpConnection.addParam( type='file', name='CsvEmails', file=FileLocation, mimetype='text/csv' ) for the file itself

This goes through without an error by the API, but after looking at their logs, the "uploaded" file is only 9 Bytes large without the actual content.

Inspiring
April 13, 2011

I'm a little suspicious of the file=filelocation part of the code - try changing that to

file='#filelocation#' to see if that makes a difference.

Have you tried using an HTTP tracing tool like Fiddler or Firebug to see what is actually being sent out?