This is a java program which i need to run facing compilation error
Its consuming a third party web service method
I have the supported files(folder) which contain necessary class files org/apache/axis
The following is what i need to do but am unable to do
////////////////////////////////////////////////////////////////////////////////////////////
set classpath where the below jars are located....
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
saaj.jar
wsdl4j.jar
I have the above jars
Run the below command
java org.apache.axis .wsdl.WSDL2Java <URL>.wsdl
Sample:
1) Setting Classpath:
a) AXISPATH = The path where all the below specifed jars are available.
b) %AXISPATH%axis. jar;%AXISPATH%c ommons-discovery.jar;% AXISPATH%common s-logging.jar;%AX ISPATH%wsdl4j.j ar;%AXISPATH%ja xrpc.jar;%AXISP ATH%saaj.jar;
Command to Execute[In console]:
c:\user>java org.apache.axis .wsdl.WSDL2Java http://************************************?wsdl
After executing the above command you can find the output java files under c:\user dir
/////////////////////////////////////////////////////////////////////////////////////////////
Also not correctly understanding where and how to set classpath while running the program
JAVA Source Code
import org.apache.axis .client.Call;
import org.apache.axis .client.Service ;
import javax.xml.names pace.QName;
public class UserRegistratio n
{
public static void main(String [] args)
{
String endpoint = "http://1.1.1.1/..............T he URL";
Service service = new Service();
String methodName="Tes t";
Call call = (Call)service.c reateCall();
call.setTargetE ndpointAddress( new java.net.URL(en dpoint) );
call.setOperati onName(new QName(methodNam e));
call.setPropert y(Call.USERNAME _PROPERTY, "testcheck" );
call.setPropert y(Call.PASSWORD _PROPERTY, "testcheck" );
String req = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><TestObjec t user=\"Test1\" password=\"Test 2\" />";
System.out.prin tln ("Invoked Operation : " + methodName);
System.out.prin tln ("End Point : " + endpoint);
Object ret = call.invoke( new Object[] {req} );
System.out.prin tln (ret);
}
}