Asynchronous web service SOAP

后端 未结 3 1474
长情又很酷
长情又很酷 2021-01-21 08:11

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

相关标签:
3条回答
  • 2021-01-21 08:25

    If you use some tool like WSDL2Java for client generation, you can even choose to generate an asynchronous client. It will generate for you a callback handler with empty methods for each of the service operations and exceptions of the service. You then can just implement those methods to set the actions to do when the response is received. Remember that when an asynchronous call is done a new thread is started.

    0 讨论(0)
  • 2021-01-21 08:41

    Yes, Once you receive the file, you may return the request id to client and start processing on server side and do maintain various states of processing. Client can come back in different interval, and will receive the processing status or the output if it is completed.

    0 讨论(0)
  • 2021-01-21 08:44

    You can use Callback approach of Asynchronous InvocationModel.

    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

    0 讨论(0)
提交回复
热议问题