Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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{

@HttpGet
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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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
add comment

1 Answer 1

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 .

http://cloudyworlds.blogspot.in/2012/11/native-parsing-of-json-input-into-user.html

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

http://cloudyworlds.blogspot.in/2012/09/how-to-generate-wrapped-data-from.html

share|improve this answer
add comment

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