You need to sign in to do that
Don't have an account?
How to pass an external webservice child objects
Hi,
I am looking at design options to develop an integration to an external webservice.
The webservice will take a couple of fields off of a parent object (say account) and then a couple of fields from the set of child objects (say contact).
So for arguments sake lets say it takes the account name and site and then an array of contact name and postcodes.
It would be triggered by a button on the child object (so would send details about its parents and siblings if that makes sense!) .
1. What is the best method to achieve this callout? (outbound message vs apex callout vs ...?) - I think Apex is the only option?
2. I have built similar webservice callouts using Apex before but they've always been very simple (send in one or 2 parameters) - How would one go about passing in the array of child objects to the web service? (I have no control over the external end so can't just pass a query string for it to retrieve the records)
Any thoughts much appreciated,
Demi
>How would one go about passing in the array of child objects to the web service?
You are right that Apex is the way to go. However, the answer to your question lies in the contract specified by your external web service. It's not about how you pass it in Apex, it's about the operation and the input data structure defined by your web service in the WSDL file. Since you have done callouts before, I hope you are familar with generating Apex stub from the WSDL. You can look at the generated Apex stubs (or the WSDL itself) to get an idea about this.
All Answers
>How would one go about passing in the array of child objects to the web service?
You are right that Apex is the way to go. However, the answer to your question lies in the contract specified by your external web service. It's not about how you pass it in Apex, it's about the operation and the input data structure defined by your web service in the WSDL file. Since you have done callouts before, I hope you are familar with generating Apex stub from the WSDL. You can look at the generated Apex stubs (or the WSDL itself) to get an idea about this.