当前位置: 首页>>代码示例>>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;未经允许,请勿转载。