当前位置: 首页>>代码示例>>Java>>正文


Java Call.setUseSOAPAction方法代码示例

本文整理汇总了Java中org.apache.axis.client.Call.setUseSOAPAction方法的典型用法代码示例。如果您正苦于以下问题:Java Call.setUseSOAPAction方法的具体用法?Java Call.setUseSOAPAction怎么用?Java Call.setUseSOAPAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis.client.Call的用法示例。


在下文中一共展示了Call.setUseSOAPAction方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WMLS_GetBaseMsg

import org.apache.axis.client.Call; //导入方法依赖的package包/类
public String WMLS_GetBaseMsg(short returnValueIn) throws RemoteException {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    Call _call = createCall();
    _call.setOperation(_operations[2]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("http://www.witsml.org/action/120/Store.WMLS_GetBaseMsg");
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new QName("http://www.witsml.org/message/120", "WMLS_GetBaseMsg"));

    setRequestHeaders(_call);
    setAttachments(_call);
    Object _resp = _call.invoke(new Object[]{returnValueIn});

    if (_resp instanceof RemoteException) {
        throw (RemoteException) _resp;
    } else {
        extractAttachments(_call);
        try {
            return (String) _resp;
        } catch (Exception _exception) {
            return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
        }
    }
}
 
开发者ID:hashmapinc,项目名称:witsml-client,代码行数:27,代码来源:StoreSoapBindingStub.java

示例2: WMLS_GetVersion

import org.apache.axis.client.Call; //导入方法依赖的package包/类
public String WMLS_GetVersion() throws RemoteException {
    if (super.cachedEndpoint == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    Call _call = createCall();
    _call.setOperation(_operations[5]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("http://www.witsml.org/action/120/Store.WMLS_GetVersion");
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new QName("http://www.witsml.org/message/120", "WMLS_GetVersion"));

    setRequestHeaders(_call);
    setAttachments(_call);
    Object _resp = _call.invoke(new Object[]{});

    if (_resp instanceof RemoteException) {
        throw (RemoteException) _resp;
    } else {
        extractAttachments(_call);
        try {
            return (String) _resp;
        } catch (Exception _exception) {
            return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
        }
    }
}
 
开发者ID:hashmapinc,项目名称:witsml-client,代码行数:27,代码来源:StoreSoapBindingStub.java

示例3: ping

import org.apache.axis.client.Call; //导入方法依赖的package包/类
public Boolean ping(String serverURL) 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/Ping" );
    call.setOperationName( new QName("http://www.soapinterop.org/Bid", "Ping" ));
    call.invoke( (Object[]) null );
    return( new Boolean(true) );
  }
  catch( Exception e ) {
    e.printStackTrace();
    throw e ;
  }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:v3.java

示例4: requestForQuote

import org.apache.axis.client.Call; //导入方法依赖的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

示例5: simpleBuy

import org.apache.axis.client.Call; //导入方法依赖的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

示例6: doTest

import org.apache.axis.client.Call; //导入方法依赖的package包/类
/**
 * Send a hardcoded message to the server, and print the response.
 *
 * @param args the command line arguments (mainly for specifying URL)
 * @param op an optional service argument, which will be used for
 * specifying the transport-level service
 */
