當前位置: 首頁>>代碼示例>>Java>>正文


Java Call.setPassword方法代碼示例

本文整理匯總了Java中org.apache.axis.client.Call.setPassword方法的典型用法代碼示例。如果您正苦於以下問題:Java Call.setPassword方法的具體用法?Java Call.setPassword怎麽用?Java Call.setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.axis.client.Call的用法示例。


在下文中一共展示了Call.setPassword方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createCall

import org.apache.axis.client.Call; //導入方法依賴的package包/類
private Call createCall() throws RemoteException {
    try {
        Call _call = super._createCall();
        if (super.maintainSessionSet) {
            _call.setMaintainSession(super.maintainSession);
        }
        if (super.cachedUsername != null) {
            _call.setUsername(super.cachedUsername);
        }
        if (super.cachedPassword != null) {
            _call.setPassword(super.cachedPassword);
        }
        if (super.cachedEndpoint != null) {
            _call.setTargetEndpointAddress(super.cachedEndpoint);
        }
        if (super.cachedTimeout != null) {
            _call.setTimeout(super.cachedTimeout);
        }
        if (super.cachedPortName != null) {
            _call.setPortName(super.cachedPortName);
        }
        java.util.Enumeration keys = super.cachedProperties.keys();
        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();
            _call.setProperty(key, super.cachedProperties.get(key));
        }
        return _call;
    } catch (Throwable _t) {
        throw new AxisFault("Failure trying to get the Call object", _t);
    }
}
 
開發者ID:hashmapinc,項目名稱:witsml-client,代碼行數:32,代碼來源:StoreSoapBindingStub.java

示例2: main

import org.apache.axis.client.Call; //導入方法依賴的package包/類
public static void main(String args[]) {
  try {
    Options opts = new Options( args );

    args = opts.getRemainingArgs();

    if ( args == null || args.length % 2 != 0 ) {
      System.err.println( "Usage: GetInfo <symbol> <datatype>" );
      System.exit(1);
    }

    String  symbol = args[0] ;
    Service  service = new Service();
    Call     call    = (Call) service.createCall();

    call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) );
    call.setOperationName( new QName("urn:cominfo", "getInfo") );
    call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
    call.addParameter( "info", XMLType.XSD_STRING, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_STRING );
    call.setUsername( opts.getUser() );
    call.setPassword( opts.getPassword() );

    String res = (String) call.invoke( new Object[] { args[0], args[1] } );

    System.out.println( symbol + ": " + res );
  }
  catch( Exception e ) {
    e.printStackTrace();
  }
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:32,代碼來源:GetInfo.java

示例3: getQuote1

import org.apache.axis.client.Call; //導入方法依賴的package包/類
/**
 * This will use the WSDL to prefill all of the info needed to make
 * the call.  All that's left is filling in the args to invoke().
 */
