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
dongdong 

Does salesforce provide API for java?

I am quite new to salesforce development.  I wonder if salesforce provides API for java ?  Namely, it provides some jar files which I can add them into project build path, and then  I can call some method by this API ?  
noedskovnoedskov
Hi dong,

There is a salesforce API which is a SOAP API. Two versions exists of this API. One is the partner API (used by salesforce.com partners) and the other is the enterprise API which is available for everyone with a salesforce enterprise license.

In our company we use the enterprise API and I must say it is very nice to work with. And, if you have ever worked with a SOAP API before I'm sure you will find it quite easy as well. You simply download the WSDL file and generate the client source code and you're ready to go!

/Søren Nødskov Hansen
dongdong
Hi Hansen,
  Thank you for you kindly reply. Well , may I ask you another question?  I just downloaded a  WSDL file (enterprise.wsdl) from salesforce  and  installed axis at c:\axis-1_4 , and I added all the jar files  of  axis into  system's classpath.
Later, I run : java org.apache.axis.wsdl.WSDL2Java -o   enterprise.wsdl  
System prompted the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
 at org.apache.axis.encoding.DefaultTypeMappingImpl.initMappings(DefaultTypeMappingImpl.java:119)
 at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMappingImpl.java:91)
   ...................................................................................................................................................
   ....................................................................................................................................................
   at org.apache.axis.wsdl.toJava.Emitter.<init>(Emitter.java:144)
   at org.apache.axis.wsdl.WSDL2Java.createParser(WSDL2Java.java:209)
   at org.apache.axis.wsdl.gen.WSDL2.<init>(WSDL2.java:96)
   at org.apache.axis.wsdl.WSDL2Java.<init>(WSDL2Java.java:194)
   at org.apache.axis.wsdl.WSDL2Java.main(WSDL2Java.java:371)\
 
why it can not generate the client source?
 
dongdong
Hi Hansen,
   I solved the of "SOAPException"  , just added saaj-api-1.3.jar into my classpath then it worked!
 
Thank you!!
 
 
 
kamalkamal
Hi Dong,

you can use eclipse IDE to generate the stub for enterprise or partner wsdl. There are lot of plugins avaliable to convert wsdl to java..make sure that all the jar files in the lib folder of axis.war(in the axis distribution ) are in classpath .......

The following jar files should be in the classpath of the project.

axis.jar
axi-ant.jar
axis-schema.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
jaxrpc.jar
log4j-1.2.8.jar
saaj.jar
wsdl4j-1.5.2.jar
thanks
D.kamalakar rao