Skip to content

Instantly share code, notes, and snippets.

@distributedlife
Last active December 28, 2015 05:09
Show Gist options
  • Select an option

  • Save distributedlife/7447419 to your computer and use it in GitHub Desktop.

Select an option

Save distributedlife/7447419 to your computer and use it in GitHub Desktop.
distributedlife.com blog code samples
void ConfigureMethod (const char* const Method)
{
lr_save_string (Method, "Method") ;
lr_save_string(lr_eval_string ("{Method}Response"), "Response");
lr_save_string(lr_eval_string ("{Method}Result"), "Result");
}
web_service_call
(
"StepName=GetDataUsingDataContract_102",
"SOAPMethod=Service1|WSHttpBinding_IService1|GetDataUsingDataContract",
"ResponseParam=response",
"Service=Service1",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
"xml:composite="
"<composite>"
"<BoolValue>true</BoolValue>"
"<StringValue>abcde</StringValue>"
"</composite>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
web_service_call
(
"StepName=Service}::{Method}",
"SOAPMethod={Service}|{Binding}|{Method}",
"ResponseParam=response",
"Service={Service}",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
"xml:composite="
"<composite>"
"<BoolValue>true</BoolValue>"
"<StringValue>The quick brown fox jumps over the lazy dog</StringValue>"
"</composite>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
void SetDefaultParameters (void)
{
lr_set ("true", "BoolValue") ;
lr_set ("The quick brown fox jumps over the lazy dog", "StringValue") ;
}
vuser_init()
{
return 0;
}
SetDefaultParameters () ;
web_service_call
(
"StepName=Service}::{Method}",
"SOAPMethod={Service}|{Binding}|{Method}",
"ResponseParam=response",
"Service={Service}",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
"xml:composite="
"<composite>"
"<BoolValue>{BoolValue}</BoolValue>"
"<StringValue>{StringValue}</StringValue>"
"</composite>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
SetDefaultParameters () ;
lr_set ("false", "BoolValue") ;
web_service_call
(
"StepName=Service}::{Method}",
"SOAPMethod={Service}|{Binding}|{Method}",
"ResponseParam=response",
"Service={Service}",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
"xml:composite="
"<composite>"
"<BoolValue>{BoolValue}</BoolValue>"
"<StringValue>{StringValue}</StringValue>"
"</composite>",
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
ConfigureMethod ("GetDataUsingDataContract") ;
lr_save_string(lr_eval_string ("{Method}Response"), "Response");
lr_save_string(lr_eval_string ("{Method}Result"), "Result");
lr_xml_extract
(
"XML={response}",
"FastQuery=Envelope/Body/GetDataUsingDataContractResponse/GetDataUsingDataContractResult/BoolValue",
"XMLFragmentParam=BoolValue",
LAST
);
lr_xml_extract
(
"XML={response}",
"FastQuery=Envelope/Body/GetDataUsingDataContractResponse/GetDataUsingDataContractResult/StringValue",
"XMLFragmentParam=StringValue",
LAST
);
lr_xml_extract
(
"XML={response}",
"FastQuery=Envelope/Body/{Response}/{Result}/BoolValue",
"XMLFragmentParam=BoolValue",
LAST
);
lr_xml_extract
(
"XML={response}",
"FastQuery=Envelope/Body/{Response}/{Result}/StringValue",
"XMLFragmentParam=StringValue",
LAST
);
void ConfigureMyTestingService (void)
{
lr_set("Service1", "Service");
lr_set("WSHttpBinding_IService1", "Binding") ;
lr_set("Distributedlife.MyService.Service.xml", "TempFile") ;
lr_set(GetHostIpAddress (), "HostIpAddress") ;
}
lr_set("Service1", "Service");
lr_set("WSHttpBinding_IService1", "Binding") ;
web_service_call
(
"StepName=GetDataUsingDataContract_102",
"SOAPMethod=Service1|WSHttpBinding_IService1|GetDataUsingDataContract",
"ResponseParam=response",
"Service=Service1",
"ExpectedResponse=SoapResult",
BEGIN_ARGUMENTS,
END_ARGUMENTS,
BEGIN_RESULT,
END_RESULT,
LAST
);
"SOAPMethod=Service1|WSHttpBinding_IService1|GetDataUsingDataContract",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment