Forum Discussion

jskemper's avatar
jskemper
New Contributor
12 years ago

File upload using HTTP requests to servlet

Fellow SoapUI'ers,
I am attempting to upload a file (.doc or .pdf) to an upload servlet using an HTTP request but it doesn't appear that the file content is being added to the request. This is most likely a limitation of my knowledge around using SoapUI to upload files. I have gone all through the existing documentation and haven't found anything that is able to get me past this road block. I am attaching the file to the request and setting the Media Type to "multipart/form-data" but I am still confused as to how to tell SoapUI what file I want to upload and get the tool to . I have noticed that when I attach the file the Part is blank with no values and the Type is "UNKNOWN" and based on the documentation I have seen that seems strange. I am able to successfully upload a file using another tool but I need to be able to do it with SoapUI and I believe it can be done, I'm just not doing it correctly. Could some help understand how this is done in SoapUI.

Thanks,
Jeff

4 Replies

  • jskemper's avatar
    jskemper
    New Contributor
    Michael,
    Thank you for replying to my question. When I say "an upload servlet" I do mean exactly that. The process that I am trying to test uses a servlet to upload a file while using soap request for the rest of the communication. Given that SoapUI don't support servlet communication what about using Groovy to accomplish this?

    jk
  • Hi,

    Given that SoapUI don't support servlet communication what about using Groovy to accomplish this?


    Yes, a Groovy test step can be used to accomplish this.
  • jskemper's avatar
    jskemper
    New Contributor
    Thanks for the help and suggestions. I will take a look at using groovy to upload a file.