當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。