pradeepch
14 years agoOccasional Contributor
Mocking Async service callback
I am trying to mock an asynchronous web service. I am following approach as provided in soapui forum viewtopic.php?f=5&t=3542&p=12474&hilit=asynchronous#p12529. My problem is that "relatesTo" header tag is not included in callback response to the client. I have provided the values for relatesTo header value in property expansions. It seems that soapui is ignoring the relatesTo header tag. Following is snippet of code used to generate callback response.
Please guide on how to include the relatesTo tag.
Thanks.
def messageID = holder.getNodeValue("//wsa:MessageID/text()")
log.info messageID
map.put("relatesTo", messageID);
def address = holder.getNodeValue("//wsa:ReplyTo/wsa:Address/text()")
address = java.net.URLDecoder.decode(address, "UTF-8");
log.info address
map.put("address", address);
def testsuite = context.mockService.project.getTestSuiteByName("getQueryCountCallbackBinding TestSuite")
def testcase = testsuite.getTestCaseByName("setQueryCountResponse TestCase")
if(testcase != null){
def teststepList = testcase.getTestStepsOfType(WsdlTestRequestStep.class)
def testrequest = (WsdlTestRequestStep)teststepList.get(0)
//Set endpoint for the testcase request. Endpoint is the replyTo address sent by by the caller
testrequest.testRequest.setEndpoint(address)
testrequest.testRequest.getWsaConfig().setRelatesTo(messageID)
testcase.run(map, true)
}
Please guide on how to include the relatesTo tag.
Thanks.