Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Lieutenant Commander
Lieutenant Commander
789 views

LoadRunner Webservice Soaprequest

 
 

Hi Everyone

I've been having a bit of a battle with load runner 2020 and LR 12.6 in trying to get a successful response to a web service request and tried multiple ways as below 

First: I tried  to import WSDL which have a MTOM Body but getting error that WSDL is not loaded successfully. 

Second : I tried to add a soap request as below but get an internal error below sample of the structure used 

any recommendation 

 

 soap_request("StepName=SOAP Request",                                        
        "URL=http://0.0.0.0:000/example",                                        
        "SOAPEnvelope="
        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soapenv:Header>"
"<UserMessage>"
"<Message>"
   "<MessageId>d514215-10fd-41c2-8f23-kk6e360bd09e</MessageId>"
"</Message>"
"<Attachment>ID:000</Attachment>"
"</soapenv:Body>"
"</soapenv:Envelope>",                    
        "SOAPAction="                                           
        "ResponseParam=response",                                        
        "Snapshot=t1000002416.inf",    
"UserHandlerName=LrWsAttachmentsHandler",        
        LAST); 

-Also I tried adding request in "SOAPACTION" instead of above  and adding wsdl in SOAPEnvelope section but get same internal error 

Thanks

0 Likes
12 Replies
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Hi Selanmo,

The soap data looks in a incorrect xml format, soapenv:Header, UserMessage and soapenv:Body are not in pairs. Please make sure the content is loyal to the original format.

Phillip

0 Likes
Lieutenant Commander
Lieutenant Commander

 

Hi philip,

Thanks for your reply.  please find that previous was an example of the request, I have attached another example as below as well.

Please note that WSDL and request  generates the correct response when applied in SOAP UI however is not the same for load runner

soap_request("StepName=SOAP Request",                                        
        "URL=anyexample",                                        
        "SOAPEnvelope="
        "<soapenv:Envelope xmlv1:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soapenv:Header>"
"<v1:Messaging soap:mustUnderstand=\"0\">"
"<v1:UserMessage>"
"<v1:MessageInfo>"
      "<v1:MessageId>w2331231-10f0-00xc2-8f23-00e3360bd004</v1:MessageId>"
"</v1:MessageInfo>"
"<v1:Info>"
    "<v1:From>"
      "<v1:Id type=\"X\">1</v1:Id>"
      "<v1:name>example</v1:name>"
    "</v1:From>"
"</v1:Info>"
"</v1:UserMessage>"
"</v1:Messaging>"
  "</soapenv:Header>"
"<soapenv:Body>"
"<v1:MsgRq>"
"<v1:FileType>xml</v1:FileType>"
"<v1:Attachment>ID:000000</v1:Attachment>"
"</v1:MsgRq>"
"</soapenv:Body>"
"</soapenv:Envelope>"                                        
        "SOAPAction=",                                        
        " ResponseParam=response",                                        
        "Snapshot=t1070040017.inf",    
"UserHandlerName=LrWsAttachmentsHandler",        
        LAST);

Admiral Admiral
Admiral

Hi, 

what type of response do you have from your request? HTTP 500 Internal Server Error with "Action Mismatch" indication? 

Let me know,

Lorenzo

Lieutenant Commander
Lieutenant Commander

 
 

Hi Loranzo, 

Actually I  received below when adding my request in "SOAPAction" and kept wsdl format in  SOAPEnvelope

Action.c(4): <?xml version='1.0' ?>\n
Action.c(4): <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>\n
Action.c(4): <env:Body>\n
Action.c(4): <env:Fault>\n
Action.c(4): <faultstring>Internal Error</faultstring>\n
Action.c(4): </env:Fault>\n
Action.c(4): </env:Body>\n
Action.c(4): </env:Envelope>\n

let me know if you have any other recommendation 

Admiral Admiral
Admiral

Hi, 

if you have already insert a "SOAPAction" header (before web_rest() or web_custom_request() functions), can you try to modify your XML request as below? 

"<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" …\">"
"<soap:Header xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">"
"<wsa:Action>http://yourServiceSchema</wsa:Action>"
"<ser:culture>IT-it</ser:culture>"
… "</soap:Header>"

You should try to add a <wsa:Action> tag and valorize that with the Soap Schema of your service (you can see it with a test with SoapUI, you can read it on "Raw" view). 

Let us know if this can help you,

Lorenzo

0 Likes
Lieutenant Commander
Lieutenant Commander

 
 

Hi loranzo , 

Could you clarify more as my script is structured as below  and both cases are generated an internal error 

also I didn't use web_rest() or web_custom_request() functions before  soap_request("StepName=SOAPRequest",) mentioned 

