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”);
}
}
}`