org.apache.axis.client.Call类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(1005)

本文整理了Java中org.apache.axis.client.Call类的一些代码示例,展示了Call类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Call类的具体详情如下:
包路径:org.apache.axis.client.Call
类名称:Call

Call介绍

[英]Axis' JAXRPC Dynamic Invocation Interface implementation of the Call interface. This class should be used to actually invoke the Web Service. It can be prefilled by a WSDL document (on the constructor to the Service object) or you can fill in the data yourself.

  1. Standard properties defined by in JAX-RPC's javax..xml.rpc.Call interface:
  2. USERNAME_PROPERTY - User name for authentication
  3. PASSWORD_PROPERTY - Password for authentication
  4. SESSION_PROPERTY - Participate in a session with the endpoint?
  5. OPERATION_STYLE_PROPERTY - "rpc" or "document"
  6. SOAPACTION_USE_PROPERTY - Should SOAPAction be used?
  7. SOAPACTION_URI_PROPERTY - If SOAPAction is used, this is that action
  8. ENCODING_STYLE_PROPERTY - Default is SOAP 1.1: "http://schemas.xmlsoap.org/soap/encoding/"
  9. AXIS properties:
  10. SEND_TYPE_ATTR - Should we send the XSI type attributes (true/false)
  11. TIMEOUT - Timeout used by transport sender in milliseconds
  12. TRANSPORT_NAME - Name of transport handler to use
  13. ATTACHMENT_ENCAPSULATION_FORMAT- Send attachments as MIME the default, or DIME.
  14. CHARACTER_SET_ENCODING - Character set encoding to use for request

[中]Axis的JAXRPC调用接口的动态调用接口实现。此类应用于实际调用Web服务。它可以由WSDL文档(在服务对象的构造函数上)预先填充,也可以自己填充数据

  1. Standard properties defined by in JAX-RPC's javax..xml.rpc.Call interface:
  2. USERNAME_PROPERTY - User name for authentication
  3. PASSWORD_PROPERTY - Password for authentication
  4. SESSION_PROPERTY - Participate in a session with the endpoint?
  5. OPERATION_STYLE_PROPERTY - "rpc" or "document"
  6. SOAPACTION_USE_PROPERTY - Should SOAPAction be used?
  7. SOAPACTION_URI_PROPERTY - If SOAPAction is used, this is that action
  8. ENCODING_STYLE_PROPERTY - Default is SOAP 1.1: "http://schemas.xmlsoap.org/soap/encoding/"
  9. AXIS properties:
  10. SEND_TYPE_ATTR - Should we send the XSI type attributes (true/false)
  11. TIMEOUT - Timeout used by transport sender in milliseconds
  12. TRANSPORT_NAME - Name of transport handler to use
  13. ATTACHMENT_ENCAPSULATION_FORMAT- Send attachments as MIME the default, or DIME.
  14. CHARACTER_SET_ENCODING - Character set encoding to use for request

代码示例

代码示例来源:origin: mx4j/mx4j-tools

  1. public Integer addNotificationListener(ObjectName name, Object filter, Subject delegate) throws InstanceNotFoundException, IOException
  2. {
  3. Call call = createCall();
  4. call.setOperationName(new QName(SOAPConstants.NAMESPACE_URI, "addNotificationListener"));
  5. call.addParameter("observed", qObjectName, ParameterMode.IN);
  6. call.addParameter("filter", XMLType.XSD_ANY, ParameterMode.IN);
  7. call.addParameter("delegate", qSubject, ParameterMode.IN);
  8. call.setReturnType(XMLType.XSD_INT);
  9. return (Integer)call.invoke(new Object[]{name, filter, delegate});
  10. }

代码示例来源:origin: opentripplanner/OpenTripPlanner

  1. Call RTcall = (Call) RTservice.createCall();
  2. RTcall.setTargetEndpointAddress(new java.net.URL(RTendpointURL));
  3. RTcall.setOperationName(new QName("edc.usgs.gov", "processAOI"));
  4. String response = (String) RTcall.invoke(new Object[] { payload });

