Forum Discussion

Konda_R's avatar
Konda_R
Occasional Contributor
16 years ago

[SOLVED]How to use property-expansion in filename of the MTOM attachment ?

Hi

I am trying to automate MTOM functionality using soapUI Pro 3.0.1 licensed edition. Please find bellow the default soap request created by soapUI for a WSDL hosted on our test server 'server1'.


   

   
     
         cid:261522304143
         cid:602125580217
     

   


As you can see from the above soap request ,the server expects 2 MTOM attachements [base64Binary type fields] to process and returns an MTOM attachment[base64Binary type] in the response message as well.

Since the content IDs [cid] contain random values for each invocation, How can I make the cid to refer to the specified file location & send file content in MTOM format?

Please note that location of the files to be attached to the contenet id [cid] is not fixed but can be resolved using property expansion along with relative path.

When I search the forum for help , I found the following info:

"you can either create a groovy script that does the actual attaching of the file or you can use property-expansion in the filename of the attachment and set it to not be cached."

But How to specify property-expansion in the filename of the attachment ?
For Example I tried setting input element of the above soap request with value "${server.installDir}/packages/MTOMTests/resources/Administrators_Guide.pdf", but its not working.

Could some one help me in resolving this?

Thanks in advance.
Kondareddy

2 Replies

  • Hi!

    Please try the following:

    1) set the content of the element to something like

    file:${server.installDir}/packages/MTOMTests/resources/Administrators_Guide.pdf
    etc..

    2) Enable inline files and MTOM
    3) Remove the actual attachments from the request

    In this situation soapUI should attach the specified file as an MTOM attachment.

    You might also need to update to the latest nightly build (of 3.5 beta preferrably), since there have been some fixes in this area since 3.0.1, but try it first with the build you have..

    let me know how it works!

    /Ole
    eviware.com
  • Konda_R's avatar
    Konda_R
    Occasional Contributor
    Hi Ole

    Thanks for your reply.
    My problem is resolved now. [I tested on latest soapUI pro3.5]

    Best Regards
    Kondareddy