English 中文(简体)
如何在模拟非同步服务中处理 ws- 地址
原标题:How to handle ws-addressing in mock asynchronous service
  • 时间:2012-05-25 11:36:49
  •  标签:
  • soapui

我试图在肥皂剧中模拟一种无节制的服务。我提到https://stackoverflow.com/ questions/7901685/soapui-mockui-mocking-asynchronous-services>>SoapUI 模拟无节制服务 ,但服务客户没有收到回电请求,因为它没有被发送到WS地址中指定的指定地址。

启用WS在模拟服务和模拟请求上的演算, 导致错误发生 。

ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.execute(WsdlMockResponse.java:323)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:259)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:290)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:375)
at com.eviware.soapui.monitor.JettyMockEngine$ServerHandler.handle(JettyMockEngine.java:715)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.support.soap.SoapUtils.getHeaderElement(SoapUtils.java:146)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.getHeader(WsaUtils.java:138)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.createWSAddressingMockResponse(WsaUtils.java:488)
at com.eviware.soapui.impl.wsdl.support.wsa.WsaUtils.addWSAddressingMockResponse(WsaUtils.java:480)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockResponse.execute(WsdlMockResponse.java:287)
... 16 more

请建议我如何重提这些问题:

  • How to get the addressing information from soap request and use it in dummy callback request ?
  • How to set the endpoint address for the callback request in the test case ?

提前感谢

最佳回答

SAPUI 不支持在假的无同步服务中隐含的 ws 处理 。 您需要从肥皂请求中获取细节, 并将其作为回馈请求的一部分传回 。 按照代码解答问题 。

def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)
def map = new com.eviware.soapui.support.types.StringToObjectMap()
holder.declareNamespace("wsa","http://www.w3.org/2005/08/addressing")

map.put("messageID", holder.getNodeValue("//wsa:MessageID/text()"))
def address = holder.getNodeValue("//wsa:ReplyTo/wsa:Address/text()")
map.put("address", java.net.URLDecoder.decode(address, "UTF-8"))

def testsuite = context.mockService.project.getTestSuiteByName("callbackBinding TestSuite")
def testcase = testsuite.getTestCaseByName("successResponse TestCase")

//get mock request teststep by type
def testrequest = (WsdlTestRequestStep)testcase.getTestStepsOfType(WsdlTestRequestStep.class).get(0)
//Set endpoint for the testcase request. Endpoint is the replyTo address sent by by the caller 
testrequest.testRequest.setEndpoint(address)
testcase.run(map, false)
问题回答

暂无回答




相关问题
soapUI assertion where value is groovy reserved word

I have a response that contains the following: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <project:loginResponse ...

PHP SoapFault not WSDL Schema compliant in soapUI?

I came across a strange one today, it goes like this: I m setting up test suites for QAing a web service of mine, which is written in PHP5 - making use of the class SoapFault among others. I use the ...

Create MockService in soapUI without wsdl

Is it somehow possible to create mock service in soapUI without having wsdl file? All I have is sample request and responses. I think that should be possible to generate WSDL from request and ...

how do I test an MTOM webservice with soapUI?

I ve built a webservice that wraps Apache FOP. You send it XML, and it gives you an MTOM stream that contains the rendered PDF. Now that its working, I d like to run some performance tests on it. ...

SoapUI Groovy 方言

我试图阅读即将提出的申请,并根据请求中价值分立的3.0作出模拟反应。 我为此使用了以下大写。

热门标签