SimpleImpl.java
01 package examples.webservices.jws_basic.simple;
02 
03 // Import the standard JWS annotation interfaces
04 
05 import javax.jws.WebMethod;
06 import javax.jws.WebService;
07 import javax.jws.soap.SOAPBinding;
08 
09 // Import the WebLogic-specific JWS annotation interfaces
10 
11 import weblogic.jws.WLHttpTransport;
12 
13 // Standard JWS annotation that specifies that the name of the Web Service is
14 // "Simple" and the targetNamespace used in the generated WSDL is 
15 // "http://example.org"
16 @WebService(name="Simple", targetNamespace="http://example.org")
17 
18 // Standard JWS annotation that specifies the mapping of the service onto the
19 // SOAP message protocol.
20 @SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
21              use=SOAPBinding.Use.LITERAL,
22              parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
23 
24 // WebLogic-specific JWS annotation that specifies the context path and 
25 // service URI used to build the URI of the Web Service is "jws_basic_simple/SimpleService"
26 @WLHttpTransport(contextPath="jws_basic_simple", serviceUri="SimpleService")
27 
28 /**
29  * This JWS file forms the basis of a simple WebLogic Web Service with a 
30  * single operation: sayHello
31  *
32  @author Copyright (c) 2009, Oracle and/or its affiliates. All Rights Reserved.
33  */
34 
35 public class SimpleImpl {
36 
37   // Required constructor
38 
39   public SimpleImpl() {}
40 
41   // Standard JWS annotation that specifies that the method should be exposed
42   // as a public operation.  Because the annotation does not include the
43   // member-value "operationName", the public name of the operation is the
44   // same as the method name: sayHello.
45 
46   @WebMethod()
47   public String sayHello(String message) {
48     System.out.println("sayHello:" + message);
49     return "Here is the message: '" + message + "'";
50   }
51 }