关于在weblogic中异步调用webservice
2009-09-22 00:00:00 来源:WEB开发网这几天碰到个问题:在weblogic中调用async webservice,如果客户端不等待结果(比如服务器端因为某些原因,web service需要执行很长时间),直接退出的话,weblogic server是否保存调用结果,结果保存多长时间?如果这样的异常客户端很多,对服务器有什么负面影响,比如连接资源、内存开销等。
首先我们先阐述一下异步的概念 在weblogic webservice中,有两处异步的概念:
1:Synchronous request-response (the default behavior) means that every time a client application invokes a Web Service operation, it receives a SOAP response, even if the method that Choosing RPC-Oriented or Document-Oriented Web Services Programming WebLogic Web Services 4-3 implements the operation returns void. Asynchronous one-way means that the client never receives a SOAP response, even a fault or exception.
默认情况下,weblogic webservice是请求-应答模式的,即客户端会block当前线程,直到server端处理完该请求(即使该请求没有任何返回值,void)。当 web service不返回结果,客户端只是提交请求,不需要知道执行结果的时候,可以采用异步单向模式。这种情况下,客户端线程为非阻塞的,它只负责提交请求,而不需要返回结果。定义这样的异步web service时,需要遵循如下的两个原则:
1.1:The back-end component that implements the operation must explicitly return void.
1.2:You cannot specify out or in-out parameters to the operation, you can only specify inparameters.
2:This section describes how to invoke an operation asynchronously. In this context, asynchronously means you invoke an operation and then optionally get the results of the invoke in a later step.
更多精彩
赞助商链接