I have a javascript button on my product layout named "ListToEbay" and I have written a controller to invoke the EndItem() service method of ebay api.
Below is the method:--
public void removeItemFromEbayList() {
HttpRequest req = new HttpRequest();
Http http = new Http();
sEnvelopHandlerForEndingList='Request XML';
req.setBody(sEnvelopHandlerForEndingList);
}
I want to execute this method directly on clicking that button, without going or opening a VisualForce Page
. How can I accomplish that?