• Chris_Learning
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
  1. I followed the instruction, step by step, and create the class "MyHelloWorld.cls" (just copied and pasted from the help)

  2. public class MyHelloWorld {
          // This method updates the Hello field on a list
         // of accounts.
               public static void addHelloWorld(Account[] accs){
      for (Account a:accs){
                        if (a.Hello__c != 'World')
      a.Hello__c = 'World';
                                                     }
                                                                                              }
    }

  3. I am still OK up to this point.  The problem occurred when I create the trigger below:

  4. Trigger helloWorldAccountTrigger on Account
    (before insert) {
    MyHelloWorld.addHelloWorld(Trigger.new);
    }

  5. The error = "Method does not exist or Incorrect Signature"

  6. Can you please let me know what is my problem?

Hello,
 
I'd like to accomplish similar to this demo:  http://adnsandbox.com/media/soasoa/
 
However, I don't have WSDL in my external web service.
 
Can you please give me sample code to call HTTP POST/GET to external web service from SalesForce.com?
 
Thanks,
 
Chris
Hi,

I want to call Yahoo web service through REST protocol from my apex code.

I am using following example given in apex language reference guide. I have just replaced my url in the code.

public class HttpCalloutSample {
// Pass in the endpoint to be used using the string url
public String getContent() {
// Instantiate a new http object
Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
String url = 'http://travel.yahooapis.com/TripService/V1.1/tripSearch?appid=YahooDemo';
req.setEndpoint(url);
req.setMethod('GET');
// Send the request, and return a response
HttpResponse res = h.send(req);
return res.getBody();
}
}

I am calling following line from my S-Control (in my javascript function)
var success = sforce.apex.execute("HttpCalloutSample", "getContent", {});

I am getting following exception.

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

So what is the problem? Is it a right way?
Does anyone have any example code or syntax show how I would make that call?

Thanks
  1. I followed the instruction, step by step, and create the class "MyHelloWorld.cls" (just copied and pasted from the help)

  2. public class MyHelloWorld {
          // This method updates the Hello field on a list
         // of accounts.
               public static void addHelloWorld(Account[] accs){
      for (Account a:accs){
                        if (a.Hello__c != 'World')
      a.Hello__c = 'World';
                                                     }
                                                                                              }
    }

  3. I am still OK up to this point.  The problem occurred when I create the trigger below:

  4. Trigger helloWorldAccountTrigger on Account
    (before insert) {
    MyHelloWorld.addHelloWorld(Trigger.new);
    }

  5. The error = "Method does not exist or Incorrect Signature"

  6. Can you please let me know what is my problem?

Hi, I'm just trying to get the MyhelloWorld trigger to work from the 'Quickstart with Force.com IDE guide' - (on my developer site), and I can't seem to get it to work. Can someone tell me what I am doing wrong?
 
Here is the code:
 
APEX Class:
public class MyHelloWorld {
public static void addHelloWorld(Account[] accs) {
   for (Account a:accs) {
     if (a.Hello__c != 'World') 
     a.Hello__c = 'World';
}
}
}
APEX Trigger under Account: 
trigger helloWorldAccountTrigger on Account (before insert) {
MyHelloWorld.addHelloWorld (Trigger.new);
}
 
API Name on Account Record is: Hello__c
  • June 11, 2008
  • Like
  • 0
Hello,
 
I'd like to accomplish similar to this demo:  http://adnsandbox.com/media/soasoa/
 
However, I don't have WSDL in my external web service.
 
Can you please give me sample code to call HTTP POST/GET to external web service from SalesForce.com?
 
Thanks,
 
Chris