Defining custom SOAP methods
A client can only successfully call a SOAP service by calling a SOAP method. A SOAP method is one precise task that the service offers to its clients. Therefore, when you create a SOAP service, you must also create one or more SOAP methods. Declare each method on the Methods tab of your SOAP service by providing values for the method properties listed below.
Method name
Each method must have a Method Name that is unique within the SOAP service it belongs to. Each method corresponds to a precise task that the service offers to perform.
For the 'SoapService' service create a method with Method Name SoapMethod. On saving the changes you will see that Annotation field is filled with the value '@WebMethod'.
Signature
A method’s signature is the part of a method declaration. It is the combination of the method name and the parameter list.
Implementation
A method's Implementation is the body code that is executed when a service client executes a service call.
For the 'SoapMethod' method change the Implementation to:
// Get the (complete) SOAP message as sent by the client
String xml = this.getSoapMessage();
Logger logger = Logger.getLogger(this.getClass().getName());
// Log the XML to standard output
logger.debug(xml);
Parameters
A method's Parameter(s) (as appropriate) specify the names and datatypes of information that is passed to the method and that the method passes back as a result.
The 'SoapMethod' method does not require any parameters.
Next steps
You are now ready to test and debug your SOAP service. Remember to re-publish the service each time you decide to make changes to the code.