Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am calling below webservice when i update the record in account object, trigger calling the webservice but when i used below webservice i am getting 503 error i am follwing the below link it is working fine for me, when i change the url at that time i am getting 503 error what is the problem

public class AccountUpdater {

  public static void updateAccount(String id, String name) {

    //construct an HTTP request
    HttpRequest req = new HttpRequest();

    //send the request
    Http http = new Http();
    HttpResponse res = http.send(req);

    //check the response
    if (res.getStatusCode() == 200) {

      //update account
      Account acc = new Account(Id=id);
      acc.Description = res.getBody();
      update acc;
    } else {
      System.debug('Callout failed: ' + res);
share|improve this question

The HTTP status numbers have specific meanings. For example your 503 means:

The Web server (running the Web site) is currently unable to handle the HTTP request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.

That suggests the problem is not at your end of the communication but at the other server end.

As this is a simple unauthenticated GET, you can just enter the URL in your browser and check the result you get there compared to the result you get in your Apex code. (Right now does not appear to exist.)

Also note that you have to allow your org to access to the remote server via Setup -> Security -> Remote Site Settings.

share|improve this answer
Actually i changed the URL my orginal url is – Sathya Mar 22 '14 at 12:06
I just pasted that into my browser's URL and it doesn't exist either. Get the code working with a URL you know exists. – Keith C Mar 22 '14 at 12:07
it asking me an user name and password..i used the above URL which is asking UserName and Pwd.. – Sathya Mar 22 '14 at 12:26
OK, though I'm not sure why I can't see the site at all. Again having proven the process using your browser (i.e. making sure you have a valid username and password for the site), you can then add the authentication information to your request. This is how to do it for one type of username/password prompt…, but the site you are trying to connect to may be using some other protocol. Best to check the site's documentation. – Keith C Mar 22 '14 at 12:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.