Specify the javax.jws.Oneway annotation when using the one-way operation in Web Services. The method of Web Services Implementation Class for which the javax.jws.Oneway annotation is annotated, has only input messages and no output messages.
The following figure shows an example of mapping by using the javax.jws.Oneway annotation.
Figure 16-13 Example of mapping by using the javax.jws.Oneway annotation
![[Figure]](FIGURE/ZU162300.GIF)
A Web Services Implementation Class method annotated with the javax.jws.Oneway annotation must fulfill the following conditions:
- Specify void for the type of the return value. An error message (KDJW61108-E) is output to the standard error output and log if a type other than void is specified.
- Specify only one in parameter other than the SOAP header for Web Services of the BARE style. An error message (KDJW61111-E) is output to the standard error output and log if zero, or two or more in parameters are specified.
- Use javax.jws.WebParam.Mode.IN when using the Mode element of the javax.jws.WebParam annotation. An error message (KDJW61110-E) is output to the standard error output and log if any other annotation is used.
- Confirm that you declared no exceptions other than java.lang.RuntimeException and java.rmi.RemoteException and their subclasses in the method of Web Services Implementation Class. An error (KDJW61109-E) is output to the standard error output and log if one or more exceptions are specified.
- Do not use a holder type to specify the type of an argument. An error message is wrapped and output (KDJW79999-E) to the standard error output and log if a holder type is specified. The message KDJW20041-E is output.
Notes when using the javax.jws.Oneway annotation are as follows:
- Do not combine the javax.jws.Oneway and javax.xml.ws.soap.Addressing annotations in Web Services Implementation Class. The response messages do not exist for the one-way operations. The addressing functionality, however, specifies destinations for the response messages. Therefore, the operation is not guaranteed when the aforementioned annotations are concurrently used.
- Because the compliant SOAP messages do not exist for the one-way operations, implement the method annotated with the javax.jws.Oneway annotation of Web Services Implementation Class in such a way that an exception is not explicitly thrown.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.