function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Knet15Knet15 

Could I call a local service from Sales Force? Is this possible?

Hello, 

I was trying to call a service .NET from sales that return a string text, I added the remote  

 User-added image

Then I prepared an Apex class 
global class MyButton{
      
      WebService static string returnstr() {
            string url = 'http://localhost/ServicePractice/ServicePractice.svc';
            Http h = new Http();
            
            HttpRequest req = new HttpRequest();
            req.setEndpoint(url);
            req.setMethod('GET');
            
            HttpResponse res = h.send(req);
            return res.getToString();
      }
}
 
Then I receive a message the following message:
 User-added image

I tried using my local machine ip, but is change the error to error http 403, and receive the following message:
User-added image

Could anybody help me?

Thanks a lot.

ShashankShashank (Salesforce Developers) 
You might find this helpful:
http://www.developer.com/net/net/salesforce-integration-with-.net-callouts-.html