简体   繁体   中英

How to identify whether a web service is asynchronous or synchronous

I know that there are two types of web services called asynchronous web services and synchronous web services. What I want to know are

1. Can I identify whether a web service is asynchronous or synchronous by inspecting the WSDL of the service? Or is there any other way such as inspecting the generated stub etc?

2. Can I develop an asynchronous client for a synchronous web service? Does it make sense?

Thank you.

I'm not an expert, but I'll give my two cents and hope that you find this useful.

Well I assume that it depends. You can have an asynchronous architecture with no signs of it. Someone could implement the following

  1. The client makes a request to the service.
  2. The service responds with a success or error message just to indicate the status of the request.
  3. The service begins to process the request.
  4. The service makes a request to another endpoint. This request is the actual response for the first request.
  5. The service get a response, that the message was received successfully.

This is an asynchronous architecture. The service (actual service) when finished sends the actual response to an endpoint. This endpoint is actually the client that sent the first request.

This endpoint, the one that the client is listening to, for the actual response can be predefined (hard coded), or can be included as a parameter (callback) in the first response. If the case is the latter, then I guess you could deduce that this is an asynchronous web service.

For the second part of your question. Yes you can. Check this Asynchronous web services calls with JAX-WS: Use wsimport support for asynchrony or roll my own? and this http://cxf.apache.org/docs/asynchronous-client-http-transport.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM