• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ParameterMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.xml.rpc.ParameterMode的典型用法代码示例。如果您正苦于以下问题:Java ParameterMode类的具体用法?Java ParameterMode怎么用?Java ParameterMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ParameterMode类属于javax.xml.rpc包,在下文中一共展示了ParameterMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createCall

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
/**
 * Creates and returns an RPC SOAP call.
 * 
 * @return an RPC SOAP call
 */
protected Call createCall() throws Exception {
	QName workFlowInputQName = new QName(RPROT_DATA_NAMESPACE,
			"WorkFlowInputType");
	QName workFlowOuputQName = new QName(RPROT_DATA_NAMESPACE,
			"WorkFlowOutputType");

	Service service = new Service();
	Call call = (Call) service.createCall();
	System.out.println("Calling : " + urlString);
	call.setTargetEndpointAddress(new java.net.URL(urlString));

	call.setOperationName("startWorkFlow");

	call.addParameter("parameters", workFlowInputQName, ParameterMode.IN);
	call.setReturnType(workFlowOuputQName, WorkFlowOutputType.class);

	register(call, WorkFlowInputType.class, workFlowInputQName);
	register(call, WorkFlowOutputType.class, workFlowOuputQName);
	return call;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:26,代码来源:TestClient.java


示例2: _get

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
private CacheEntry _get(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException  {
	Service  service = new Service();
    Call     call    = (Call) service.createCall();
    
    call.registerTypeMapping(
            Element.class, 
            element,
            BeanSerializerFactory.class,
            BeanDeserializerFactory.class);
    
    call.setTargetEndpointAddress( new java.net.URL(endpoint) );
    call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));

    call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
    call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
    call.setReturnClass(Element.class);
    call.setReturnQName(element);
    
    return new SoapCacheEntry((Element) call.invoke( new Object[] {cacheName,key } ));
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:21,代码来源:SoapClient.java


示例3: _remove

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
private boolean _remove(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException  {
	Service  service = new Service();
    Call     call    = (Call) service.createCall();
    
    
    call.registerTypeMapping(
            Element.class, 
            element,
            BeanSerializerFactory.class,
            BeanDeserializerFactory.class);
    
    call.setTargetEndpointAddress( new java.net.URL(endpoint) );
    call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));

    call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
    call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
    call.setReturnClass(boolean.class);
    call.setReturnQName(Constants.XSD_BOOLEAN);
  
    return ((Boolean)call.invoke( new Object[] {cacheName,key } )).booleanValue();

}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:23,代码来源:SoapClient.java


