forcedotcom/wsc

Help with import after building the .jar

snoopgr2 opened this issue · 1 comments

Hi, I built the .jar following the instructions and I get a clean build. I placed the .jar file in my java repository.

In my pom.xml I added the following :

    <dependency>
        <groupId>com.sforce</groupId>
        <artifactId>sample</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>//Users/[?????]/.m2/repository/com/sforce/salesforceapi.jar</systemPath>
    </dependency>

So far, so good.

after mvn clean install, I am trying to import the libraries as per the example:

import com.sforce.soap.partner.;
import com.sforce.soap.partner.sobject.
;
import com.sforce.ws.*;

I only get import com.sforce.soap.enterprise.*; to work. com.sforce.ws and com.sforce.soap.partner libraries are not available. What am I doing wrong?

Ooook. So I missed the first half of the instructions. Or at least didn't understand that the file generated by
git clone https://github.com/forcedotcom/wsc.git
mvn clean package

Needed to be run in the wsc folder AND would need to be installed via Maven into my maven repository.

Also didn't realize that Salesforce offers both an Enterprise and a Partner option on their Settings/API webpage. I recreated the .jar using the output of the SF Partner wsdl file, installed the .jar to Maven and things are now mostly working.

I have an connection refused error but I will keep looking into that. I just wanted to post this extra info for any one else who might not be familiar with Java and Maven.