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

Possible Duplicate:
Can we create multiple @Http Methods (REST) annotations of the same type in a single class?

I want to call both methods from external system. Using Rest Methods

global with sharing class getMyData{

global static String getAccount()


     //some logic's goes here 

     return Accounts;

global static String getContats()


     //some logic's goes here 

     return Contacts;


I want to show the both results at a time. suggest any help me.

share|improve this question

marked as duplicate by metadaddy Dec 24 '12 at 16:41

This question was marked as an exact duplicate of an existing question.

@HTTP annotation is used to create a Restful apex class not for calling the external system.Please Use HTTP methods if you need to call the external system – Mohith Shrivastava Dec 24 '12 at 14:22
@MohithKumar - sathish is asking how to call the REST methods from an external system, not how to make a callout to an external system. – metadaddy Dec 24 '12 at 16:25

If you want information from both the Objects you can make a wrapper Object of Account and Contact and this Wrapper you can also use on visualforce Page .

For making callout use HTTP methods .The REST annotations are used to make a custom REST API .

Here is blog link i blogged if external system inputs JSON in userdefined format .You can even construct wrapper response type JSON if you are exposing multiple object data at a time

Here is the link of the blog of how wrapper data is formed

share|improve this answer

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