Hi Friends,
I have a requirement,
I am doing some service validations. so i need to invoke two services at a same time both service call has to hit on the same time.
Can i use threading? If yes how?
Whats the best method to achieve my requirement
My code is as follows
string SOAPAction = "http://tempuri.org/Holdings/GetTopPositions";
string ReqXML = (new WebServicesAutomationFramework.XMLMapper.DataToRequestXMLMapper(BaseTestClassProp.RequestMap[TestContext.DataRow["ReqMapName"].ToString()],
XDocument.Parse(BaseTestClassProp.DataInsertMap[TestContext.DataRow["ReqMapName"].ToString()].ToString()), TestContext)).MapToXML();
_iTestFactory.SourceServiceCall = new WebServicesAutomationFramework.Entities.ServiceCallEntity(ReqXML, SOAPAction, WebServicesAutomationFramework.Common.ConfigurationSettings.SourceUrl
, WebServicesAutomationFramework.Common.ConfigurationSettings.RedirectUrl, true, "POST");
string GetTopPositionXML = _iTestFactory.SourceServiceCall.RespData.Response;
string SOAPAction2 = "http://tempuri.org/Holdings/GetRequestedData";
string ReqXML2 = string.Format(doc.ToString(), TestContext.DataRow["SignOnRACFID"].ToString(), TestContext.DataRow["Office"].ToString(), TestContext.DataRow["Account"].ToString());
_iTestFactory.SourceServiceCall = new WebServicesAutomationFramework.Entities.ServiceCallEntity(ReqXML2, SOAPAction2, WebServicesAutomationFramework.Common.ConfigurationSettings.SourceUrl
, WebServicesAutomationFramework.Common.ConfigurationSettings.RedirectUrl, true, "POST");
string GetRequestedDataXML = _iTestFactory.SourceServiceCall.RespData.Response;
DefectFix.ServiceValidation(ReqXML, GetTopPositionXML, GetRequestedDataXML, TestContext.DataRow["TestCaseName"].ToString(), "GetTopPositions", sb);