0

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.

2
  • @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 Dec 24, 2012 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, 2012 at 16:25

1 Answer 1

0

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

Not the answer you're looking for? Browse other questions tagged .