Posts

Showing posts from December, 2014

Creating Custom Apex SOAP based Web Service in Salesforce.com's Force.com platform

Image
This blog describes how to create a Custom web service in Salesforce using Apex. Steps:   Navigate to  Setup>Develop>Apex Classes   and create new class by clicking new button. Write a class with " global " access modifier with methods (to be exposed) with " webService " keyword         eg. global class KartikService {     webService static String hello(String Name)     {         return 'Hello ' +Name+ ' ! :D' ;     } } Then save this class. After saving the class you will view a button " Generate WSDL ". Click on that to get WSDL for web service you just created. Save the WSDL file. Let say file name is " KartikService.wsdl " Now we will consider how we generate clients to call this service in Java and in .Net.   For Java: We will create new project in Eclipse with name "ApexCustomWS" You need  Enterprise / Partner WSDL  to access your Salesforce org. by getting a valid sessionId