Tuesday, July 23, 2013

Trouble scripting against a secure webservice that uploads files via MTOM

I am currently testing a secure webservice that uploads files to an IBM FileNet server via MTOM. The service uses two way authentication through a certificate which has been installed on the root of the machine I am scripting on.
The service is functioning when tested using SoapUI.

I have imported the WSDL using VUGEN for the service that i am testing.

I then added a call to the operation for uploading a file. I have also added the custom header with the username and password for the service.

When I run the service I am getting errors and the files are not uploaded to FileNet. Please note that I have successfully scripted against some of the other operations for same WebService, i.e. retrieve document details and this works ok so I dont think its an authentication issue that I am encountering.

From the documentation i have found so far I believe that VUGen supports MTOM. Can you advise the correct method of adding a webservice call to add an attachement via MTOM.

I will update my script as an attachement as well as the errors encountered. Not i have tried but Soap_Request and Web_service call.
When LoadRunner (LR) executes a Web Services/MTOM script it uses a Microsoft WCF router within the Load Generator machine for communicating with the Web server. This can be confirmed in the Vugen replay log. For example:


action.c(5): Web service call "Open_document_102" started
action.c(5): Creating handler
action.c(5): Searching for wcf router
action.c(5): Preparing router


The LR Controller picks up the Web Resource metrics such as "Hits per Second" and "Throughput" from the LR HTTP replay engine running on the Load Generator. However, the LR HTTP engine is bypassed in this case and these metrics are not available from an Microsoft WCF router. This explains why there is no data in the "Hits per Second" or "Throughput" graphs in the Analysis session containing a Web Services/MTOM script.

The web_add_header function can be used to specify a custom header in "simple" Web Services scripts where no scenario is specified (in the "Protocol and Security" tab in "Manage Services").

However if a scenario type is specified in the Web Services script, for example, "MTOM" is selected, the web_add_header function cannot be used to specify a custom header. This usage is not currently supported by LoadRunner.

An enhancement request has been submitted to add this capability to LoadRunner for the Web Services protocol.
Please install vugen 11 patch 3 that I have uploaded to the case FTP
ftp://SC0441f1:my=XV5nx@ftp.usa.hp.com/

the file name is: LRVUG_00015.exe

2 comments:

Sree said...

hi Ravi, I saw the article about "Trouble scripting against a secure webservice that uploads files via MTOM" which is my current issue. I'm having trouble understanding how to script/incorporate the code in soap request using load runner such that 40MB file can be uploaded without any error. I did installed the patch mentioned in the article still facing issue. Please advise. and as stated can upload the load runner sample script of soap request using MTOM such that I can refer the same.

Unknown said...

Hi Ravi,

I am getting below error while running Web Services script in LR 11.52. But the same script working fine in my colleague machine

Starting iteration 1.
Starting action Action.
Action.c(3): Web service set security started.
Action.c(3): Web set security was successful.
Action.c(4): SOAP request "SOAP Request" started
Action.c(4): Error:Security handler failed - Cryptography_CSP_NoPrivateKey
Action.c(4): Error:Failed to process the request.
Action.c(4): Error:SOAP request "SOAP Request" execution failed
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.