Return to Snippet

Revision: 25787
at May 5, 2010 03:18 by alejandrosuch


Updated Code
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.RemoteException;

import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;


private static String webServiceCall(String in0, String in1) throws ServiceException, MalformedURLException, RemoteException {
//---------- IF SECURITY NEEDED
	System.setProperty("javax.net.debug", "ssl");
	System.setProperty("javax.net.ssl.trustStore", "/path/to/truststore");
	System.setProperty("javax.net.ssl.trustStorePassword", "password");
	System.setProperty("javax.net.ssl.keyStoreType", "JKS");
//----------

	Service service = new Service();
	Call call = (Call) service.createCall();
	call.setTargetEndpointAddress(new java.net.URL("https://webserv.pki.gva.es:8443/axis/services/serviciospki"));
	call.setOperationName("getToken");
	call.addParameter("in0", XMLType.XSD_STRING, ParameterMode.IN);
	call.addParameter("in1", XMLType.XSD_STRING, ParameterMode.IN);
	
	return (String) call.invoke(new Object[] { in0, in1});
}

Revision: 25786
at April 9, 2010 01:50 by alejandrosuch


Initial Code
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.RemoteException;

import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;


private static String webServiceCall(String in0, String in1) throws ServiceException, MalformedURLException, RemoteException {
	Service service = new Service();
	Call call = (Call) service.createCall();
	call.setTargetEndpointAddress(new java.net.URL("https://webserv.pki.gva.es:8443/axis/services/serviciospki"));
	call.setOperationName("getToken");
	call.addParameter("in0", XMLType.XSD_STRING, ParameterMode.IN);
	call.addParameter("in1", XMLType.XSD_STRING, ParameterMode.IN);
	
	return (String) call.invoke(new Object[] { in0, in1});
}

Initial URL

                                

Initial Description

                                

Initial Title
Call webservice without creating wsdl2java axis classes

Initial Tags
java

Initial Language
Java