You need to sign in to do that
Don't have an account?
lopezc
API calls
Hi All,
I have my Force.com IDE created and I would like to create classes that allow me to insert/update /delete data in salesforce database. Should I create just an Apex Class? Is it enough?
Thanks
Cris.
I have my Force.com IDE created and I would like to create classes that allow me to insert/update /delete data in salesforce database. Should I create just an Apex Class? Is it enough?
Thanks
Cris.
Check out the following resources for more information:
Thanks for the docs, but I didn't explain very well what I want or I am trying to do. I would like to use the API in a client application. This application give a new contact with their details in a xml file and I would like to send it in a SOAP message to Salesforce to be able to insert it into my organization'data in Salesforce. I installed SOAPUI for testing but something is not working. I tried to do a loggin and here are the results:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Body>
<urn:login>
<urn:username>username</urn:username>
<urn:password>pwd</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
the response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>No operation available for request {urn:enterprise.soap.sforce.com}login</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I add the Enterprise WSDL to my project in SOAPUI. Sorry if I am talking about different things all the time but I just would like to update Salesforce database from my client application and I don't really know how to do it. I tried also with Java in Eclipse:
But the error is that LoginResult is an invalid Type ( LoginResult loginResult = null; ).
Which library should I import? What I am doing wrong?
Thanks,
Cristina.
Message Edited by lopezc on 06-02-2008 08:25 AM
Message Edited by lopezc on 06-02-2008 08:34 AM
http://www.salesforce.com/us/developer/docs/api/index.htm
the endpoint url I am using for production is http://www.salesforce.com/services/Soap/c12.0
the endpoint I am using for sandbox is https://test.salesforce.com/services/Soap/u/12.0
The error message is still
<faultcode>soapenv:Client</faultcode>
<faultstring>No operation available for request {urn:enterprise.soap.sforce.com}login</faultstring>
Is it connecting to the server? is there probably a problem with my account in test? Why is it working in production?
Thanks
Cris
Message Edited by lopezc on 06-03-2008 03:22 AM
I have also tried to connect to Salesforce through Eclipse. I have created my Dynamic Web project in Eclipse and I am trying now to log into Salesforce. The skeleton of my project contain 3 packages (com.sforce.soap.enterprise, com.sforce.soap.enterprise.fault, com.sforce.soap.enterprise.sobject) and I create my own package where I placed my main function:
package my_code;
import com.sforce.soap.enterprise.*;
public class main {
/**
* @param args
* @return
*/
public static boolean main(String[] args) {
// TODO Auto-generated method stub
LoginResult loginResult = null;
SoapBindingStub sfdc = null;
try {
// Create binding object
sfdc = (SoapBindingStub) new SforceServiceLocator().getSoap();
// login
loginResult = sfdc.login("username", "pwd");
} catch (Exception ex) {
System.out.println("An unexpected error has occurred." + ex.getMessage());
return false;
}
System.out.println("Login was successful.");
.................
However, when I run my project in the server (click right on the main.java and "Run As" and "run on the Server"), Apache return an error message as following:
type Status report
message /Prj1/WEB-INF/classes/my_code/main.java
description The requested resource (/Prj1/WEB-INF/classes/my_code/main.java) is not available.
Should I create this main class?? How I do to log in Salesforce?
thanks
Cris
Now I can access to sandbox!!
I am trying to do exactly the same using Eclipse and using the API calls. I manage to create my client application and log into salesforce. However, for the login call, the parameter always starts with http(s)://www.salesforce.com so I am always logging in salesforce production. I would like to log in Sandbox but I don't know which parameter I have to modify in my web application. How can I modify the endpoint url? where is this parameter initialize per default?
Could you help me in solving this?
Thanks,
Cristina.
Message Edited by lopezc on 06-04-2008 07:43 AM
Thanks
kamalakar rao