Changeset 4091


Ignore:
Timestamp:
04/08/08 16:13:17 (11 years ago)
Author:
cbyrom
Message:

Tidy up the provided xmlbeans binding java client.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/java/axis2/xmlbWsseEchoClient/src/wssecurity/test/security/ndg/XmlBwsseEchoClient.java

    r4053 r4091  
    11package wssecurity.test.security.ndg; 
     2 
     3import java.rmi.RemoteException; 
    24 
    35import org.apache.axis2.context.ConfigurationContext; 
     
    68public class XmlBwsseEchoClient { 
    79 
    8     public static void main(java.lang.String args[]){ 
     10    public static void main(java.lang.String args[]) 
     11    { 
    912        try{ 
    10                 String configDir = "/home/pjkersha/workspace/xmlbWsseEchoClient"; 
     13                String configDir = "/home/users/cbyrom/eclipseWorkspace/TI12-security-java/axis2/xmlbWsseEchoClient"; 
    1114                ConfigurationContext ctx =  
    1215                        ConfigurationContextFactory. 
     
    1417                                                                                configDir + "/conf/axis2.xml"); 
    1518                 
    16                 String endpointURI = "http://localhost:7200/Echo"; 
    17                 EchoServiceStub stub = new EchoServiceStub(ctx, endpointURI); 
     19                String endpointURI = "http://localhost:7000/Echo"; 
     20                EchoServiceStub serviceStub = new EchoServiceStub(ctx, endpointURI); 
    1821 
    19             echo(stub); 
    20  
    21         } catch(Exception e){ 
     22            callEchoService(serviceStub); 
     23        }  
     24        catch(Exception e) 
     25        { 
     26                System.out.println("Something bad happened:"); 
    2227            e.printStackTrace(); 
    23             System.err.println("\n\n\n"); 
    2428        } 
    2529    } 
    2630 
    2731    /* two way call/receive */ 
    28     public static void echo(EchoServiceStub stub){ 
    29         try{ 
    30                 EchoDocument reqDoc = EchoDocument.Factory.newInstance(); 
    31             EchoDocument.Echo req = reqDoc.addNewEcho(); 
    32             req.setEchoIn("Hello echo server!"); 
     32    public static void callEchoService(EchoServiceStub stub) throws RemoteException 
     33    { 
     34        EchoDocument reqDoc = EchoDocument.Factory.newInstance(); 
     35        EchoDocument.Echo req = reqDoc.addNewEcho(); 
     36        req.setEchoIn("Hello echo server!"); 
    3337 
    34             EchoResponseDocument res = stub.Echo(reqDoc); 
     38        EchoResponseDocument res = stub.Echo(reqDoc); 
    3539 
    36             System.err.println(res.getEchoResponse().getEchoResult()); 
    37         } catch(Exception e){ 
    38             e.printStackTrace(); 
    39             System.err.println("\n\n\n"); 
    40         } 
     40        System.out.println("Service called successfully - reponse:"); 
     41        System.out.println(res.getEchoResponse().getEchoResult()); 
    4142    } 
    4243} 
Note: See TracChangeset for help on using the changeset viewer.