public static String doTest (String args[], String op) throws Exception {
  Options      opts    = new Options( args );
  String       url     = opts.getURL();
  String       action  = "EchoService" ;
    
  if (op != null) action = op;

  args = opts.getRemainingArgs();
  if ( args != null ) action = args[0];

  InputStream   input   = new ByteArrayInputStream(msg.getBytes());
  Service       service = new Service();
  Call          call    = (Call) service.createCall();
  SOAPEnvelope  env     = new SOAPEnvelope(input);

  call.setTargetEndpointAddress( new URL(url) );
  if (action != null) {
      call.setUseSOAPAction( true );
      call.setSOAPActionURI( action );
  }

  System.out.println( "Request:\n" + msg );

  env = call.invoke( env );

  System.out.println( "Response:\n" + env.toString() );
  return( env.toString() );
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:TestClient.java

示例7: prepareCall

import org.apache.axis.client.Call; //导入方法依赖的package包/类
public void prepareCall(Call call) {
    call.setOperation(operationDesc);
    call.setUseSOAPAction(useSOAPAction);
    call.setSOAPActionURI(soapActionURI);
    call.setSOAPVersion(soapVersion);
    call.setOperationName(operationName);
    //GAH!!!
    call.setOperationStyle(operationDesc.getStyle());
    call.setOperationUse(operationDesc.getUse());
}
 
开发者ID:apache,项目名称:tomee,代码行数:11,代码来源:OperationInfo.java

示例8: 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

示例9: buy

import org.apache.axis.client.Call; //导入方法依赖的package包/类
public String buy(String serverURL, int quantity, int numItems, double price)
    throws Exception
{
  try {
    int      i ;

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

    call.setTargetEndpointAddress( new URL(serverURL) );
    call.setUseSOAPAction( true );
    call.setSOAPActionURI( "http://www.soapinterop.org/Buy" );
    call.setReturnType( XMLType.XSD_STRING );

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


    // register the PurchaseOrder class
    QName poqn = new QName("http://www.soapinterop.org/Bid", "PurchaseOrder");
    Class cls = PurchaseOrder.class;
    call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    // register the Address class
    QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
    cls = Address.class;
    call.registerTypeMapping(cls, aqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    // register the LineItem class
    QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
    cls = LineItem.class;
    call.registerTypeMapping(cls, liqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    LineItem[]     lineItems = new LineItem[numItems];
    
    
    for ( i = 0 ; i < numItems ; i++ )
      lineItems[i] = new LineItem("Widget"+i,quantity,new BigDecimal(price));

    PurchaseOrder  po = new PurchaseOrder( "PO1",
                                           Calendar.getInstance(),
                                           new Address("Mr Big",
                                                       "40 Wildwood Lane",
                                                       "Weston",
                                                       "CT",
                                                       "06883"),
                                           new Address("Mr Big's Dad",
                                                       "40 Wildwood Lane",
                                                       "Weston",
                                                       "CT",
                                                       "06883"),
                                           lineItems );

    call.addParameter( "PO", poqn, ParameterMode.IN );
    call.setOperationName( new QName("http://www.soapinterop.org/Bid", "Buy") );

    String res = (String) call.invoke( new Object[] { po } );

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

示例10: main

import org.apache.axis.client.Call; //导入方法依赖的package包/类
/**
 * Main entry point.  Tests a variety of echo methods and reports
 * on their results.
 *
 * Arguments are of the form:
 *   -h localhost -p 8080 -s /soap/servlet/rpcrouter
 */
public static void main(String args[]) throws Exception {
    // set up the call object
    Options opts = new Options(args);
    service = new Service();
    call = (Call) service.createCall();
    call.setTargetEndpointAddress( new URL(opts.getURL()) );
    call.setUseSOAPAction(true);
    call.setSOAPActionURI("http://www.soapinterop.org/Bid");

    // register the PurchaseOrder class
    QName poqn = new QName("http://www.soapinterop.org/Bid",
                           "PurchaseOrder");
    Class cls = PurchaseOrder.class;
    call.registerTypeMapping(cls, poqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    // register the Address class
    QName aqn = new QName("http://www.soapinterop.org/Bid", "Address");
    cls = Address.class;
    call.registerTypeMapping(cls, aqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    // register the LineItem class
    QName liqn = new QName("http://www.soapinterop.org/Bid", "LineItem");
    cls = LineItem.class;
    call.registerTypeMapping(cls, liqn, BeanSerializerFactory.class, BeanDeserializerFactory.class);

    try {
        // Default return type based on what we expect
        call.setOperationName( new QName("http://www.soapinterop.org/Bid", "Buy" ));
        call.addParameter( "PO", poqn, ParameterMode.IN );
        call.setReturnType( XMLType.XSD_STRING );

        LineItem[] li = new LineItem[2];
        li[0] = new LineItem("Tricorder", 1, "2500.95");
        li[1] = new LineItem("Phasor", 3, "7250.95");

        PurchaseOrder po = new PurchaseOrder(
          "NCC-1701",
          Calendar.getInstance(),
          new Address("Sam Ruby", "Home", "Raleigh", "NC", "27676"),
          new Address("Lou Gerstner", "Work", "Armonk", "NY", "15222"),
          li
        );

        // issue the request
        String receipt = (String) call.invoke( new Object[] {po} );

        System.out.println(receipt);
    } catch (Exception e) {
       System.out.println("Buy failed: " + e);
        throw e;
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:60,代码来源:TestClient.java


注:本文中的org.apache.axis.client.Call.setUseSOAPAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。