0

We have an existing external system whose API documentation mention that the client system should support XML-RPC specification. To consume the services on this external system, can we directly do a HTTP Request with XML as body? Is it supported, if yes, how complex it can get?

2

Apex does not directly support XML-RPC, but instead, its successor, SOAP. If possible, use SOAP to call Salesforce. If you can only use XML-RPC, you'll have to manually parse the request yourself to implement the appropriate logic. This can range from trivial to incredibly complicated. If possible, seek alternative options.

  • By "directly support", do you mean parsing a XML-RPC response in Apex? If yes, I have considered it. But for using the XML-RPC service on a legacy server, can I use normal HttpRequest with request body in XML format as per the documentation given by legacy server's API developer? @sfdcfox – ajinkyah Dec 28 '18 at 11:03
  • @ajinkyah Yes, a normal HTTP request will suffice. Apex has sufficient XML reading and writing capability, it's just that there's no automated framework like there is for SOAP. You can still do it, it's just going to be a lot more work. – sfdcfox Dec 28 '18 at 15:09
  • Ok. Thank you very much @sfdcfox ! I don't see a possibility of alternative options because the system is not going to get any updates now. So will need to write code to parse the XML response by XML-RPC services. – ajinkyah Dec 31 '18 at 8:58

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.