0

I created a web service in salesforce as below:

global class HelloWorldWebService{
   webService static string sayHello(){
        return 'Hello World';
    }
}

I can consume wsdl file of this service in SOAP UI and test it easily.First I have to get session id through Enterprise wsdl and then pass this session id in my web service. In real time scenario,how this service will consume outside salesforce, how third party application like java or .net will consume this service. Because that session id will be expired after some time, so we can't provide session id to third party after every 2 hours. Please also tell me how can we consume this service within salesorce.

Thanks in advance !

1 Answer 1

0

You can consume this service within Salesforce via a web service call by using the "Generate from WSDL" button as described in SOAP Services: Defining a Class from a WSDL Document and calling the generated class from some other Apex such as a controller class. You will also need to add a corresponding Remote Site Setting.

(If you are working in the same org that this class is defined in, you can just directly call the method instead.)

To consume from outside Salesforce, typically the calling code would login, make whatever calls it needs to make at that time, and then logout.

You must log in to answer this question.

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