Highlighted
Super Contributor.
Super Contributor.
13400 views

Load Runer test web servcies using soap version 1.2

Jump to solution

Hi Everyone

I've been having a bit of a battle with loadrunner in trying to get a successful response to a web service request where the web services are using SOAP 1.2.

 

I have been able to get valid responses back from web services using SOAP 1.1 without any difficulty.  

 

I have also tested the web service requests in SOAP UI for both versions of SOAP (1.1 and 1.2), and they respond correctly. 

 

I have seen LoadRunner 11 documentation which states 'For .NET toolkit, SOAP 1.2 is not supported for asynchronous calls'.  So, I downloaded the trial edition of LoadRunner 12 a couple of days ago, hoping that this would resolve things, but to no avail.  Does anyone know if LR12 supports SOAP 1.2? 

 

I have managed in LR12 to record the request via SOAP UI into vugen.  However when I replay the script, I get a System:InvalidOperationException: Response is not well-formed XML (web_service_call).

 

A soap_request attempt does not fare any better, and I receive a 'The "MyRequest" SOAP request response content is not XML' message.

 

I've also tried using web_custom_request, but have not succeeded.  Most of the examples on the net use a .asmx location for the URL.

 

Has anyone out there sucessfully scripted SOAP 1.2 web service calls in Load Runner?  Any assistance would be much appreciated.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi,

 

The response is using MTOM format, not SOAP format.

A MTOM format is sent with MIME message.

A MIME message contains:

+ MIME boundary

+ MIME header

+ SOAP message

 

Vugen is sending a SOAP request message, it expects a SOAP response come back. But server is sending a MTOM message comes back.

So, that is reason why it shows error “Response is not well-formed XML”.

Please try to correct the response message on the server.

 

In can you cannot change on the server, I have a workaround on this issue; please try to put this line:

       "UserHandlerName=LrWsAttachmentsHandler",

   in front of “BEGIN_ARGUMENTS,” of web_service_call

It looks like this:

web_service_call( "StepName=GetMovement_101",

        "SOAPMethod=MovementService|MovementServicePort|GetMovement",

        "ResponseParam=response",

        "Service=MovementService",

        "ExpectedResponse=SoapResult",

        "Snapshot=t1416568484.inf",

      "UserHandlerName=LrWsAttachmentsHandler",

        BEGIN_ARGUMENTS,

        "xml:GetMovementRequest="

            "<GetMovementRequest>"

                "<MovementId>06AACD3B-2B4D4-E36A-23EC-CC33838EE63</MovementId>"

                "<Verbosity>ALL</Verbosity>"

            "</GetMovementRequest>",

        END_ARGUMENTS,

        BEGIN_RESULT,

        END_RESULT,

        LAST);

 

This user handler will make the web service call to be able to accept a MTOM message.

Please try with it.

 

Thanks,

Phuong Nguyen

From HP LR Team

View solution in original post

8 Replies
Highlighted
Absent Member.
Absent Member.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi,

 

Yes, LR 12 supports SOAP 1.2, except using security with command web_service_set_security. Using security with web_service_set_security for SOAP 1.2 is only supported from LR 12.02, which will be comming soon.

 

Can you send me your script to investigate?

 

Thanks,

Phuong Nguyen

From HP LR Team

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi Phuong

 

Thanks for your reply.  So everything is telling me that SOAP 1.2 is supported.  Am I missing something really simple?  This request generates the correct response when applied in SOAP UI.

 

Many Thanks

Claire

 

My SOAP 1.2 requests....first the web_service_call

 

Action()
{

web_service_call( "StepName=GetMovement_101",
        "SOAPMethod=MovementService|MovementServicePort|GetMovement",
        "ResponseParam=response",
        "Service=MovementService",
        "ExpectedResponse=SoapResult",
        "Snapshot=t1416568484.inf",
        BEGIN_ARGUMENTS,
        "xml:GetMovementRequest="
            "<GetMovementRequest>"
                "<MovementId>06AACD3B-2B4D4-E36A-23EC-CC33838EE63</MovementId>"
                "<Verbosity>ALL</Verbosity>"
            "</GetMovementRequest>",
        END_ARGUMENTS,
        BEGIN_RESULT,
        END_RESULT,
        LAST);


    return 0;
}

 

Replay Log:

Virtual User Script started at : 21/11/2014 11:15:19
Starting action vuser_init.
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(4): Web service call "GetMovement_101" started
Action.c(4): Error:InvokeMethod failure: Response is not well-formed XML..
Action.c(4): Error:ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(4): Error:Web service call "GetMovement_101" execution failed
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

 

