• vino1.395228003587918E12
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
Hi,
I have fetched the AsyncApexJob from .Net.
In SOQL i got the "Bind variables only allowed in Apex code" Error.

My code is:

string res = "Failed";
            QueryResult query = null;
            string soql;
            soql = "SELECT Status,JobType,NumberOfErrors,CompletedDate FROM AsyncApexJob WHERE Status="+res+"";
            query = sfdcbind.query(soql);

Anyone help to solve this.
Hi,
I have 1000 records in SQL Server. I want to update this all records in Salesforce from .Net. I used EnterPrise WSDL file for Salesforce Connection.
I used following update code:


Account  updateacc=new Account;
updateacc.Last_Year__c = Double.Parse(row["LASTYEAR"].ToString());
  updateacc.Last_Year__cSpecified = true;
SaveResult[] saveResults = sfdcbind.update(new sObject[] { updateacc });

But i got Read Timeout Error.
Any one help me to solve this?
HttpClient updateclient = new HttpClient();


            string requestMessage = "<root><name>test</name></root>";
            HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/xml");

            //string requestMessage = "{\"Name\":\"DevForce20\"}";
            //HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/json");

string updateurl = serviceUrl + "/services/data/v25.0/sobjects/Account/";


            //create request message associated with POST verb
            HttpRequestMessage request1 = new HttpRequestMessage(HttpMethod.Put,updateurl);

            //add token to header
            request1.Headers.Add("Authorization", "Bearer " + oauthToken);
          
            //return xml to the caller
            request1.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
            request1.Content = updatecontent;
        
            HttpResponseMessage response1 = await updateclient.PutAsync(updateurl+"001O000000MPrtsIAD",request1.Content);

            string resultipp = await response1.Content.ReadAsStringAsync();
           

            Response.Write(resultipp);

            return resultipp;
I got this error "[{\"message\":\"Session expired or invalid\",\"errorCode\":\"INVALID_SESSION_ID\"} .
If any one help me to resolve this.
Hi here is my wsdl code. I got the followinf error "Unable to find schema for element; {http://tempuri.org/}GetAllDataResponse" while parsing the WSDL file.


<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="Service1" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="wsHttpEndpoint_policy">
<wsp:ExactlyOne>
<wsp:All>
<http:NegotiateAuthentication xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http"/>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<!--

<xsd:import schemaLocation="https://salesforce.easyasnhs.com.au:8080/Service1.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="https://salesforce.easyasnhs.com.au:8080/Service1.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
-->
</xsd:schema>
</wsdl:types>
<wsdl:message name="IService1_GetAllData_InputMessage">
<wsdl:part name="parameters" element="tns:GetAllData"/>
</wsdl:message>
<wsdl:message name="IService1_GetAllData_OutputMessage">
<wsdl:part name="parameters" element="tns:GetAllDataResponse"/>
</wsdl:message>
<wsdl:portType name="IService1">
<wsdl:operation name="GetAllData">
<wsdl:input wsaw:Action="http://tempuri.org/IService1/GetAllData" message="tns:IService1_GetAllData_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IService1/GetAllDataResponse" message="tns:IService1_GetAllData_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="wsHttpEndpoint" type="tns:IService1">
<wsp:PolicyReference URI="#wsHttpEndpoint_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAllData">
<soap12:operation soapAction="http://tempuri.org/IService1/GetAllData" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service1">
<wsdl:port name="wsHttpEndpoint" binding="tns:wsHttpEndpoint">
<soap12:address location="https://salesforce.easyasnhs.com.au:8080/Service1.svc"/>
<wsa10:EndpointReference>
<wsa10:Address>
https://salesforce.easyasnhs.com.au:8080/Service1.svc
</wsa10:Address>
<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
<Spn>host/SVR-SBS2011.nhs.local</Spn>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Hi,
I am creating web service in .net.  This webservice is called from salesforce. In salesforce pass the iput to this webservice.
Is possible to get iput?. Then How can i get the salesforce input in .NET?
Hi,

