I would use code similar to below.  The idea is to:
1)  locate the SOAP service  (wsdl2java should have generated a Locator)
2)  Instantiate the stub class.
3)  Set the username and password in the stub.
4)  Make the SOAP call to a remote method.

The names of the Locator and Stub classes have been changed below to protect the 
innocent, but you'll get the idea.   The answer to your question  are the calls to the 
setUsername() and setPassword() methods.   These are provided by the 
org.apache.axis.client.Stub class that your stub extends.


  | package client;
  | 
  | import client.stub.MySOAPServiceLocator;
  | import client.stub.HelloSoapBindingStub; 
  | 
  | 
  | public class TestVersion
  | {
  |    public static void main( String[] args ) throws Exception
  |    {
  |       // Instantiate the webservice request.
  |       MySOAPServiceLocator l = new MySOAPServiceLocator();
  |       HelloSoapBindingStub tstub = (HelloSoapBindingStub) l.getHello();
  |       
  |       // Get the version from the SOAP service.
  |       // Assumes that the SOAP service has a method named "getVersion"
  |       // that returns a String.
  |       String version = null;
  |       try
  |       {
  |          tstub.setUsername( "user1" );
  |          tstub.setPassword( "pass1" );
  |          version = tstub.getVersion();
  |          System.out.println("Version: " + version);
  |       }
  |       catch( org.apache.axis.AxisFault af )
  |       {
  |          System.out.println("WRONG LOGIN: "+af.getMessage());
  |       }
  |    }
  | }
  | 

r,
Lance

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3847465#3847465

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3847465


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to