cancel
Showing results for 
Search instead for 
Did you mean: 

Call a web service asynchronously

Former Member
0 Kudos

Hi,

I have created a web service in Java using wizard in NWDS. I created a method in a java class with a return type "String", and exposed it as web service. I guess this will be a synchronous web service.

On the other hand, correct me if i'm wrong, if the method has no return type, ie, "void", then it will be an asynchronous web serivce.

However, for my case above which has a return type "String", can the web service users (another java application or from PI) call this web service asynchrously, ie, without waiting for my web service to finish the processing (because will cause timeout due to long processing time)?

Please give some insight into this question.

Thanks.

- julius

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Julius,

Firstly i ll tell you the difference between synchronous and asychronous web services.

Synchronous services are characterized by the client invoking a service and then waiting for a response to the request. Because the client suspends its own processing after making its service request, synchronous services are best when the service can process the request in a small amount of time. Synchronous services are also best when applications require a more immediate response to a request. Web services that rely on synchronous communication are usually RPC-oriented. Generally, consider using an RPC-oriented approach for synchronous Web services.

With asynchronous services, the client invokes the service but does not -- or cannot -- wait for the response. Often, with these services, the client does not want to wait for the response because it may take a significant amount of time for the service to process the request. The client can continue with some other processing rather than wait for the response. Later, when it does receive the response, it resumes whatever processing initiated the service request.

As per my knowledge, it has nothing to do with the return type.

Now regarding your case where your service method's return type is String, it can be be synchronous as well as asynchronous.

Hope your doubt is clear.

Thanks

Sagar Ingalwar

Former Member
0 Kudos

Hi,

In this case, what is the different when the client call the same web service synchronously and asynchronously? Eg, in coding perpective?

Thanks.

- julius

Answers (2)

Answers (2)

Former Member
0 Kudos

found an answer with Axis2.

Former Member
0 Kudos