3 Replies Latest reply on Apr 13, 2011 8:16 AM by Reed Powell

    Sending SOAP attachment


      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!

        • 1. Re: Sending SOAP attachment
          Reed Powell Level 3

          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?


          • 2. Re: Sending SOAP attachment
            Chris_Hof Level 1

            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.

            • 3. Re: Sending SOAP attachment
              Reed Powell Level 3

              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?