function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CharlesDCharlesD 

Easiest $25 you ever made... just show me how to import Salesforce WSDL with Apache Axis

PLEASE ONLY ONE PERSON HELP ME WITH THIS AT A TIME (unless you don't care about the $25!). I realize I am way over my head with this, but I would really like to see this in action. Again, only one person help at a time, as I only have one $25 Paypal payment to give out! This is where I am at:

1) Installed JDK 1.42
2) Installed Tomcat 4.1 (not sure if this is needed) - verified running on port 8080
3) Installed Apache Axis 1.4 (copied webapp/axis over to Tomcat - again not sure if required)
4) Downloaded Enterprise WSDL from Salesforce and saved to desktop
5) Installed Ant

NOW, I just need to run Java2WSDL and I am STUCK! I realize I probably have to compile this and I am completely lost what to do. I'm not sure if the Enterprise WSDL import is related to this step, but I need help with this too.

Thanks in advance, once I get this running, I will immediately paypal you $25! -Charles


Mysti, Developer DocumentationMysti, Developer Documentation
I can't take any money for this, but here's info from the API guide quickstart chapter to help you:

Instructions for Java Environments (Apache Axis)

Java environments access the API through Java objects that serve as proxies for their server-side counterparts. Before using the API, you must first generate these objects from your organization’s WSDL file.

Each SOAP client has its own tool for this process. For Apache Axis, use the WSDL2Java utility.

Note
Before you run WSDL2Java, you must have Axis installed on your system and all of its component JAR files must be referenced in your classpath.

The basic syntax for WSDL2Java is:

java –classpath pathToJAR/Filename org.apache.axis.wsdl.WSDL2Java -a pathToWsdl/WsdlFilename

The -a switch generates code for all elements, referenced or not, which may be necessary depending on your WSDL. For more information, see the WSDL2Java documentation.

If you have JAR files in more than one location, list them with a semicolon separating the files. For example, if the Axis JAR files are installed in C:\axis-1_3, and the WSDL is named my_enterprise.wsdl and is stored in C:\mywsdls:

java –classpath c:\axis-1_3\lib\axis.jar;c:\axis-1_3\lib\axi-ant.jar;c:\axis-1_3\lib\axis-schema.jar;​c:\axis-1_3\lib\commons-discovery-0.2.jar;c:\axis-1_3\lib\commons-logging-1.0.4.jar;​c:\axis-1_3\lib\jaxrpc.jar;c:\axis-1_3\lib\log4j-1.2.8.jar;c:\axis-1_3\lib\saaj.jar;​c:\axis-1_3\lib\wsdl4j-1.5.2.jar;  org.apache.axis.wsdl.WSDL2Java -a C:\myswdls\my_enterprise.wsdl

This command will generate a set of folders and Java source code files in the same directory in which it was run. After these files are compiled, they can be included in your Java programs for use in creating client applications.

For most Java development environments, you can use wizard-based tools for this process instead of the command line. For more information about using WSDL2Java, see http://ws.apache.org/axis/java/reference.html.

Mysti

JesterJester
No Paypal necessary.  I'm still using Axis 1.1, but the command should be the same.

java -classpath %AXIS_CLASSPATH% org.apache.axis.wsdl.WSDL2Java -p com.sforce.soap.partner -o %APP_HOME%\src %APP_HOME%\resource\partner.wsdl

and I set the AXIS_CLASSPATH like:

set AXIS_CLASSPATH=%APP_HOME_WEB%\lib\axis.jar;%APP_HOME_WEB%\lib\axis-ant.jar;%APP_HOME_WEB%\lib\log4j-1.2.8.jar;%APP_HOME_WEB%\lib\jaxrpc.jar;%APP_HOME_WEB%\lib\saaj.jar;%APP_HOME_WEB%\lib\wsdl4j.jar;%APP_HOME_WEB%\lib\commons-logging.jar;%APP_HOME_WEB%\lib\commons-discovery.jar

APP_HOME is your home director for your project.

I may have an extra jar in there because its for my app, but that should work.

Tomcat et al isn't needed.  If you want to do it through ant, I can find that too, but it sounded like you just wanted to get up and running ASAP.

BradDBradD
Thanks Jester and API Doc'r!

API Doc'r: I did see that, but had no idea what those jars should be (1st jar, 2nd jar, etc.)

Jester: This looks like what I need to do, thanks for clearing this up! If it works I will donate $25 in your name to a charity, how's that!? :)
BradDBradD
Ooops wrong user name... it's Charles... thanks again , I will try this tonight.