【问题标题】:JAX WS async client: capture WS-Addressing 202 acceptedJAX WS 异步客户端:捕获 WS-Addressing 202 接受
【发布时间】:2016-03-05 12:58:48
【问题描述】:

我必须使用 WS-Addressing 调用多个 Web 服务。 调用 web 服务时,ReplyTo 设置为我实现的回调端点。

客户端是使用 async with 从目标 WSDL 生成的

<enableAsyncMapping>true</enableAsyncMapping>

它为每个具有以下签名的 web 服务生成 Async 版本:

javax.xml.ws.Response<SampleWebServiceOutput> sampleWebService(SampleWebServiceInput input)

当调用sampleWebServicelike时,

Response<SampleWebServiceOutput> response = clientWsPort.sampleWebService(input);

如果请求成功,服务器将返回202 Accepted,但我不知道如何获取它。

如果我使用response.get(),它将永远阻塞,因为响应被发送到我的回调 url (WSA-Addressing Reply To)

任何线索如何确定服务器是否成功接受请求?

谢谢。

【问题讨论】:

    标签: java web-services wsdl jax-ws ws-addressing


    【解决方案1】:

    显然,当您设置不同的回复地址时返回的响应会导致空响应,这可以解释为什么当您调用 response.get() 时它会挂起。 推荐的解决方案是使用 getResponseContext() 之类的东西,它是从绑定中调用的。

    【讨论】:

    • 我将尝试使用 Response 的 getContext() 并查看它提供了什么。
    猜你喜欢
    • 2014-07-30
    • 2012-09-25
    • 2016-01-31
    • 2012-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-16
    • 1970-01-01
    相关资源
    最近更新 更多