示例4: _put

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
private void _put(String cacheName,String method,Element el) throws ServiceException, MalformedURLException, RemoteException  {
   	Service  service = new Service();
       Call     call    = (Call) service.createCall();
       
       el.setResourceUri(endpoint);
       
       call.registerTypeMapping(
               Element.class, 
               element,
               BeanSerializerFactory.class,
               BeanDeserializerFactory.class);
       
       call.setTargetEndpointAddress( new java.net.URL(endpoint) );
       call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
       
       
       call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
       call.addParameter("arg1", element, Element.class, ParameterMode.IN);
       call.setReturnType(Constants.XSD_ANYSIMPLETYPE);
       
       call.invoke( new Object[] {cacheName,el } );
       //call.invokeOneWay(new Object[] {cacheName,el } );
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:24,代码来源:SoapClient.java


示例5: main

import javax.xml.rpc.ParameterMode; //导入依赖的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


示例6: register

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public void register(String registryURL, samples.bidbuy.Service s) 
               throws Exception {
  try {
    Service  service = new Service();
    Call     call    = (Call) service.createCall();

    call.setTargetEndpointAddress( new URL(registryURL) );
    call.setOperationName( new QName("http://www.soapinterop.org/Register", "Register" ));
    call.addParameter("ServiceName", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("ServiceUrl", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("ServiceType", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("ServiceWSDL", XMLType.XSD_STRING, ParameterMode.IN);
    
    call.invoke( new Object[] { s.getServiceName(), s.getServiceUrl(),
                                s.getServiceType(), s.getServiceWsdl() } );
  }
  catch( Exception e ) {
    e.printStackTrace();
    throw e ;
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:v3.java


示例7: unregister

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public void unregister(String registryURL, String name) throws Exception {
  try {
    Service  service = new Service();
    Call     call    = (Call) service.createCall();

    call.setTargetEndpointAddress( new URL(registryURL) );
    call.setOperationName( new QName("http://www.soapinterop.org/Unregister", "Unregister" ));
    call.addParameter( "ServiceName", XMLType.XSD_STRING, ParameterMode.IN);
    call.invoke( new Object[] { name } );
  }
  catch( Exception e ) {
    e.printStackTrace();
    throw e ;
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:v3.java


示例8: requestForQuote

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public double requestForQuote(String serverURL) throws Exception {
    try {

      Service  service = new Service();
      Call     call    = (Call) service.createCall();

      call.setTargetEndpointAddress( new URL(serverURL) );
      call.setOperationName(new QName("http://www.soapinterop.org/Bid", "RequestForQuote") );
      call.setReturnType( XMLType.XSD_DOUBLE );
      call.setUseSOAPAction( true );
      call.setSOAPActionURI( "http://www.soapinterop.org/RequestForQuote" );
      call.addParameter( "ProductName", XMLType.XSD_STRING, ParameterMode.IN);
      call.addParameter( "Quantity", XMLType.XSD_INT, ParameterMode.IN);
      Object r = call.invoke( new Object[] { "widget", new Integer(10) } );

/*
      sd.addOutputParam("RequestForQuoteResult",
                        SOAPTypeMappingRegistry.XSD_DOUBLE);
      sd.addOutputParam("Result",
                        SOAPTypeMappingRegistry.XSD_DOUBLE);
      sd.addOutputParam("return",
                        SOAPTypeMappingRegistry.XSD_DOUBLE);
*/

      // ??? if ( r instanceof Float ) r = ((Float)r).toString();
      if ( r instanceof String ) r = new Double((String) r);
      Double res = (Double) r ;
      return( res.doubleValue() );
    }
    catch( Exception e ) {
      e.printStackTrace();
      throw e ;
    }
  }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:v3.java


示例9: simpleBuy

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public String simpleBuy(String serverURL, int quantity ) throws Exception {
  try {
    Service  service = new Service();
    Call     call    = (Call) service.createCall();

    call.setTargetEndpointAddress( new URL(serverURL) );
    call.setUseSOAPAction( true );
    call.setSOAPActionURI( "http://www.soapinterop.org/SimpleBuy" );
    call.setOperationName( new QName("http://www.soapinterop.org/Bid", "SimpleBuy") );
    call.setReturnType( XMLType.XSD_STRING );
    call.addParameter( "Address", XMLType.XSD_STRING, ParameterMode.IN );
    call.addParameter( "ProductName", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter( "Quantity", XMLType.XSD_INT, ParameterMode.IN );
    
    String res = (String) call.invoke(new Object[] { "123 Main St.",
                                                     "Widget",
                                                     new Integer(quantity)});

    /* sd.addOutputParam("SimpleBuyResult",
                      SOAPTypeMappingRegistry.XSD_STRING);
    sd.addOutputParam("Result",
                      SOAPTypeMappingRegistry.XSD_STRING);
    sd.addOutputParam("return",
                      SOAPTypeMappingRegistry.XSD_STRING); */

    return( res );
  }
  catch( Exception e ) {
    e.printStackTrace();
    throw e ;
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:v3.java


示例10: main

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static void main(String [] args)
{
    try {
        Options options = new Options(args);
        
        String endpointURL = options.getURL();
        String textToSend;
        
        args = options.getRemainingArgs();
        if ((args == null) || (args.length < 1)) {
            textToSend = "<nothing>";
        } else {
            textToSend = args[0];
        }
        
        Service  service = new Service();
        Call     call    = (Call) service.createCall();

        call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
        call.setOperationName( new QName("http://example3.userguide.samples", "serviceMethod") );
        call.addParameter( "arg1", XMLType.XSD_STRING, ParameterMode.IN);
        call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );

        String ret = (String) call.invoke( new Object[] { textToSend } );
        
        System.out.println("You typed : " + ret);
    } catch (Exception e) {
        System.err.println(e.toString());
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:31,代码来源:Client.java


示例11: main

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static void main(String [] args) throws Exception
{
    Options options = new Options(args);
    
    Order order = new Order();
    order.setCustomerName("Glen Daniels");
    order.setShippingAddress("275 Grove Street, Newton, MA");
    
    String [] items = new String[] { "mp3jukebox", "1600mahBattery" };
    int [] quantities = new int [] { 1, 4 };
    
    order.setItemCodes(items);
    order.setQuantities(quantities);
    
    Service  service = new Service();
    Call     call    = (Call) service.createCall();
    QName    qn      = new QName( "urn:BeanService", "Order" );

    call.registerTypeMapping(Order.class, qn,
                  new org.apache.axis.encoding.ser.BeanSerializerFactory(Order.class, qn),        
                  new org.apache.axis.encoding.ser.BeanDeserializerFactory(Order.class, qn));        
    String result;
    try {
        call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
        call.setOperationName( new QName("OrderProcessor", "processOrder") );
        call.addParameter( "arg1", qn, ParameterMode.IN );
        call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );

        result = (String) call.invoke( new Object[] { order } );
    } catch (AxisFault fault) {
        result = "Error : " + fault.toString();
    }
    
    System.out.println(result);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:Client.java


示例12: main

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static void main(String [] args) throws Exception {
    Options options = new Options(args);
    
    String endpoint = "http://localhost:" + options.getPort() +
                      "/axis/Calculator.jws";
    
    args = options.getRemainingArgs();
    
    if (args == null || args.length != 3) {
        System.err.println("Usage: CalcClient <add|subtract> arg1 arg2");
        return;
    }
    
    String method = args[0];
    if (!(method.equals("add") || method.equals("subtract"))) {
        System.err.println("Usage: CalcClient <add|subtract> arg1 arg2");
        return;
    }
    
    Integer i1 = new Integer(args[1]);
    Integer i2 = new Integer(args[2]);

    Service  service = new Service();
    Call     call    = (Call) service.createCall();

    call.setTargetEndpointAddress( new java.net.URL(endpoint) );
    call.setOperationName( method );
    call.addParameter( "op1", XMLType.XSD_INT, ParameterMode.IN );
    call.addParameter( "op2", XMLType.XSD_INT, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_INT );

    Integer ret = (Integer) call.invoke( new Object [] { i1, i2 });
    
    System.out.println("Got result : " + ret);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:CalcClient.java


示例13: main

import javax.xml.rpc.ParameterMode; //导入依赖的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


示例14: main

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
    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 = ServiceFactory.newInstance().createService(null);
    Call    call    = service.createCall();

    call.setTargetEndpointAddress(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);
    if(opts.getUser()!=null)
        call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
    if(opts.getPassword()!=null)
        call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());

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

    System.out.println(symbol + ": " + res);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:GetInfo.java


示例15: validateToken

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static Result validateToken(String remoteAddr, String token) throws ServiceException, RemoteException {
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(url);
    call.setEncodingStyle(nameSpace);//传非字符串类型参数需要明确
    QName qn = new QName(nameSpace, "Result");
    call.setReturnType(qn, Result.class);
    call.registerTypeMapping(Result.class, qn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    call.setOperationName(new QName(nameSpace, "userLogon"));
    call.addParameter("remoteAddr", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("appID", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("token", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("timestamp", XMLType.XSD_LONG, ParameterMode.IN);
    call.addParameter("msgAbstract", XMLType.XSD_STRING, ParameterMode.IN);

    long timestamp = new java.util.Date().getTime();
    String msgBofore = remoteAddr + appID + token + timestamp + key;
    String msg = "";
    Result user = null;
    try {
        byte[] msgByte = java.security.MessageDigest.getInstance("MD5").digest(msgBofore.getBytes());
        msg = bytes2HexString(msgByte);
        user = (Result) call.invoke(new Object[]{remoteAddr, appID, token, timestamp, msg});
    } catch (Exception e) {
        e.printStackTrace();
    }
    return user;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:29,代码来源:IaaaValidation.java


示例16: getSinglePerson

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static Result getSinglePerson(String personID) throws ServiceException, RemoteException {
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(personUrl);
    QName qn = new QName(personNameSpace, "Result");
    call.setReturnType(qn, Result.class);
    call.registerTypeMapping(Result.class, qn, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    call.setOperationName(new QName(personNameSpace, "getSinglePerson"));
    call.addParameter("personID", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("euid", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("personName", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("nameAbbr", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("deptID", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("userType", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("appID", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("appIP", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("messageAbstract", XMLType.XSD_STRING, ParameterMode.IN);
    String msgBofore = personID + "7696baa1fa4ed9679441764a271e556e";
    String msg = "";
    try {
        byte[] msgByte = java.security.MessageDigest.getInstance("MD5").digest(msgBofore.getBytes());
        msg = bytes2HexString(msgByte);
    } catch (Exception e) {
        e.printStackTrace();
    }
    Result user = (Result) call.invoke(new Object[]{personID, "", "", "", "", "", "dvn", "162.105.138.117", msg});
    return user;
}
 
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:28,代码来源:IaaaValidation.java


示例17: getKeysWithExpiryCheckRaw

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
private Object getKeysWithExpiryCheckRaw(String cacheName) throws MalformedURLException, RemoteException, ServiceException {
Service  service = new Service();
Call     call    = (Call) service.createCall();
QName any = new QName("http://www.w3.org/2001/XMLSchema", "anyType[0,unbounded]");
QName string = new QName("http://www.w3.org/2001/XMLSchema", "string");
     
     
     
     call.setTargetEndpointAddress( new java.net.URL(endpoint) );
     call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", "getKeysWithExpiryCheck"));

     call.addParameter("arg0", string, String.class, ParameterMode.IN);
     call.setReturnType(any);
     return call.invoke( new Object[] {cacheName } );
 }
 
开发者ID:lucee,项目名称:Lucee4,代码行数:16,代码来源:SoapClient.java


示例18: main

import javax.xml.rpc.ParameterMode; //导入依赖的package包/类
public static void main(String[] args) {
    try {
//      String endpointURL = " http://cbioqa101.nci.nih.gov:49080/caAdapterWS/ws/caAdapterTransformationService";
//      String endpointURL = " http://cbiovdev5054.nci.nih.gov/caAdapterWS/ws/caAdapterTransformationService";
//        String endpointURL = " http://caadapter-stage.nci.nih.gov/caAdapterWS/ws/caAdapterTransformationService";
//        String endpointURL = " http://caadapter.nci.nih.gov/caAdapterWS/ws/caAdapterTransformationService";
      if (args.length<3)
      {
    	  System.out.println("TestCaadapterWebservice Usage:[scenarioName][cvsString]|[endURL]");
    	  return;
      }
      System.out.println("TestCaadapterWebservice...scenarioName:"+args[0]);
      System.out.println("TestCaadapterWebservice...cvsString:"+args[1]);
      System.out.println("TestCaadapterWebservice...endURL:"+args[2]);

      //read WS paramters
      String scenarioName= args[0];
      String cvsFileName=args[1];
      String csvString =TestCaadapterWebservice.buildCsvString(cvsFileName);
      String endpointURL =args[2];

      //build service call
      Service service = new Service();
      Call call = (Call)service.createCall();
      call.setTargetEndpointAddress(new java.net.URL(endpointURL));
      String methodName = "transformationService";
      call.setOperationName(methodName);
      call.addParameter("parameter_name", XMLType.XSD_STRING,ParameterMode.IN );
      call.addParameter("csvstringname",  XMLType.XSD_STRING, ParameterMode.IN );
      call.setReturnClass(java.util.ArrayList.class);
      ArrayList res = (ArrayList)call.invoke(new Object[]{scenarioName,csvString});
      System.out.println(res);
    }catch(Exception e) {
     	 e.printStackTrace();
    }
 }
 
开发者ID:NCIP,项目名称:caadapter,代码行数:37,代码来源:TestCaadapterWebservice.java


示例19: getQuote

import javax.xml.rpc.ParameterMode; //导入依赖的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


示例20: getQuote2

import javax.xml.rpc.ParameterMode; //导入依赖的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



注:本文中的javax.xml.rpc.ParameterMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InvalidTicketException类代码示例发布时间:2022-05-23
下一篇:
Java FastInfosetReader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap