How to consume SalesForce Webservice from .net

Home Forums Marketing Muses How to consume SalesForce Webservice from .net

Viewing 1 reply thread
  • Author
    Posts
    • #50367
      Elena Kretova
      Participant

      I’m trying to consume a SalesForce webservice from .net. I’m really new to SalesForce and don’t have much idea about it. If anyone can help me out with a step by step process how to do it that would be very helpful. Below is steps I’ve done and I’m not sure what I have missed. Please help.

      SalesForce WebService Code:

      global class SampleWebService

      {

      webservice static String sayHello(String Name)

      {

      return ‘Hello ‘ + Name + ‘, welcome to Salesforce WebService.’;

      }

      }

      Generated the WSDL file.

      Created .net project and added the web reference of that wsdl.

      C# code:

      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.Web.UI;
      using System.Web.UI.WebControls;

      namespace SalesForceWebService
      {
      public partial class Home : System.Web.UI.Page
      {
      SalesForceService.SampleWebServiceService objService = new SalesForceService.SampleWebServiceService();

      protected void Page_Load(object sender, EventArgs e)
      {
      lblHello.Text = objService.sayHello(“ABC”);
      }
      }
      }`

    • #84645
      MarketingMuses
      Keymaster

      Hi Elena –
      I would need to know more details on your project and if it is a stand alone landing page or webform widget that you are trying to implement. Also the specific use or feature of Salesforce that you are trying to accomplish would be helpful. Thank you!

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
gtag('set', {'user_id': 'USER_ID'}); // Set the user ID using signed-in user_id. ga('set', 'userId', 'USER_ID'); // Set the user ID using signed-in user_id.