Problem Statement:

How to generate client jar file for custom salesforce WSDL

Pre-requisite:

  1. MVN Setup
  2. JDK Setup
  3. WSC Connector jar

Solution:

Run below command,

C:\SalesForce\wsc>java -cp c:/SalesForce/wsc/tools.jar;c:/SalesForce/wsc/target/force-wsc-40.0.0-uber.jar com.sforce.ws.tools.wsdlc AccountHandler.wsdl myjar.jar

explanation:

  • Java is set on path
  • -cp is to set classpath
  • tools.jar is copied from <JAVA_HOME>/libs
  • 40.0.0-uber.jar is copied from WSC Connector folder (versions may vary, name could be like xxx-uber.jar)
  • com.sforce.ws.tools.wsdlc is client class generator for WSDL
  • handler.wsdl is custom wsdl downloaded from Salesforce
  • myjar.jar is output file name
Advertisements