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
MaxiMizeMaxiMize 

Web Services

I'm having a small bit of trouble... I've read through the quick start guide, but I'm not able to complete the creation of the web service.  I'm using Visual Studio .NET 2005 (2.0.5).  I've created and downloaded the enterprise.wsdl file.  I am confused on the following points:

1.  HTTPconnection:  Is this simply "https://login.salesforce.com/"?  It does test successful, but that doesn't mean it's connecting to the right place.

2. If I use the above step and download the wsdl file, I get something that doesn't work.  Downloading and specifiying directly allows me to go on to the second step of specifying the input.

3.  On the INPUT tab, I am able to select SforceService  After selecting, however, I get an immediate error stating that "This version of the web services definition language (wsdl) is not supported."

I'm absolutely certain that I am missing something very basic here... I haven't touched SSIS in a couple of years, and then it was only for a training class.  Am I creating the project wrong?  Am I missing something else? 

Any help?  Point me towards a reference?  Anything at all?  Please??
werewolfwerewolf
You should be connecting to https://www.salesforce.com/services/Soap/c/12.0, but you shouldn't even need to do that.

Take the WSDL and import it as a Web Reference.  Now add a using statement to your code for that reference you just created.  Once you've done that, the following code should suffice to log you in:

Code:
// Create service object  
sfdc = new SforceService();
sfdc.Url = Endpoint;

try {
 // Invoke the Login call and save results in LoginResult 
 LoginResult lr = sfdc.login(username, password);

 // Reset the SOAP endpoint to the returned server URL 
 sfdc.Url = lr.serverUrl;

 // Create a new session header object 
 // Add the session ID returned from the Login 
 sfdc.SessionHeaderValue = new SessionHeader();
 sfdc.SessionHeaderValue.sessionId = lr.sessionId;

 SessionId = lr.sessionId;
}
catch (Exception e) {
 lastError = e.Message;
}

Now you have a nice logged-in sfdc object, and you can use it to make your queries and other web services goodness.