Consider an apex class exposed as SOAP service (like the sample code shown below):
global with sharing class MySOAPWebService {
webservice static Account getRecord(String id) {
// Add your code
}
webservice static String createRecord(String inputData) {
// Add your code
}
}
- Do these SOAP services get called using HTTP POST method by default? Or does it depend how the caller chooses to call these methods?
- I believe there is no way to explicitly mark these web service methods as HTTP methods PATCH, PUT, GET etc. (unlike how it can be done for REST service). Is my assumption incorrect?
I'm not trying to implement an apex SOAP service, but just curious to know what goes on under the hood and whether it has any workaround for granular annotations related to other HTTP methods. I could not find relevant information from the apex as well as SOAP API developer guides in this regard. Is there any other documentation or Salesforce blog that I should be looking into?
SOAP was originally designed to be platform and transport protocol agnostic, but over a period of time most SOAP services ended up running over HTTP protocol (AFAIK). As mentioned here, Salesforce SOAP API complies with SOAP/1.1 (& I guess SF uses HTTP 1.1?).
- Do the standard SOAP services run over HTTP 1.1? And, do they also obey the same rules as custom apex web services when it comes to the HTTP method being used?