Connecting to SalesForce bulk API using C?

For the login part, just download and import the partner WSDL and use the generated web service client. Otherwise, you'll want to update your code to read the response when it gets a 500 status code (the SOAP spec requires fault messages to use a 500 status code), the response body will give you more clues to the problem. I'd expect in this case you're getting an identity confirmation error, and you'll need to provide your api security token in addition to your password in the login request.

As soon as .GetResponse() is called it sends me down to my catch block with the generic 500 exception, which has no InnerException. – Adam Dec 1 '10 at 18:46 WebException includes a Response property which you can use to access the response in the exception case. – superfell Dec 1 '10 at 19:37 Thanks for the suggestion!

Now when I examine the response I get the following fault message: "The SOAP request must use SOAP 1.1, did not recieve a SOAP 1.1 Envelope as the document root". I'm not really experienced in using SOAP, so would you happen to see anything in the code I posted above that would account for this issue? – Adam Dec 2 '10 at 21:19 Again, I would recommend you import the WSDL and use the generated code, rather than building it by hand.

– superfell Dec 2 '10 at 21:21 but won't I be facing the same issue when I go to make the other REST API calls like creating a job or a batch? – Adam Dec 2 '10 at 22:08.

Generate the XML file to salesforce login username password + token use the following c# code for login to salesforce XmlDocument doc = new XmlDocument(); doc. LoadXml(str); string uri = "https://login.salesforce. Com/services/Soap/c/21.0"; HttpWebRequest req = (HttpWebRequest)WebRequest.

Create(uri); req.Headers. Add("SOAPAction", "login"); req. ContentType = "text/xml;charset=\"utf-8\""; req.

Accept = "text/xml"; req. Method = "POST"; stm = req. GetRequestStream(); doc.

Save(stm); stm.Close(); WebResponse resp = req.GetResponse(); stm = resp. GetResponseStream(); XmlDocument doc1 = new XmlDocument(); doc1. Load(stm).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions