1

I am quite a bit confused to understand the difference between http callout and webservice callout. though it is a simple question i just want to know most important differences. Can anyone please guide me through?

2
  • What aspect do you consider salesforce specific ? These are general web techniques. Apr 4, 2014 at 12:44
  • 3
    This may relate to the availability of two mock interfaces: WebServiceMock and HttpCalloutMock. The docs are not too explicit, but it looks like WebServiceMock is specifically provided for the wsdl2apex generated code that calls WebServiceCallout.invoke, whereas HttpCalloutMock would appear to be usable for any HTTP callout. But personally, I'd appreciate a clearer explanation of which to use when and whether HttpCalloutMock can also be used for wsdl2apex code.
    – Keith C
    Apr 4, 2014 at 12:57

2 Answers 2

2

From SF doc:

  • WebServiceMock: Enables sending fake responses when testing Web service callouts of a class auto-generated from a WSDL.
  • HttpCalloutMock: Enables sending fake responses when testing HTTP callouts.

So WebServiceMock is mainly used for SOAP web service while the HttpCalloutMock is mainly used for HTTP (REST) web service.

1

From my understanding you are asking the difference between them. 'HTTP Callout' is the same thing as a 'Webservice Callout'. Now the only difference between the two is the context you use them in. IE: if you are making a 'Webservice', you are creating the endpoint and code behind the scene which ends up doing what ever processing it needs to and returns a respond to the originating point

You must log in to answer this question.

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