function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Maria AlexanderMaria Alexander 

web services in apex

Hi, All 


*what are all the Procedure to implement the integration using web services URL?
*How to consume the web services in apex class Or call the web services in apex class?

Advance Thanks  To all
Best Answer chosen by Maria Alexander
Aslam ChaudharyAslam Chaudhary
Please refer below link
https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts 

All Answers

Aslam ChaudharyAslam Chaudhary
Please refer below link
https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts 
This was selected as the best answer
Maria AlexanderMaria Alexander
Hi  Aslam Chaudhary,
Thank you for Replying 
I got the idea and answer.

 
Maria AlexanderMaria Alexander
In this forums, No one is Reply
 
Aslam ChaudharyAslam Chaudhary
Thanks for choosing best answer. If you need more info regarding websesrvice please let me know.
Regarding :"In this forums, No one is Reply". Is there any alternate forum or any specific reason?
Maria AlexanderMaria Alexander
Hi, all I tried but I can't display the values on the visualforce page it showing the partial output with your help I can get the idea I hope you are all understand. 

Visual force page
<apex:page controller="integrationcontroller" sidebar="false" showHeader="false" docType="html-5.0">
  <apex:form >
 <apex:commandButton value="Click To Get" action="{!getresult}"/>
  Output:<b></b>

 <apex:outputLabel value="{!myresponse}"/>
</apex:form>
</apex:page>

Webservices

 @HttpGet
    global static List<Login__c> doGet() 
    {
     List<Login__c> Lg=new List<Login__c>();
     Lg=[select Name from Login__c];
       return Lg;
    }



Controller 

public PageReference getresult() 
    {
    
    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://mas-jeevantechnologies-developer-edition.ap5.force.com/services/apexrest/myservice');
    request.setMethod('GET');
    HttpResponse response = http.send(request);
    myresponse=response.getBody();    

}
partial output 

Thanks in Advance.User-added image