public float getQuote1(String args[]) throws Exception {
  Options  opts = new Options( args );

  args = opts.getRemainingArgs();

  if ( args == null ) {
    System.err.println( "Usage: GetQuote <symbol>" );
    System.exit(1);
  }

  /* Define the service QName and port QName */
  /*******************************************/
  QName servQN = new QName("urn:xmltoday-delayed-quotes","GetQuoteService");
  QName portQN = new QName("urn:xmltoday-delayed-quotes","GetQuote");

  /* Now use those QNames as pointers into the WSDL doc */
  /******************************************************/
  Service service = new Service( new URL("file:GetQuote.wsdl"), servQN );
  Call    call    = (Call) service.createCall( portQN, "getQuote" );

  /* Strange - but allows the user to change just certain portions of */
  /* the URL we're gonna use to invoke the service.  Useful when you  */
  /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
  /********************************************************************/
  opts.setDefaultURL( call.getTargetEndpointAddress() );
  call.setTargetEndpointAddress( new URL(opts.getURL()) );

  /* Define some service specific properties */
  /*******************************************/
  call.setUsername( opts.getUser() );
  call.setPassword( opts.getPassword() );

  /* Get symbol and invoke the service */
  /*************************************/
    Object result = call.invoke( new Object[] { symbol = args[0] } );

  return( ((Float) result).floatValue() );
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:43,代碼來源:GetQuote1.java

示例4: main

import org.apache.axis.client.Call; //導入方法依賴的package包/類
public static void main(String args[]) throws Exception {
    FileReader  reader = new FileReader();
    reader.setDaemon(true);
    reader.start();

    Options opts = new Options( args );

    args = opts.getRemainingArgs();

    if ( args == null ) {
        System.err.println( "Usage: GetQuote <symbol>" );
        System.exit(1);
    }

    String   symbol = args[0] ;
    Service  service = new Service(new XMLStringProvider(wsdd));
    Call     call    = (Call) service.createCall();

    call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
    call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_FLOAT );
    call.setTransport( new FileTransport() );
    call.setUsername(opts.getUser() );
    call.setPassword(opts.getPassword() );
    call.setTimeout(new Integer(10000));

    Float res = new Float(0.0F);
    res = (Float) call.invoke( new Object[] {symbol} );

    System.out.println( symbol + ": " + res );

    reader.halt();
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:34,代碼來源:FileTest.java

示例5: getQuote

import org.apache.axis.client.Call; //導入方法依賴的package包/類
public float getQuote (String args[]) throws Exception {
  Options opts = new Options( args );

  args = opts.getRemainingArgs();

  if ( args == null ) {
    System.err.println( "Usage: GetQuote <symbol>" );
    System.exit(1);
  }

  symbol = args[0] ;

  // useful option for profiling - perhaps we should remove before
  // shipping?
  String countOption = opts.isValueSet('c');
  int count=1;
  if ( countOption != null) {
      count=Integer.valueOf(countOption).intValue();
      System.out.println("Iterating " + count + " times");
  }

  URL url = new URL(opts.getURL());
  String user = opts.getUser();
  String passwd = opts.getPassword();

  Service  service = new Service();

  Float res = new Float(0.0F);
  for (int i=0; i<count; i++) {
      Call     call    = (Call) service.createCall();

      call.setTargetEndpointAddress( url );
      call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
      call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
      call.setReturnType( XMLType.XSD_FLOAT );

      // TESTING HACK BY ROBJ
      if (symbol.equals("XXX_noaction")) {
          symbol = "XXX";
      }

      call.setUsername( user );
      call.setPassword( passwd );

      Object ret = call.invoke( new Object[] {symbol} );
      if (ret instanceof String) {
          System.out.println("Received problem response from server: "+ret);
          throw new AxisFault("", (String)ret, null, null);
      }
    res = (Float) ret;
  }

    return res.floatValue();
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:55,代碼來源:GetQuote.java

示例6: getQuote2

import org.apache.axis.client.Call; //導入方法依賴的package包/類
/**
 * This will do everything manually (ie. no WSDL).
 */
public float getQuote2(String args[]) throws Exception {
  Options  opts    = new Options( args );

  args = opts.getRemainingArgs();

  if ( args == null ) {
    System.err.println( "Usage: GetQuote <symbol>" );
    System.exit(1);
  }

  /* Create default/empty Service and Call object */
  /************************************************/
  Service  service = new Service();
  Call     call    = (Call) service.createCall();

  /* Strange - but allows the user to change just certain portions of */
  /* the URL we're gonna use to invoke the service.  Useful when you  */
  /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
  /********************************************************************/
  opts.setDefaultURL( "http://localhost:8080/axis/servlet/AxisServlet" );

  /* Set all of the stuff that would normally come from WSDL */
  /***********************************************************/
  call.setTargetEndpointAddress( new URL(opts.getURL()) );
  call.setUseSOAPAction( true );
  call.setSOAPActionURI( "getQuote" );
  call.setEncodingStyle( "http://schemas.xmlsoap.org/soap/encoding/" );
  call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
  call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
  call.setReturnType( XMLType.XSD_FLOAT );

  /* Define some service specific properties */
  /*******************************************/
  call.setUsername( opts.getUser() );
  call.setPassword( opts.getPassword() );

  /* Get symbol and invoke the service */
  /*************************************/
  Object result = call.invoke( new Object[] { symbol = args[0] } );

  return( ((Float) result).floatValue() );
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:46,代碼來源:GetQuote1.java

示例7: getQuote3

import org.apache.axis.client.Call; //導入方法依賴的package包/類
/**
 * This will use the WSDL to prefill all of the info needed to make
 * the call.  All that's left is filling in the args to invoke().
 */
public float getQuote3(String args[]) throws Exception {
  Options  opts = new Options( args );

  args = opts.getRemainingArgs();

  if ( args == null ) {
    System.err.println( "Usage: GetQuote <symbol>" );
    System.exit(1);
  }

  /* Define the service QName and port QName */
  /*******************************************/
  QName servQN = new QName("urn:xmltoday-delayed-quotes","GetQuoteService");
  QName portQN = new QName("urn:xmltoday-delayed-quotes","GetQuote");

  /* Now use those QNames as pointers into the WSDL doc */
  /******************************************************/
  Service service = new Service( new URL("file:GetQuote.wsdl"), servQN );
  Call    call    = (Call) service.createCall( portQN, "getQuote" );

  /* Strange - but allows the user to change just certain portions of */
  /* the URL we're gonna use to invoke the service.  Useful when you  */
  /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
  /********************************************************************/
  opts.setDefaultURL( call.getTargetEndpointAddress() );
  call.setTargetEndpointAddress( new URL(opts.getURL()) );

  /* Define some service specific properties */
  /*******************************************/
  call.setUsername( opts.getUser() );
  call.setPassword( opts.getPassword() );

  /* Get symbol and invoke the service */
  /*************************************/
  Object result = call.invoke( new Object[] { symbol = args[0] } );
  result = call.invoke( new Object[] { symbol = args[0] } );

  /* Reuse the call object to call the test method */
  /*************************************************/
  call.setOperation( portQN, "test" );
  call.setReturnType( XMLType.XSD_STRING );

  System.out.println( call.invoke(new Object[]{}) );

  return( ((Float) result).floatValue() );
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:51,代碼來源:GetQuote1.java

示例8: getQuote

import org.apache.axis.client.Call; //導入方法依賴的package包/類
public float getQuote (String args[]) throws Exception {
    Call.addTransportPackage("samples.transport");
    Call.setTransportForProtocol("tcp", TCPTransport.class);
    
    Options opts = new Options( args );
    
    args = opts.getRemainingArgs();
    
    if ( args == null ) {
        System.err.println( "Usage: GetQuote <symbol>" );
        System.exit(1);
    }
    
    String namespace = "urn:xmltoday-delayed-quotes";
    symbol = args[0] ;

    EngineConfiguration defaultConfig =
        (new DefaultEngineConfigurationFactory()).
        getClientEngineConfig();
    SimpleProvider config = new SimpleProvider(defaultConfig);
    SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender());
    config.deployTransport("tcp", c);

    Service service = new Service(config);
    Call call = (Call)service.createCall();
    
    call.setTransport(new TCPTransport());
    
    call.setTargetEndpointAddress( new URL(opts.getURL()) );
    call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
    call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_FLOAT );
    
    // TESTING HACK BY ROBJ
    if (symbol.equals("XXX_noaction")) {
        symbol = "XXX";
    }
    
    call.setUsername( opts.getUser() );
    call.setPassword( opts.getPassword() );
    
    // useful option for profiling - perhaps we should remove before
    // shipping?
    String countOption = opts.isValueSet('c');
    int count=1;
    if ( countOption != null) {
        count=Integer.valueOf(countOption).intValue();
        System.out.println("Iterating " + count + " times");
    }
    
    Float res = new Float(0.0F);
    for (int i=0; i<count; i++) {
        Object ret = call.invoke(new Object[] {symbol} );
        if (ret instanceof String) {
            System.out.println("Received problem response from server: "+ret);
            throw new AxisFault("", (String)ret, null, null);
        }
        res = (Float) ret;
    }
    
    return res.floatValue();
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:63,代碼來源:GetQuote.java


注:本文中的org.apache.axis.client.Call.setPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。