代码示例来源:origin: stackoverflow.com

  1. Call call = service.createCall();
  2. call.setPortTypeName(portQName);
  3. call.setOperationName(new QName(namespace, operation));
  4. call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY, "http://schemas.xmlsoap.org/soap/encoding/");
  5. call.setProperty(Call.OPERATION_STYLE_PROPERTY, "rpc");
  6. call.addParameter("in0", org.apache.axis.Constants.XSD_STRING ,ParameterMode.IN);
  7. call.addParameter("in1", org.apache.axis.Constants.XSD_STRING ,ParameterMode.IN);
  8. call.setReturnType(serviceQName);
  9. String targetEndpoint = "http://113.160.19.218:8312/axis/services/WeatherForecastTest1";
  10. call.setTargetEndpointAddress(targetEndpoint);
  11. String result = (String) call.invoke(params);
  12. out.println(result);

代码示例来源:origin: OpenNMS/opennms

  1. org.apache.axis.client.Call _call = super._createCall();
  2. if (super.maintainSessionSet) {
  3. _call.setMaintainSession(super.maintainSession);
  4. _call.setUsername(super.cachedUsername);
  5. _call.setPassword(super.cachedPassword);
  6. _call.setTargetEndpointAddress(super.cachedEndpoint);
  7. _call.setTimeout(super.cachedTimeout);
  8. _call.setPortName(super.cachedPortName);
  9. java.util.Enumeration keys = super.cachedProperties.keys();
  10. while (keys.hasMoreElements()) {
  11. java.lang.String key = (java.lang.String) keys.nextElement();
  12. _call.setProperty(key, super.cachedProperties.get(key));
  13. _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  14. _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
  15. for (int i = 0; i < cachedSerFactories.size(); ++i) {
  16. java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
  17. javax.xml.namespace.QName qName =
  18. (javax.xml.namespace.QName) cachedSerQNames.get(i);
  19. java.lang.Object x = cachedSerFactories.get(i);
  20. if (x instanceof Class) {
  21. java.lang.Class df = (java.lang.Class)

代码示例来源:origin: uk.org.mygrid.feta/feta-engine

  1. org.apache.axis.client.Call _call = super._createCall();
  2. if (super.maintainSessionSet) {
  3. _call.setMaintainSession(super.maintainSession);
  4. _call.setUsername(super.cachedUsername);
  5. _call.setPassword(super.cachedPassword);
  6. _call.setTargetEndpointAddress(super.cachedEndpoint);
  7. _call.setTimeout(super.cachedTimeout);
  8. _call.setPortName(super.cachedPortName);
  9. java.util.Enumeration keys = super.cachedProperties.keys();
  10. while (keys.hasMoreElements()) {
  11. java.lang.String key = (java.lang.String) keys.nextElement();
  12. _call.setProperty(key, super.cachedProperties.get(key));

代码示例来源:origin: OpenNMS/opennms

  1. _call.setOperation(_operations[0]);
  2. _call.setUseSOAPAction(true);
  3. _call.setSOAPActionURI("HPD_IncidentInterface_WS/HelpDesk_Query_Service");
  4. _call.setEncodingStyle(null);
  5. _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
  6. _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  7. _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  8. _call.setOperationName(new javax.xml.namespace.QName("", "HelpDesk_Query_Service"));
  9. try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {parameters, ARAuthenticate});

代码示例来源:origin: OpenNMS/opennms

  1. _call.setOperation(_operations[9]);
  2. _call.setUseSOAPAction(true);
  3. _call.setSOAPActionURI("http://opennms.org/integration/otrs/ticketservice#ArticleGetAllByTicketNumber");
  4. _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  5. _call.setOperationName(new javax.xml.namespace.QName("http://opennms.org/integration/otrs/ticketservice", "ArticleGetAllByTicketNumber"));
  6. try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {new java.lang.Long(ticketNumber), request_header});

代码示例来源:origin: org.apache.juddi.scout/scout

  1. call.setTargetEndpointAddress(endpointURL.toURL());
  2. Vector result = (Vector)call.invoke(soapBodies);
  3. if (result.size() > 0 ) {
  4. response = ((SOAPBodyElement)result.elementAt(0)).getAsString();
  5. Message msg = call.getResponseMessage();
  6. response = msg.getSOAPEnvelope().getFirstBody().getAsString();

代码示例来源:origin: org.astrogrid/astrogrid-registry-server

  1. Vector result = (Vector) callObj.invoke
  2. (new Object[] {sbeRequest});
  3. if(result.size() > 0) {
  4. SOAPBodyElement sbe = (SOAPBodyElement) result.get(0);
  5. Document soapDoc = sbe.getAsDocument();
  6. NodeList nl = soapDoc.getElementsByTagNameNS("*","setSpec");

代码示例来源:origin: org.apache.axis/axis

  1. /**
  2. * prefill as much info from the WSDL as it can.
  3. * Right now it's target URL, SOAPAction, Parameter types,
  4. * and return type of the Web Service.
  5. *
  6. * If wsdl is not present, this function set port name and operation name
  7. * and does not modify target endpoint address.
  8. *
  9. * Note: Not part of JAX-RPC specification.
  10. *
  11. * @param portName PortName in the WSDL doc to search for
  12. * @param opName Operation(method) that's going to be invoked
  13. */
  14. public void setOperation(QName portName, String opName) {
  15. setOperation(portName, new QName(opName));
  16. }

代码示例来源:origin: axis/axis

  1. call.setUseSOAPAction( true);
  2. call.setSOAPActionURI( "urn:AdminService");
  3. result = (Vector) call.invoke( params );
  4. if (result == null || result.isEmpty()) {
  5. throw new AxisFault(Messages.getMessage("nullResponse00"));
  6. SOAPBodyElement body = (SOAPBodyElement) result.elementAt(0);
  7. return body.toString();
  8. } finally {

代码示例来源:origin: stackoverflow.com

  1. try {
  2. if (wsEndPoint == null || wsEndPoint.trim().length() == 0 || wsNAME == null || wsNAME.trim().length() == 0 ||
  3. id == null || id.trim().length() == 0 || code == null || code.trim().length() == 0) {
  4. retVal = "Error: mandatory parameter missing.";
  5. } else {
  6. Service service = new Service();
  7. Call call = (Call)service.createCall();
  8. call.setTargetEndpointAddress(new java.net.URL(wsEndPoint));
  9. call.setOperationName(new QName("http://service.name.it/", wsNAME));
  10. call.addParameter(new QName("http://service.name.it/", "arg0"), new QName("http://www.w3.org/2001/XMLSchema", "string"), ParameterMode.IN);
  11. call.addParameter(new QName("http://service.name.it/", "arg1"), new QName("http://www.w3.org/2001/XMLSchema", "string"), ParameterMode.IN);
  12. call.setSOAPActionURI("");
  13. call.setEncodingStyle(null);
  14. call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);
  15. call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  16. retVal = ((String)call.invoke(new Object[] {id, code})).trim();
  17. }
  18. } catch (Exception e) {
  19. retVal = String.format("Error: %s.", e.getMessage());

代码示例来源:origin: OpenNMS/opennms

  1. public void ticketStateUpdate(org.opennms.integration.otrs.ticketservice.TicketStateUpdate ticketStateUpdate, org.opennms.integration.otrs.ticketservice.Credentials request_header) throws java.rmi.RemoteException {
  2. if (super.cachedEndpoint == null) {
  3. throw new org.apache.axis.NoEndPointException();
  4. }
  5. org.apache.axis.client.Call _call = createCall();
  6. _call.setOperation(_operations[5]);
  7. _call.setUseSOAPAction(true);
  8. _call.setSOAPActionURI("http://opennms.org/integration/otrs/ticketservice#TicketStateUpdate");
  9. _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  10. _call.setOperationName(new javax.xml.namespace.QName("http://opennms.org/integration/otrs/ticketservice", "TicketStateUpdate"));
  11. setRequestHeaders(_call);
  12. setAttachments(_call);
  13. _call.invokeOneWay(new java.lang.Object[] {ticketStateUpdate, request_header});
  14. }

代码示例来源:origin: uk.org.mygrid.feta/feta-engine

  1. _call.setOperation(_operations[0]);
  2. _call.setEncodingStyle(null);
  3. _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
  4. _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
  5. _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
  6. _call.setOperationName(new javax.xml.namespace.QName("http://mygrid.org.uk/2004/FETA", "inquire"));
  7. try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {searchRequest});

代码示例来源:origin: org.apache.kalumet/org.apache.kalumet.common

  1. public SimplifiedFileObject[] browse( String path )
  2. throws ClientException
  3. {
  4. call.registerTypeMapping( SimplifiedFileObject.class,
  5. new QName( "http://kalumet.apache.org", "SimplifiedFileObject" ),
  6. BeanSerializerFactory.class, BeanDeserializerFactory.class );
  7. SimplifiedFileObject[] children = null;
  8. try
  9. {
  10. children = ( (SimplifiedFileObject[]) call.invoke( "browse", new Object[]{ path } ) );
  11. }
  12. catch ( Exception e )
  13. {
  14. throw new ClientException( "Can't browse " + path, e );
  15. }
  16. return children;
  17. }

代码示例来源:origin: stackoverflow.com

  1. public final class WSUtils {
  2. public static void handleSerialization(Call call, String ns, String bean, Class cl) {
  3. QName qn = new QName(ns, bean);
  4. call.registerTypeMapping(cl, qn,
  5. new BeanSerializerFactory(cl, qn),
  6. new BeanDeserializerFactory(cl, qn));
  7. }
  8. }

代码示例来源:origin: org.n52.metadata/smarteditor-api

  1. SOAPBodyElement[] input = new SOAPBodyElement[1];
  2. input[0] = new SOAPBodyElement(lDoc.getDocumentElement());
  3. Vector vec = (Vector) mCall.invoke(input);
  4. SOAPBodyElement elemResp = (SOAPBodyElement) vec.get(0);
  5. lResponse = elemResp.getAsDocument();
  6. } catch (ParserConfigurationException e) {

代码示例来源:origin: stackoverflow.com

  1. import org.apache.axis.client.Call;
  2. import org.apache.axis.client.Service;
  3. import org.apache.axis.encoding.XMLType;
  4. import javax.xml.rpc.ParameterMode;
  5. public class axisClient {
  6. public static void main(String [] args) throws Exception {
  7. String endpoint = "http://localhost:8090/archive_name/service_name.jws";
  8. Service service = new Service();
  9. Call call = (Call) service.createCall();
  10. call.setTargetEndpointAddress( new java.net.URL(endpoint) );
  11. call.setOperationName( "service_method_name" );
  12. call.addParameter("parameter_name", XMLType.XSD_STRING, ParameterMode.IN );
  13. call.setReturnType( XMLType.XSD_STRING );
  14. call.setProperty(Call.CHARACTER_SET_ENCODING, "UTF-8");
  15. String jsonString = (String) call.invoke( new Object [] { "parameter_value"});
  16. System.out.println("Got result : " + jsonString);
  17. }
  18. }

代码示例来源:origin: org.apache.openejb/openejb-axis

  1. public void prepareCall(final Call call) {
  2. call.setOperation(operationDesc);
  3. call.setUseSOAPAction(useSOAPAction);
  4. call.setSOAPActionURI(soapActionURI);
  5. call.setSOAPVersion(soapVersion);
  6. call.setOperationName(operationName);
  7. //GAH!!!
  8. call.setOperationStyle(operationDesc.getStyle());
  9. call.setOperationUse(operationDesc.getUse());
  10. }

代码示例来源:origin: net.sf.taverna.t2.activities/biomoby-activity-ui

  1. private String doCall(String method, Object[] parameters)
  2. throws MobyException {
  3. Call call = null;
  4. try {
  5. Service service = new Service();
  6. call = (Call) service.createCall();
  7. call.setTargetEndpointAddress(REGISTRY_URL);
  8. call.setTimeout(new Integer(0));
  9. call.setSOAPActionURI(REGISTRY_URI + "#" + method);
  10. return resultToString(call.invoke(REGISTRY_URI, method, parameters));
  11. } catch (AxisFault e) {
  12. throw new MobyException(REGISTRY_URL.toString()
  13. + (call == null ? "" : call.getOperationName()), e);
  14. } catch (Exception e) {
  15. throw new MobyException(e.toString(), e);
  16. }
  17. }

相关文章