Reputation: 518
I am developing an application in ASP.NET and in that I need to integrate sales force CRM using APEX. Like I have reach a bit over that, I need to write the APEX code on salesforce devlopers area and need to call tha functions and classes from my ASP.NET application, buti am not sure that i am following the right way. So can any one please help me how can I integrate APEX (Salesforce) in to my ASP.NET C# application. Thanks in advance.
Upvotes: 0
Views: 286
Reputation: 13537
Doing things "the right way" is highly subjective and will vary greatly depending on your specific requirements.
Generally speaking, if you want to invoke Apex from .NET there are two ways to do so:
webService
keyword to the static method, and then finally generating the WSDL in Salesforce that can be imported into .NET. See WebService Methods.See also Invoking Apex
When you import the apex webservice WSDL into your .NET project you will get a service class generated. Create an instance of this and then create a SessionHeader
for it's SessionHeaderValue
. This SessionHeader
will require the ServerURL and SessionId to be set. Assign your access token to the SessionId here. Then you should be free to call your web service. See Calling a custom Salesforce Apex web service from C#
Upvotes: 1