Now the soap_request....(please note, I've depersonalized my URL, and one of my soap envelopes)

 

Action()
{

soap_request("StepName=SOAP Request",                                        
        "URL=http://myUrl/myDir1/myDir2/MovementServicePort",                                        
        "SOAPEnvelope="
        "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:v1=\"http://myCompany/myDir3/myDir4/MovementService/V1\">"
            "<soap:Header></soap:Header>"
            "<soap:Body>"
                "<v1:GetMovementRequest>"
                    "<v1:MovementId>06AACD3B-2B4D4-E36A-23EC-CC33838EE63</v1:MovementId>"
                    "<v1:Verbosity>ALL</v1:Verbosity>"
                "</v1:GetMovementRequest>"
            "</soap:Body>"
        "</soap:Envelope>",                                        
        "SOAPAction=",                                        
        "ResponseParam=response",                                        
        "Snapshot=t1416569411.inf",                                        
        LAST);


    return 0;
}

 

Replay Log..

 

Virtual User Script started at : 21/11/2014 11:30:34
Starting action vuser_init.
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(4): SOAP request "SOAP Request" started
Action.c(4): The "SOAP Request" SOAP request response content is not XML
Action.c(4): SOAP request "SOAP Request" was successful
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi,

 

Thanks for your infomration updated.

 

Please help to turn on extended log in Vugen, this will help us to see what the request/response is sending/receiving. This will help me to investigate issue and provide correct solution.

 

Please follow steps below to turn on extended log:

- Choose Run-Time Settings from lef panel of the script

- From Run-Time Settingsdialog, go to General ->Log-> Choose Extended Log and check on 3 check boxes

-  Replay script again

 

Please copy the request/response from Vugen and send it to me.

 

Thanks,

Phuong Nguyen

From HP LR Team

 

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi Phuong

 

The full trace from my web_service_call is listed below.  I have depersonalized the log to modify the IP addresses referenced.  Any guidance you could provide would be appreciated.

 

Many Thanks

Claire

 

Virtual User Script started at : 24/11/2014 16:03:54
Starting action vuser_init.
Web Services replay version 12.0.0 for Windows 7; Toolkit: ".Net"; build 2079
Run-Time Settings file: "C:\Users\cmcgonagle\Documents\VuGen\Scripts\WebServices7\\default.cfg"
Vuser directory: "C:\Users\cmcgonagle\Documents\VuGen\Scripts\WebServices7"
Vuser output directory: "C:\Users\cmcgonagle\Documents\VuGen\Scripts\WebServices7\"
LOCAL start date/time:  2014-11-24 16:03:54
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Maximum number of concurrent connections per server: 2   [MsgId: MMSG-26989]
Starting action Action.
Action.c(3): Web service call "GetMovement_101" started
Action.c(3): "SOAPAction: "urn:GetMovement"" header registered for adding to requests from the immediately following Action function   [MsgId: MMSG-26506]
Action.c(3): "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2032)" header registered for adding to requests from the immediately following Action function   [MsgId: MMSG-26506]
Action.c(3): "Content-Type: application/soap+xml; charset=utf-8" header registered for adding to requests from the immediately following Action function   [MsgId: MMSG-26506]
Action.c(3): t=549ms: Connecting [0] to host 99.98.197.118:8080   [MsgId: MMSG-26000]
Action.c(3): t=585ms: Connected socket [0] from 87.86.298.11:3428 to 99.98.197.118:8080 in 36 ms   [MsgId: MMSG-26000]
Action.c(3): t=586ms: 375-byte request headers for "http://99.98.197.118:8080/myDir1/myDir2/MovementServicePort" (RelFrameId=1, Internal ID=1)
Action.c(3):     POST /myDir1/myDir2/MovementServicePort HTTP/1.1\r\n
Action.c(3):     Content-Type: application/soap+xml; charset=utf-8\r\n
Action.c(3):     Cache-Control: no-cache\r\n
Action.c(3):     SOAPAction: "urn:GetMovement"\r\n
Action.c(3):     User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.20
Action.c(3):     32)\r\n
Action.c(3):     Accept-Encoding: gzip, deflate\r\n
Action.c(3):     Accept: */*\r\n
Action.c(3):     Connection: Keep-Alive\r\n
Action.c(3):     Host: 99.98.197.118:8080\r\n
Action.c(3):     Content-Length: 833\r\n
Action.c(3):     \r\n
Action.c(3): t=590ms: 833-byte request body for "http://99.98.197.118:8080/myDir1/services/MovementServicePort" (RelFrameId=1, Internal ID=1)
Action.c(3):     <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05
Action.c(3):     /soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://ww
Action.c(3):     w.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"><soa
Action.c(3):     p:Header><wsa:Action>urn:GetMovement</wsa:Action><wsa:MessageID>uuid:f0ac61d6-f97c-4e90-98
Action.c(3):     23-6818fccea31c</wsa:MessageID><wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/200
Action.c(3):     4/03/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:To>http://99.98.197.118:808
Action.c(3):     0/EntryExit/services/MovementServicePort</wsa:To></soap:Header><soap:Body><GetMovementRequ
Action.c(3):     est xmlns="http://myCompany/myDir3/myDir4/MovementService/V1"><MovementId>06AACD3B-2B
Action.c(3):     4D4-E36A-23EC-CC33838EE63</MovementId><Verbosity>ALL</Verbosity></GetMovementRequest></soa
Action.c(3):     p:Body></soap:Envelope>
Action.c(3): t=638ms: 293-byte response headers for "http://99.98.197.118:8080/myDir1/services/MovementServicePort" (RelFrameId=1, Internal ID=1)
Action.c(3):     HTTP/1.1 200 OK\r\n
Action.c(3):     Server: Apache-Coyote/1.1\r\n
Action.c(3):     Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:10f25f9b-d179-
Action.c(3):     425c-a7c6-c31040046f4b"; start="<root.message@cxf.apache.org>"; start-info="application/so
Action.c(3):     ap+xml"\r\n
Action.c(3):     Content-Length: 512\r\n
Action.c(3):     Date: Mon, 24 Nov 2014 16:00:14 GMT\r\n
Action.c(3):     \r\n
Action.c(3): t=749ms: 512-byte response body for "http://99.98.197.118:8080/myDir1/services/MovementServicePort" (RelFrameId=1, Internal ID=1)
Action.c(3):     \r\n
Action.c(3):     --uuid:10f25f9b-d179-425c-a7c6-c31040046f4b\r\n
Action.c(3):     Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml";\r\n
Action.c(3):     Content-Transfer-Encoding: binary\r\n
Action.c(3):     Content-ID: <root.message@cxf.apache.org>\r\n
Action.c(3):     \r\n
Action.c(3):     <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><ns2:GetMov
Action.c(3):     ementResponse xmlns:ns3="http://myCompany/myDir3/myDir4/Common/V1" xmlns:ns2="http://
Action.c(3):     myCompany/myDir3/myDir4/MovementService/V1"/></soap:Body></soap:Envelope>\r\n
Action.c(3):     --uuid:10f25f9b-d179-425c-a7c6-c31040046f4b--
Action.c(3): t=760ms: Request done "http://99.98.197.118:8080/myDir1/services/MovementServicePort"   [MsgId: MMSG-26000]
Action.c(3): Error Exceptions:
Action.c(3): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Response is not well-formed XML. ---> System.Xml.XmlException: Data at the root level is invalid. Line 2, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at Microsoft.Web.Services2.Xml.XmlSkipDTDReader.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at Microsoft.Web.Services2.SoapEnvelope.Load(Stream stream)
   at Microsoft.Web.Services2.Messaging.SoapPlainFormatter.Microsoft.Web.Services2.Messaging.ISoapFormatter.Deserialize(Stream stream)
   at Microsoft.Web.Services2.InputStream.GetRawContent()
   at Microsoft.Web.Services2.InputStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamReader.ReadBuffer(Char[] userBuffer, Int32 userOffset, Int32 desiredChars, Boolean& readToUserBuffer)
   at System.IO.StreamReader.Read(Char[] buffer, Int32 index, Int32 count)
   at System.Xml.XmlTextReaderImpl.ReadData()
   at System.Xml.XmlTextReaderImpl.InitTextReaderInput(String baseUriStr, Uri baseUri, TextReader input)
   at System.Xml.XmlTextReaderImpl..ctor(String url, TextReader input, XmlNameTable nt)
   at System.Xml.XmlTextReader..ctor(TextReader input)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.GetReaderForMessage(SoapClientMessage message, Int32 bufferSize)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Mercury.LR.NETProxy.MovementService.GetMovement(GetMovementRequestType GetMovementRequest)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Mercury.LR.LrWsNetClient.ProxyCreator.InvokeMethod(String sMethod, IWSMethodParameters mParams, String sAsyncEvent)
   at Mercury.LR.LrWsNetClient.NetReplay.InvokeMethod(String sMethod, IWSMethodParameters mParams, String sAsyncEvent)
Action.c(3): Error:InvokeMethod failure: Response is not well-formed XML..
Action.c(3): Error stack trace:    at Mercury.LR.LrWsNetClient.ResultArgExtractor.CreateXmlArgsDoc()
   at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArgAsXml(String sArgPath, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArg(String sArgPath, Boolean IsSaveResultArgumentsAsIs, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.ProxyCreator.ExtractArg(String sArgPath, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.NetReplay.ExtractResultArg(String sArgPath, ArgumentExtractionType extractionType, Array& barrArgValue)
Action.c(3): Error:ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(3): Error:Web service call "GetMovement_101" execution failed
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi,

 

The response is using MTOM format, not SOAP format.

A MTOM format is sent with MIME message.

A MIME message contains:

+ MIME boundary

+ MIME header

+ SOAP message

 

Vugen is sending a SOAP request message, it expects a SOAP response come back. But server is sending a MTOM message comes back.

So, that is reason why it shows error “Response is not well-formed XML”.

Please try to correct the response message on the server.

 

In can you cannot change on the server, I have a workaround on this issue; please try to put this line:

       "UserHandlerName=LrWsAttachmentsHandler",

   in front of “BEGIN_ARGUMENTS,” of web_service_call

It looks like this:

web_service_call( "StepName=GetMovement_101",

        "SOAPMethod=MovementService|MovementServicePort|GetMovement",

        "ResponseParam=response",

        "Service=MovementService",

        "ExpectedResponse=SoapResult",

        "Snapshot=t1416568484.inf",

      "UserHandlerName=LrWsAttachmentsHandler",

        BEGIN_ARGUMENTS,

        "xml:GetMovementRequest="

            "<GetMovementRequest>"

                "<MovementId>06AACD3B-2B4D4-E36A-23EC-CC33838EE63</MovementId>"

                "<Verbosity>ALL</Verbosity>"

            "</GetMovementRequest>",

        END_ARGUMENTS,

        BEGIN_RESULT,

        END_RESULT,

        LAST);

 

This user handler will make the web service call to be able to accept a MTOM message.

Please try with it.

 

Thanks,

Phuong Nguyen

From HP LR Team

View solution in original post

Highlighted
Super Contributor.
Super Contributor.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi Phuong

Thank you so much for taking some time to look at my query.  Your suggested workaround of putting "UserHandlerName=LrWsAttachmentsHandler" ahead of the BEGIN_ARGUMENTS directive  works perfectly; your assistance on this is much appreciated!

Cheers, Claire

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hi Phuong,

 

I am not sure if this thread is still open but I have a similar situation where the application is using mtom in response. I have tried the solution you suggested but it is not working for me. As I go through the vugen replay logs I see this (<a:StatusCode>CM999-Service Unavailable</a:StatusCode>). However this runs fine from SoapUI. 

 

In my case, I am sending the soap request and in return the application is sending a list of links for some documents.  

 

 web_service_call( "StepName=GetMultiDocumentList_101",
  "SOAPMethod=Service|BasicHttpBinding_IService|GetMultiDocumentList",
  "ResponseParam=response",
  "Service=Service",
  "URL=https://{myURL}/CMWS29_01/Service.svc",
  "ExpectedResponse=SoapResult",
  "Snapshot=t1427245064.inf",
  "UserHandlerName=LrWsAttachmentsHandler",
  BEGIN_ARGUMENTS,
  "cmGUID=4e06a6b5-8edd-4406-8ec1-6d7147dad710",
  "xml:DocumentsRequest="
   "<DocumentsRequest>"
    "<DocRequest>"
     "<DocumentClass>{pDocumentClass}</DocumentClass>"
     "<DocumentKeys>"
      "<NameVal>"
       "<Name>CheckNumber</Name>"
       "<Value>0003032149</Value>"
      "</NameVal>"
     "</DocumentKeys>"
    "</DocRequest>"
   "</DocumentsRequest>",
  END_ARGUMENTS,
  BEGIN_RESULT,
  "GetMultiDocumentListResult/DocumentList/*[1]/DocID=Param_DocID",
  END_RESULT,
  LAST);

 

Any help would be appreciated.

 

Thanks!

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Load Runer test web servcies using soap version 1.2

Jump to solution

Hello Phuong_Nguyen ,

Can you please tell how to do the text check in SOAP WS call. I am using web_reg_find function but after 1st iteration the user is getting aborted . But the same web_reg_find function is working preety well with the REST Request. Can you please help. Thanks in advance.

Vivek

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.