• NiccoDev
  • NEWBIE
  • 15 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

Hi,

I'm trying to make a callout to an external webservice using javascript an apex, but I receive the following error:

 

A problem with the OnClickJavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/ZCMController}doCalc, please check the WSDL for the service.'}

 

The relevant javascript is:

 

var LeadRef="{!Lead.Id}"; 
var iQuoteRef="{!iQuote__c.Id}";

var myvar = sforce.apex.execute("ZCMController","doCalc",{iQuoteid:iQuoteRef,leadid:LeadRef});

 

and it refers to the Apex:

 

public class ZCMController {

public static string doCalc(string iQuoteid,string leadid) {
HttpRequest req = new HttpRequest();
req.setEndpoint('http://acceptance.superdooper.com/endpoint/123');
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml');
req.setHeader('Connection','keep-alive');
req.setHeader('Content-Length','88');
Http h = new Http();
HttpResponse res = h.send(req);
String result = res.getBody();
return result;
}
}

 

What am I missing?

 

Why is the error message referring to SOAP and WSDL if I'm using REST? 

 

Thanks for your help.

 

Trailhead seems to not be working well today.  It isn't recording my completed challenges and now is saying that I need to log in, but then won't let me do so.  Any idea?

Hi,

I'm trying to make a callout to an external webservice using javascript an apex, but I receive the following error:

 

A problem with the OnClickJavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/ZCMController}doCalc, please check the WSDL for the service.'}

 

The relevant javascript is:

 

var LeadRef="{!Lead.Id}"; 
var iQuoteRef="{!iQuote__c.Id}";

var myvar = sforce.apex.execute("ZCMController","doCalc",{iQuoteid:iQuoteRef,leadid:LeadRef});

 

and it refers to the Apex:

 

public class ZCMController {

public static string doCalc(string iQuoteid,string leadid) {
HttpRequest req = new HttpRequest();
req.setEndpoint('http://acceptance.superdooper.com/endpoint/123');
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml');
req.setHeader('Connection','keep-alive');
req.setHeader('Content-Length','88');
Http h = new Http();
HttpResponse res = h.send(req);
String result = res.getBody();
return result;
}
}

 

What am I missing?

 

Why is the error message referring to SOAP and WSDL if I'm using REST? 

 

Thanks for your help.