Forum Discussion

InventoryLocato's avatar
InventoryLocato
Contributor
14 years ago

File attachments

sending a file through a web service.
I am trying to figure out how to do attachments.

I am using this post here:
viewtopic.php?t=982

First of all, this page does not exists when calling help from the attachment tab:
http://www.soapui.org/SOAP-/-WSDL/addin ... ments.html

Anyways, I have a WSDL that allows for file attachment/transport (xsd:base64...).

Problem 1:
I attached a file (cached), it works fine. When it's uncached, does not work.

Problem 2:
I have 5 different files that I need to send over (1 file per web service call). What I did was store the file location in an excel file (ie c:\file1.zip ; c:\file2.zip). Then I used a datasource and a dataloop. All failed because in the request, i would see
<Data>c:\file1.zip</Data>

Then I read the help a little bit more and found out that i need to append "file:" to beginning of it. So I did that in my excel file "file:c:\file1.zip"

This still doesn't work because it would send in the file name instead of data. Can someone please tell me how to do this? Also, I am not fluent in groovyscript so I need help on that if you decide to point me in that direction.

Thanks in advance.
  • Problem #2 has been resolved. I enabled the wrong option. "Inline attachment" should be marked true and MTOM false for my case.
  • Thanks for reporting the broken URL!

    Regarding problem 1, are there any messages in the error log tab of soapUI after this fails?

    Henrik
    SmartBear Software
  • Hi Henrik,

    When I first did it, I did get a response error saying something along the lines of "file character missing at line 2" which was a weird error.

    I've discovered a new error that causes SOAPUI to crash on itself and not recover:

    Since I am doing a datasource loop (excel file contains path of files to upload on each webservice call), when I go back and view each response, it crashes. Why? because the files I am uploading at 5MB to 100MB (depending on calls) large. By accident, i clicked on "request" of say WS call #4 (11MB) file, SOAPUI closes itself and all work is lost. It is because in the data node, it's trying to put all the data in there and it explodes in the viewer.
  • Hi,

    thanks for reporting this issue back to us!

    I've opened issue for tracking this (internal id=SOAPUI-2766).

    Thanks!
    Vladimir
    SmartBear Software