0

Can anyone give sample usecases that best suits for integration using SOAP and REST APIs? Because i am bit confused over selecting SOAP or REST for the integration between SFDC and SAP. Any Expert advice would be much helpful.

  • If you want realtime data, then you shouldn't use either of the apis (because you will quickly consume your orgs api all limit). you should write some apex code and triggers/callouts to send the updated records to some external web service. – edgartheunready Feb 25 '14 at 16:14
3

At this point, I believe the SOAP and Rest api's are pretty much at parity[1] -- there are few things that are only available to one or the other.

That said then, I think the best "use case" question for one over the other has less to do with the intended use case, and more to do with two other factors:

  1. Development language used to build the integration
  2. Developer familiarity / comfort level.

In other words, if you're a long time c# dev with lots of experience with auto-generated code created by Visual Studio when you hand it a WSDL, then by all means use the SOAP api. On the other hand, if you're a longtime Ruby dev, who's experience lies with REST apis, then you should use the Rest api. The one exception to that is this: if you're developing an integration with a well maintained, high-functioning integration library readily available for your chosen language, use that library. For instance, Php has the PHPToolkit(Soap Based); Ruby has RestForce/MetaForce(Rest based); and there's a new C# toolkit(Uh, no idea what it's based on) by Wade Wegner @salesforce. If you're using a language that has such a toolkit -- default to using that. The Rest api is "Rest-like" but not fully Restful (ie: there's a separate query resource outside of the individual object resources) and these wrappers will provide you a consistent, developer friendly experience for either Api.

[1]: I believe there are still one or two things the soap API can do that the REST api cannot, such as manipulate permission sets, but please keep in mind that I've not extensively researched the state of the two api's today just to answer this question. I'm working off of knowledge from the last time I had to use SOAP. I generally use REST.

  • Thanks for your reply. You had given great points to consider. Which one is best regarding performance? – Bforce Feb 25 '14 at 16:35
  • I don't think i'm the right guy to talk about the performance as I've done next to nothing with SOAP recently. My gut tells me REST will be faster, just based on the reduced "wire cost" of JSON vs. XML. – Kevin P Feb 25 '14 at 19:01
0

Depending on your number of API callouts as well I would recommend possibly using the Streaming API. To determine if this is the best approach I would look at the amount of calls you'll be using back and forth. Also with the Streaming API, you'll have the best chance of getting as close as possible real time data without having to do polling requests / pushing from triggers. There are some issues with Salesforce in the order of execution when making callouts. Of course callouts come with their limitations which can include length of time it takes to process records since it will need to wait for a response, and having to do a async method to make your callouts which are limited as well. This is the remaining list of callout limitations

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.