Following this post I'm trying to create an Apex Callout from Salesforce to a webservice (.Net) - or something that can receieve the POST.
Being new to this I'm uncertain of how to catch the Http POST
sent from Salesforce. That is I have an Apex Class in Salesforce that gets triggered on Account insert:
public class WebServiceCallout {
@future (callout=true)
public static void sendNotification(String name) {
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('http://localhost');
req.setMethod('POST');
req.setBody('name='+EncodingUtil.urlEncode(name, 'UTF-8'));
req.setCompressed(true); // otherwise we hit a limit of 32000
try {
res = http.send(req);
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
System.debug(res.toString());
}
}
}
Logically the req.setEndpoint('http://localhost');
should be replaced with my IP and an acceptable port.
If I wanted to catch this POST
what project would need to be built in Visual Studio (.Net)?