URL enpoint = new URL("http://alsb3-soa:80/Numero"); Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(enpoint);
Service service = new Service(); Call call = (Call) service.createCall(); String endpoint ="URL of the WSDL"; call.setTargetEndpointAddress(new URL(endpoint)); call.setOperationName(new QName("webservice method name")); //input parameter type call.addParameter("op1", XMLType.XSD_STRING, ParameterMode.IN); //output parameter type call.setReturnType(XMLType.XSD_STRING); //call web service and return string call.invoke(new Object[] { new String("parameter")});
try { String endpoint ="http://RequestUrl"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); QName q = new QName ("http://Url", "FrsFileSoapDO"); // step 1 BeanSerializerFactory bsf = new BeanSerializerFactory(FrsFileSoapDO.class,q); // step 2 BeanDeserializerFactory bdf = new BeanDeserializerFactory(FrsFileSoapDO.class,q); // step 3 call.registerTypeMapping(FrsFileSoapDO.class,q, bsf, bdf); //step 4 call.setOperationName(new QName(endpoint, "getFrsFileData")); FrsFileSoapDO s = (FrsFileSoapDO) call.invoke(new Object[] { "24BB7","frs1001" } ); System.out.println(s.getFilename()); }
Service service = new Service(); Call call = (Call) service.createCall(); QName q = new QName("http://rpc.xml.coldfusion", "QueryBean"); BeanSerializerFactory bsf = new BeanSerializerFactory(QueryBean.class, q); // step 2 BeanDeserializerFactory bdf = new BeanDeserializerFactory(QueryBean.class, q); // step 3 call.registerTypeMapping(QueryBean.class, q, bsf, bdf); //step 4 call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName(endpoint, "getReportContent")); QueryBean bean = (QueryBean) call.invoke( new Object[] { "142", "5088721" });
public class AxisClient { public static void main(String[] args) throws Exception { String endPoint = "http://localhost:8080/StudentServiceImplService/StudentServiceImpl"; Service service2 = new Service(); Call call2 = (Call) service2.createCall(); call2.setTargetEndpointAddress(new java.net.URL(endPoint)); call2.setOperationName(new QName("http://services.tuto.java.com/","getStudents")); call2.setReturnType(new QName("","student"), Student.class); call2.setReturnType(new QName("", "student")); call2.registerTypeMapping(Student.class, new QName("", "student"), null,new BeanDeserializerFactory(Student.class, new QName("", "student"))); List<Student> students = (List<Student>) call2.invoke(new Object[0]); for (Student student : students) { System.out.println(student); } } }
try { if (wsEndPoint == null || wsEndPoint.trim().length() == 0 || wsNAME == null || wsNAME.trim().length() == 0 || id == null || id.trim().length() == 0 || code == null || code.trim().length() == 0) { retVal = "Error: mandatory parameter missing."; } else { Service service = new Service(); Call call = (Call)service.createCall(); call.setTargetEndpointAddress(new java.net.URL(wsEndPoint)); call.setOperationName(new QName("http://service.name.it/", wsNAME)); call.addParameter(new QName("http://service.name.it/", "arg0"), new QName("http://www.w3.org/2001/XMLSchema", "string"), ParameterMode.IN); call.addParameter(new QName("http://service.name.it/", "arg1"), new QName("http://www.w3.org/2001/XMLSchema", "string"), ParameterMode.IN); call.setSOAPActionURI(""); call.setEncodingStyle(null); call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); retVal = ((String)call.invoke(new Object[] {id, code})).trim(); } } catch (Exception e) { retVal = String.format("Error: %s.", e.getMessage());
String endpoint = "http://localhost:8080/eCWServices/StructSpeech/StructSpeech"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName("http://ejb.ecw.com/", "parseNotes")); call.addParameter("notes", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.addParameter("apuId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.addParameter("providerId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.SOAP_MAP); HashMap ret = (HashMap) call.invoke(new Object[]{"","",""}); System.out.println("Sent 'Hello!', got '" + ret + "'");
public static void main(String[] args) throws MalformedURLException, RemoteException, ServiceException { String endpoint = "http://www.mobilefish.com/services/web_service/countries.php?wsdl"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName( "countryInfoByIana" ); call.addParameter( "ianacode", XMLType.XSD_STRING, ParameterMode.IN ); call.setReturnType(XMLType.SOAP_ARRAY); Object _resp = call.invoke( new Object [] { "us" }); Object[] objetoArray = (Object[]) _resp; for(int i = 0; i< objetoArray.length; i++){ System.out.println( objetoArray[ i ] ); } }
InputStream input = new ByteArrayInputStream(apiBody.getBytes()); Service service = new Service(); Call call = (Call) service.createCall(); SOAPEnvelope soapEnvelope = new SOAPEnvelope(input); call.setTargetEndpointAddress(new URL(apiUrl)); call.setUseSOAPAction(true); if(StringUtils.isNotEmpty(actionURI)){ call.setSOAPActionURI(actionURI); } soapEnvelope = call.invoke(soapEnvelope); return soapEnvelope.toString();
Call call = (Call) service.createCall();
import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; import javax.xml.rpc.ParameterMode; public class axisClient { public static void main(String [] args) throws Exception { String endpoint = "http://localhost:8090/archive_name/service_name.jws"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName( "service_method_name" ); call.addParameter("parameter_name", XMLType.XSD_STRING, ParameterMode.IN ); call.setReturnType( XMLType.XSD_STRING ); call.setProperty(Call.CHARACTER_SET_ENCODING, "UTF-8"); String jsonString = (String) call.invoke( new Object [] { "parameter_value"}); System.out.println("Got result : " + jsonString); } }
Call call=(Call)service.createCall();
Call call = (Call)service.createCall(); call.setTargetEndpointAddress(mHostAddr);