[SalesForce] how to call the more then one methods using HttpGet annnotation in apex class

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.

Best Answer

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

Related Topic