异步Web服务SOAP [英] Asynchronous web service SOAP

查看:184
本文介绍了异步Web服务SOAP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我已经公开为正常的SOAP的Web服务的接口。接口中的一个方法是为客户端的文件发送到服务器,然后服务器处理该文件,并返回一个结果文件中。处理文件可能需要一些时间,所以我想用这个方法的异步调用是一个更好的主意。我想到了以下流程:

I have an interface that I've exposed as a regular SOAP web service. One method of the interface consists for the client to send a file to the server, then the server processes the file and returns a result file. Processing the file may take some time, so I think using asynchronous invocation of this method is a better idea. I thought about the following flow:

客户端调用异步方法和发送用的附件(MTOM)的文件。
当由服务器接收的文件,一个响应被发送回​​客户端指示该文件已经被接收,并且它会在短期内处理。
一旦该文件是程序,一个响应被发送回​​客户端指示它已被处理,其结果文件是在响应也作为附件返回。

The client invokes the asynchronous method and sends the file using an attachment (MTOM). When the file is received by the server, a response is sent back to the client indicating that the file has been received and that it will be processed shortly. Once the file is processes, a response is sent back to the client indicating it has been processed and a result file is returned in the response also as an attachment.

是否有可能使用SOAP与CXF?

Is it possible using SOAP with CXF?

感谢

推荐答案

您可以使用异步InvocationModel 回调办法>。

You can use Callback approach of Asynchronous InvocationModel.

回调方法 - 在这种情况下,调用远程操作,则
  调用了一个参考的回调另一种特殊方法
  对象(的javax.xml.ws.AsyncHandler型)作为它的一个参数。
  每当响应消息到达客户端,CXF运行时的
  回调的AsyncHandler对象给它的内容
  响应消息

Callback approach - in this case, to invoke the remote operation, you call another special method that takes a reference to a callback object (of javax.xml.ws.AsyncHandler type) as one of its parameters. Whenever the response message arrives at the client, the CXF runtime calls back on the AsyncHandler object to give it the contents of the response message

的更多信息可从以下可得:

More information can be had from the following:

的Apache CXF

这篇关于异步Web服务SOAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