I have one currency column in MS Access.

I am fetching the value from database. But i didnt update in Salesforce.

How Can i do this?

updateacc.X1_month__c=Double.Parse(row["Month1"].ToString(),NumberStyles.Currency );

SaveResult[] saveResults = sfdcbind.update(new sObject[] { updateacc });
Hi,
I have 1000 records in SQL Server. I want to update this all records in Salesforce from .Net. I used EnterPrise WSDL file for Salesforce Connection.
I used following update code:


Account  updateacc=new Account;
updateacc.Last_Year__c = Double.Parse(row["LASTYEAR"].ToString());
  updateacc.Last_Year__cSpecified = true;
SaveResult[] saveResults = sfdcbind.update(new sObject[] { updateacc });

But i got Read Timeout Error.
Any one help me to solve this?
HttpClient updateclient = new HttpClient();


            string requestMessage = "<root><name>test</name></root>";
            HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/xml");

            //string requestMessage = "{\"Name\":\"DevForce20\"}";
            //HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/json");

string updateurl = serviceUrl + "/services/data/v25.0/sobjects/Account/";


            //create request message associated with POST verb
            HttpRequestMessage request1 = new HttpRequestMessage(HttpMethod.Put,updateurl);

            //add token to header
            request1.Headers.Add("Authorization", "Bearer " + oauthToken);
          
            //return xml to the caller
            request1.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
            request1.Content = updatecontent;
        
            HttpResponseMessage response1 = await updateclient.PutAsync(updateurl+"001O000000MPrtsIAD",request1.Content);

            string resultipp = await response1.Content.ReadAsStringAsync();
           

            Response.Write(resultipp);

            return resultipp;
I got this error "[{\"message\":\"Session expired or invalid\",\"errorCode\":\"INVALID_SESSION_ID\"} .
If any one help me to resolve this.
Hi,
I am creating web service in .net.  This webservice is called from salesforce. In salesforce pass the iput to this webservice.
Is possible to get iput?. Then How can i get the salesforce input in .NET?
Hi,
I have fetched the AsyncApexJob from .Net.
In SOQL i got the "Bind variables only allowed in Apex code" Error.

My code is:

string res = "Failed";
            QueryResult query = null;
            string soql;
            soql = "SELECT Status,JobType,NumberOfErrors,CompletedDate FROM AsyncApexJob WHERE Status="+res+"";
            query = sfdcbind.query(soql);

Anyone help to solve this.
HttpClient updateclient = new HttpClient();


            string requestMessage = "<root><name>test</name></root>";
            HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/xml");

            //string requestMessage = "{\"Name\":\"DevForce20\"}";
            //HttpContent updatecontent = new StringContent(requestMessage, Encoding.UTF8, "application/json");

string updateurl = serviceUrl + "/services/data/v25.0/sobjects/Account/";


            //create request message associated with POST verb
            HttpRequestMessage request1 = new HttpRequestMessage(HttpMethod.Put,updateurl);

            //add token to header
            request1.Headers.Add("Authorization", "Bearer " + oauthToken);
          
            //return xml to the caller
            request1.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
            request1.Content = updatecontent;
        
            HttpResponseMessage response1 = await updateclient.PutAsync(updateurl+"001O000000MPrtsIAD",request1.Content);

            string resultipp = await response1.Content.ReadAsStringAsync();
           

            Response.Write(resultipp);

            return resultipp;
I got this error "[{\"message\":\"Session expired or invalid\",\"errorCode\":\"INVALID_SESSION_ID\"} .
If any one help me to resolve this.
Hi,

I have one currency column in MS Access.

I am fetching the value from database. But i didnt update in Salesforce.

How Can i do this?

updateacc.X1_month__c=Double.Parse(row["Month1"].ToString(),NumberStyles.Currency );

SaveResult[] saveResults = sfdcbind.update(new sObject[] { updateacc });