What is a Web Service One Way invocation?

Most of the message-exchange-patterns are request-response ones; however in some scenarios
oneway invocations are preferred, as the client does not expect any actual data in the response from
the server.

In such cases, the server is instructed that no SOAP response message has to be sent
back to the client, whose low-level invocation is immediately acknowledged (for instance with a
HTTP 202 response code if the HTTP transport is in use). Moreover the endpoint processing can be
(and usually is) performed in a separate thread, freeing resources that can be used to promptly
serve other requests.
Oneway operations in WSDL documents simply have no {http://schemas.xmlsoap.org/wsdl/}output
elements. On Java code, the @javax.jws.Oneway annotation is used as follows:

@WebService
public class MyServiceEndpoint {
   @Oneway
   public void ping() {
   //
   
   }
}

This Web service expose the method ping as web service and returns the thread of execution before executing the method.

Found the article helpful? if so please follow us on Socials