Defining a one or two way web service
This recipe explains how to define a one or two way web service. You might think that the title is misguided since all methods are by default exposed as two way web services. With that in mind, we will focus more on defining a one way web service.
How to do it…
We will define the OutputTransactions
method as a one way operation of a web service. Open the CCGatePortType
class in JDeveloper. Put the @OneWay
annotation next to the OutputTransaction
method:
@WebMethod @Oneway public void OutputTransactions() throws RemoteException;
That is it. With this annotation, the web service operation will become a one way operation, meaning the client will not wait for the response.
How it works…
The best way to see how the one way annotation works is through the WSDL document web service using expose operations. If we have default behavior (that is, two way web service operations), there is the following signature of operation in the WSDL document:
<operation...