Hi,
I am mentioning the source code to generate the .class files from wsdl using Apache Axis jar files.
I am using the salesforce wsdl file. Creating the class files procedure will not change for other wsdl files when using apache axis.
There are two ways to generate the .class files one is using apache axis and other is using the sforce.ws.tools.
I . Generate java .class files using apache axis.
- Jar files required
- axis.jar;
- axis-ant.jar;
- commons-discovery-0.2.jar;
- commons-logging-1.0.4.jar;
- dsn.jar;
- imap.jar;
- jaxrpc.jar;
- log4j-1.2.8.jar;
- mailapi.jar;
- pop3.jar;
- saaj.jar;
- smtp.jar;
- wsdl4j-1.5.1.jar
2. Save all the jar files in the folder location where you want to generate the .class files and set the classpath of the jar files in the environment variables.
3. Save the wsdl file from salesforce API ( you can select partner/enterprise based on requirement).
4. open the cmd prompt and change the directory where the .jar files are located.
5. execute the below command
java -classpath axis.jar;axis-ant.jar;commons-discovery-0.2.jar;commons-logging-1.0.4.jar;dsn.jar;imap.jar;jaxrpc.jar;log4j-1.2.8.jar;mailapi.jar;pop3.jar;saaj.jar;smtp.jar;wsdl4j-1.5.1.jar org.apache.axis.wsdl.WSDL2Java -a enterprise.wsdl.
Please comment if you are getting any error messages in the procedure.
I have compiled this using java 1.8 version.
No comments:
Post a Comment