• Chad Saar
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 9
    Replies
I am using the following line of code in the SDK to create a new Contact object. After creating the object how do I return the object Id?
 
SaveResult[] results = SfdcBinding.create(new sObject[] { contact });

 
I am looking for an example of how to update an object using the WSDL. I am using Visual Studio with C#. Every example has the following example.

// Make the update call by passing an array containing the two objects. 

I don't understand why they are creating an array with two objects in order to update. There are two problems with this, I am NOT updating two objects, only one.

Also the method "update" does not exist in their WSDL library. Below is the code they recommend for updating an object and my code. Please advise, I just need the very last line of code that performs the update.

Recommended code which makes no sense to me.
// Make the update call by passing an array containing
        // the two objects.             
        SaveResult[] saveResults = binding.update(
            new sObject[] {updateContact, errorContact});
        // Iterate through the results and write the ID of 
        // the updated contacts to the console, in this case one contact.
        // If the result is not successful, write the errors
        // to the console. In this case, one item failed to update.
        for (int j = 0; j < saveResults.Length; j++) {
            Console.WriteLine("\nItem: " + j);
            if (saveResults[j].success) 
            {
                Console.WriteLine("Contact with an ID of " +
                saveResults[j].id + " was updated.");
            }

My code so far, missing the very last line of code to actually perform the update on my custom object.
 
SalesForce.QueryResult queryResult = null;

            String SOQL = "select from Annual_Program_Participation__c where Id = '" + textBox1.Text.ToString() + "'";

            queryResult = SfdcBinding.query(SOQL);

            SalesForce.Annual_Program_Participation__c app = (SalesForce.Annual_Program_Participation__c)queryResult.records[0];

            app.Course_Plan_Link__c = "https://www.google.com/";


           

 
I can run the same code with one Enterprise WSDL as a Web Reference and it works perfectly. If I run with another companies Enterprise WSDL file then it says "Unable to generate a temporary class (result=1). This is a critical line of code in order to perform any SalesForce integrations and comes right out of the documetation. There is a post on this subject but no one can seem to agree on what the problem is, some say it is bug, other link to expired articles, some say it requires a manual modification to the WSDL file.

Code
 
sfdcBinding = new SalesForceWebReference.SforceService();

 
I am trying to get my first token from https://login.salesforce.com/services/oauth2/token.

I make the below request and the server responds " error_description: "authentication failure - Failed: API security token required"" error: "invalid_grant"

The server I am asking to provide a token is requesting a token from me?!? Also why is "Password" and invalid grant type? It is in the documentation here: 
https://www.salesforce.com/us/developer/docs/api_rest/

POST Contents

grant_type=password&client_id=XXXXX&client_secret=XXXXXXX&username=XXXXXXXXX&password=XXXXXXXX&redirect_uri=XXXXXXXXXXX
I am having trouble finding the documentation for WSDL methods. I am just looking for a description, parameters, and hopefully a few examples for each method available.
Does anyone know why the SForceService object would be missing from my Enterprise WSDL file? I just created a new one and I have all of the methods and objects except this critical one used for logging in.
Hello,

I am not looking to use OAuth as there will be no one there to provide authentication. I am not building an app with a user interface. Is there a key available I can put in my http post header to auto authorize so that many script can communicate with the salesforce data?

Sorry I am not finding any documentation or videos that don't use the OAuth method where someone must be present to login.
If I already have a JSON HTTP Post object can I simply send requests to the salesforce.com website for updating my company data automatically? Every manual I read requires the SDK be installed. I have not had to do this with previous vendors, I just use the provided URIs and send the requests through my platform. Is installing the SDK a requirement?
Does anyone know why the SForceService object would be missing from my Enterprise WSDL file? I just created a new one and I have all of the methods and objects except this critical one used for logging in.
I am using the following line of code in the SDK to create a new Contact object. After creating the object how do I return the object Id?
 
SaveResult[] results = SfdcBinding.create(new sObject[] { contact });

 
Greetings...

I have had great success in using .net and the associated API Enterprise generated WSDL and Web Reference for about a year.  I've also used the API in the Sandbox.  I hadn't made a change to the Sandbox or the Production for a couple of months.  Today I did the following in Firefox (I have had more success generating and downloading the WSDL in Firefox)

- Went to Settings/Develop/API/Generate Enterprise WSDL and clicked the GENERATE button to the right of "Generate Enterprise WSDL"
- The result in Firefox was not the normal formatted XML that I had seen in the past (perhaps the update to Firefox did this) What appeared was what looked like one big paragraph of sentences (no xml tags)
-  I right clicked in the white area of the page and "saved as"  test.wsdl
- When I opened test.wsdl, it looked like it alwas does...properly formed XML

Next in VS, I changed the Web Reference property to the Test.wsdl file name and Updated my Web Reference

======================================
Now the issue (finaly)
======================================

When I try to create an instance of SforceService like the code below:

                    SforceService sfService = new SforceService();

I get the following exception:

2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Name InvalidOperationException
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message Unable to generate a temporary class (result=1).
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Source System.Xml
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at Mozenda.Business.Salesforce.SforceService..ctor()
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at Mozenda.Business.SalesforceClient.SalesForceClient.Connect()


There is alot if information about "Unable to generate a temporary class (result=1)" doing a Google search, but nothing seems to apply.

- Has Salesforce changed how the Enterprise WSDL is created?

Thanks in advance!!

Russ






I am having trouble finding the documentation for WSDL methods. I am just looking for a description, parameters, and hopefully a few examples for each method available.
Does anyone know why the SForceService object would be missing from my Enterprise WSDL file? I just created a new one and I have all of the methods and objects except this critical one used for logging in.
If I already have a JSON HTTP Post object can I simply send requests to the salesforce.com website for updating my company data automatically? Every manual I read requires the SDK be installed. I have not had to do this with previous vendors, I just use the provided URIs and send the requests through my platform. Is installing the SDK a requirement?