First case : adding Soap_resqt step which include below 

a.soap envelop which including the service request input

b.sap action tag is empty 

Second case : adding Soap_resqt step which include below 

a.soap envelop which include wsdl structure data like : (

<wsdl:definitions xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" 

targetNamespace=\"http://example\" xmlns:tns=\"http:example\">"

 

b.sap action tag which include service request input

below is an example

soap_request("StepName=SOAP Request",                                        
        "URL=anyexample",                                        
        "SOAPEnvelope="
        "<soapenv:Envelope xmlv1:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soapenv:Header>"
"<v1:Messaging soap:mustUnderstand=\"0\">"
"<v1:UserMessage>"
"<v1:MessageInfo>"
      "<v1:MessageId>w2331231-10f0-00xc2-8f23-00e3360bd004</v1:MessageId>"
"</v1:MessageInfo>"
"<v1:Info>"
    "<v1:From>"
      "<v1:Id type=\"X\">1</v1:Id>"
      "<v1:name>example</v1:name>"
    "</v1:From>"
"</v1:Info>"
"</v1:UserMessage>"
"</v1:Messaging>"
  "</soapenv:Header>"
"<soapenv:Body>"
"<v1:MsgRq>"
"<v1:FileType>xml</v1:FileType>"
"<v1:Attachment>ID:000000</v1:Attachment>"
"</v1:MsgRq>"
"</soapenv:Body>"
"</soapenv:Envelope>"                                        
        "SOAPAction=",                                        
        " ResponseParam=response",                                        
        "Snapshot=t1070040017.inf",    
"UserHandlerName=LrWsAttachmentsHandler",        
        LAST);

your comments is appreciated 

Admiral Admiral
Admiral

Hi,

have you tried to test your request with another tool like SoapUI? Can you tell us how is the "raw" format of your request?

Thanks,

Lorenzo

0 Likes
Lieutenant Commander
Lieutenant Commander

 

Hi loranzo ,

Yes, I tried importing wsdl and it works fine without problem, but once I tried importing as I mentioned before give me the errors attached for LR12.6 and  wsdl is not loaded with LR 2020

Example Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:V1="http://schema/Common">
<soapenv:Header>
<V1:YU soap:mustUnderstand="0">
<V1:UM>
<V1:MesDT>
<V1:Timestamp>2020-08-17T09:30:40</V1:Timestamp>
<V1:CID>ytwaff32-10fd-41c2-8f23-9d65560bd09e</V1:CID>
</V1:UM>
<V1:DB>
<V1:From>
<V1:dpe="X">12</V1:dpe>
<V1:name>Example</V1:name>
</V1:From>
</V1:DB>
</soapenv:Header>

<soapenv:Body>
<V1:Rq>
<V1:Type>xml</V1:Type>
<V1:AsynCID>ytwaff32-10fd-41c2-8f23-9d65560bd09e</V1:AsynCID>
<V1:Attachment>id:000000</V1:Attachment>
</V1:Rq>
</soapenv:Body>
</soapenv:Envelope>

Please note that the attachment is the MTOM file that is included in SoapUI

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Hi,

Did you set the proxy in the Connection Settings when you were importing the wsdl?

Regarding SOAPRequest, I recommend to compare the request by analyzers like Fiddler/Wireshark

0 Likes
Lieutenant Commander
Lieutenant Commander

 

Hi Fei,

Unfortunately, it didn't work as well after the analysis required to import wsdl file and we revert back to the previous attached error

Admiral Admiral
Admiral

Hi, 

in add to the suggestion by Fei Gao, can you try a web_rest() or web_custom_request() with a function as below? Pay attention on <wsa:Action> tag: you should found the SOAP schema endpoint with a SoapUI test (view raw, so you can see all the details of your SOAP request). 

web_rest("Example",
"URL=http://0.0.0.0:0/example",
"Method=POST",
"EncType=raw",
"Snapshot=t1.inf",
"Body="
"<soapenv:Envelope xmlv1:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soapenv:Header>"
"<wsa:Action>http://schemas.meniga.com/pathToYourService</wsa:Action>"
"<v1:Messaging soap:mustUnderstand=\"0\">"
"<v1:UserMessage>"
"<v1:MessageInfo>"
"<v1:MessageId>w2331231-10f0-00xc2-8f23-00e3360bd004</v1:MessageId>"
"</v1:MessageInfo>"
"<v1:Info>"
"<v1:From>"
...
"</soapenv:Header>"
"<soapenv:Body>"
...
HEADERS,
"Name=UserHandlerName", "Value=LrWsAttachmentsHandler", ENDHEADER,
LAST);

Have a nice day,

Lorenzo

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.