这就是我喜欢stackoverflow的原因。我从来没有听说过这个!!!
您的“自动响应”可能是由 mule 中的行为引起的:
如果 mule 在 message 中检测到reply_to属性,则启动对该端点的自动响应。这是用于 jms 中的请求-回复功能,但可能会影响 http 连接器。
来源:
发送消息时自动响应
-------------------*------------------------
经过研究,我发现 ws-addressing 的正确行为是:
client -- SOAP request ( on port A ) --> server
client <-- HTTP 202 ( "Hello, i will send the response soon" HTTP body ) --- server
client <-- SOAP response ("Response is ready!!" on port B ) --- server
来源:jax-ws 2.2.8 和 ws-addressing
为了使这成为可能,我们需要:
1.- 服务器端点: mule/cxf
2.- 服务客户: soapui
3.- 回调端点:接收异步响应(我认为这是在 mule 中)
明白了这一点,关于它的官方文档是可悲的:
MULE 3.7 启用 WS-Addressing
我认为您需要 CallBack Enpoint 来创建和执行异步响应。我没有在骡子里找到任何东西:(。
这里有一些java实现的链接,没有m子:
带有 WS-Addressing 的异步 Web 服务
使用 JAX-WS 和 WS-Addressing 调用单端口异步服务
-------------------*------------------------
另一种解决方案可能是:
1.- mule/cxf 中的 Web 服务没有寻址。
2.- 内部操作方法:
public Response operation ( Request requestPayload ) {
MuleClient client = new MuleClient(muleContext);
client.dispatch("jms://my.queue", requestPayload , null);// this is async
return new Response("Hello, i will send the response soon.");
}
参考:使用 Mule 客户端
3.- 创建一个 jms 入站端点监听:jms://my.queue
<flow>
<jms:inbound-endpoint queue="my.queue" >
<do something>
<launch a response to client>
</flow>
这可能是:
a.- 通过电子邮件发送给客户
b.- 使用客户端发布的服务
c.- 短信通知
d.- 随便
这种方法可以更加灵活,并支持未来的疯狂需求。
如果您需要 mule cxf 服务或 jms 方面的帮助,请告诉我以帮助您!
http://jrichardsz.github.io/