Saturday 15 May 2010

file - JMeter SOAP request with attachement -


I'm using JMT to test a web service (SOAP), the method I'm testing I take the argument of that type file. In the SOAP UI, this can be done by uploading an attachment and providing an ID.

Something like this will be placed in the soap request:

  & lt; Soapenv: envelope xmlns: soapnavi = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: ws = "http://zk.payment.dkv.be/ws" & gt; & Lt; Soapenv: header / & gt; & Lt; Soapenv: body & gt; & Lt; Ws: wsMethod & gt; & Lt; File & gt; Cid: attachementID & lt; / File & gt; & Lt; / Ws: wsMethod & gt; & Lt; / Soapenv: Body & gt; & Lt; / Soapenv: envelope & gt;   

I am using JMT 2.9 and it seems that this is not possible, is there a workaround?

Cheers!

Then there is no solution to perform the above tasks at the time of writing JM + not properly sending an attachment directly , But there is an alternative solution!

Because in the end it is in the middle of the tag:

    

It's all in the middle of the above tags, which is the key to your service. Then the solution:

  & lt; File & gt; & Lt ;! [CDATA [$ {yourContentJmeterVariableName}]] & gt; & Lt; / File & gt;   

"yourContentJmeterVariableName" is basically a jimmeter variable, which tells a bansal preprocessor (ignore all imports) such as:

  try { String path = "pathToYourContentFileOrAttachement"; String content = new scanner (new file (path)). Usage delimiter ("\\ Z"). Next (); Byte [] Encoded = base64.xcodebase64 (content.getBytes ()); Vars.put ("yourContentJmeterVariableName", new string (encoded); } Hold (FileNotFoundException e) {log. Terror (e); }   

On top of this post I have ignored the import, but there will be fewer clear ones:

  import java.util.Scanner; Import org.apache.commons.codec.binary.Base64;   

That's what they should already be included in jmeter script!

1 comment:

  1. Giuseppe: File - Jmeter Soap Request With Attachement - >>>>> Download Now

    >>>>> Download Full

    Giuseppe: File - Jmeter Soap Request With Attachement - >>>>> Download LINK

    >>>>> Download Now

    Giuseppe: File - Jmeter Soap Request With Attachement - >>>>> Download Full

    >>>>> Download LINK 3l

    ReplyDelete