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
JWikkJWikk 

web service best practice for ISVs?

Hi we are integrating our salesforce app with REST webservice from ESRI. It happens to be a geocoder service.

 

Each of our clients may have a different service host, name, and parameters. What is the best way to develop this connection while still being configurable across each of our clients? If we use custom settings, should I create one for each service?

 

So far I have 3 methods:

 

buildRequest

sendRequest

receiveRequest

 

James

BasicGov.com

paul-lmipaul-lmi

best practice would be to have anythign "custom" for the customer be built into Custom Settings (in this case, a hierarchy setting), and your code references those settings to get the values.  the structure of your methods is good, as you definitely want the sender method to be as small as possible, since test code can't cover an http.send().  i'm assumign the receiverequest method is actually just processing the response of sendrequest, in which case you may want to have that be able to parse the headers map/response body as their apex primitive types, rather than passing the response.body directly to the processing method.  this makes your test code easier to write.