Greetings -
I am very new to working with Web Services in Vugen and have a new
project that I inherited from someone else that is all Web Services so
needless to say I could use a few pointers.
My delemma is that I don't exactly understand how to use
'lr_xml_extract' properly (and clearly other pieces of the web service
puzzle) and I would like to re-use some of the code the prior engineer
used for a similar script of which I have as an example. I can pretty
much understand what they were trying to do with the above noted
exception, any help would be appreciated...
Below is an excerpt from the script, the names have been changed to
protect the innocent = )
--------------------------------------------------------------------------
TOP OF THE SCRIPT I AM TRYING TO EMULATE
------------------------------------------------------------------------
Action()
{
int result;
int i;
char status[300] = "<factor lbl=\"Some_Value\" value=\"$7.49\"></
factor>";
lr_think_time(20);
lr_start_transaction("Blah_001_SubmitRequest");
soap_request("StepName=SOAP Request",
"URL=
http://blah.blarger.com/thing/submit.do",
"SOAPEnvelope="
-----------------------------------------------------------------------------------------------------------
BOTTOM OF SCRIPT AFTER SOAP ENVELOPE
----------------------------------------------------------------------------------------------------------
"SOAPAction=",
"ResponseParam=response1",
"Snapshot=t1283439504.inf",
LAST);
lr_xml_extract("XML={response1}",
"FastQuery=/User/Group/BView/Output[2]/View/
someFactors/something/factor",
"XMLFragmentParam=ParamXml_factor",
LAST);
result = stricmp( status,lr_eval_string("{ParamXml_factor}") );
if (i==result)
{
lr_end_transaction("ALPS_Calculation_001_SubmitRequest", LR_PASS);
}
else
{
lr_end_transaction("ALPS_Calculation_001_SubmitRequest", LR_FAIL);
lr_think_time(20);
return 0;
}
****************************************************************************
***** So the biggest issue I am having in terms of understanding this
script and the use of 'lr_xml_extract' is the "FastQuery=" arguement
and the use of the XPATH?. In this example the FastQuery arguement
is " "FastQuery=/User/Group/BView/Output[2]/View/someFactors/
something/factor", which is the XPATH? to the data that is assigned at
the top of the script to the char "status" to be matched on as a
success, this was seemlingly done arbitrarily as there are many other
elements with data in the response that could have been used to match
against, is there a simple consistent way to match a successful SOAP
response that is commonly utilized? Is there a tool that might aid
in the capturing/manipulation of the SOAP response?
Any help is greatly appreciated....
Thanks!