HelloWorldSecureClient.jws Sample

This topic inludes the source code for the HelloWorldSecureClient.jws Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebServices/security/transport/helloWorldSecure/

Sample Source Code


01 /** 
02  <p>This web service serves as a client to the HelloWorldSecure web service.</p>
03  */
04 
05 
06 package security.transport.helloWorldSecure; 
07 
08 /**
09  * @common:target-namespace namespace="http://workshop.bea.com/HelloWorldSecureClient"
10  */
11 public class HelloWorldSecureClient implements com.bea.jws.WebService
12 
13     /**
14      * @common:control
15      */
16     private security.transport.helloWorldSecure.HelloWorldSecureControl hws;
17     
18     /**
19      <p>Only users granted the role of Friends can access the web service
20      * HelloWorldSecure.jws. (See the &lt;security-constraint> element in
21      * WEB-INF/web.xml.
22      
23      <p>The user "weblogic", a pre-configured administrative user in 
24      * WebLogic Server, has been granted the role of Friend. (See WEB-INF/weblogic.xml.)
25      
26      <p>This user's authentication information (username and password)
27      * are passed to the HelloWorldSecure web service via the method calls setUsername() and 
28      * setPassword().  
29      
30      * @common:operation
31      */
32     public String invokeHWSecure()
33     {
34         hws.setUsername("weblogic");
35         hws.setPassword("weblogic");
36         String str = hws.HelloWorldSecure();
37         return str;
38     }
39     
40     
41