Hi - I am brand new to Cast Iron and am having trouble calling a custom written Salesforce.com API in CI Studio.
I have a custom API that was written by one of my Salesforce developers to create new records or delete records, based on certain criteria that gets met on a related parent record.
I have downloaded the Enterprise WSDL from Salesforce, from there I am trying to invoke the login method before I call my custom API. From the documentation I have found thus far, it states that I must do this to get the sessionId for subsequent API calls.
I have also downloaded the WSDL for our custom API call. When I load the WSDL using the Invoke Service activity, the methods are available to me, but I am not sure how to pass the sessionID from the previous WSDL.
This webpage gives a broad overview of what we are trying to accomplish:
Any direction/knowledge/ advice on this is greatly appreciated!
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
4 replies Latest Post - 2013-01-04T22:58:45Z by SystemAdmin
Pinned topic Calling a Custom Salesforce.com API
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-01-04T22:58:45Z at 2013-01-04T22:58:45Z by SystemAdmin
Re: Calling a Custom Salesforce.com API2013-01-03T21:46:06Z in response to SystemAdminOn the Map Inputs panel of the Invoke Service activity (used to invoke the web service operation), right click in the area under "To Activity". A context menu will appear. Select "Show Optional Parameters". You should now see a headers document that allows you to populate the SOAP header defined for the web service operation (a subdocument should reference session information). (Optional parameters are also available for IP applications to support runtime configuration.)
If your only reason for using the enterprise WSDL, consider the partner WSDL which is much more compact. You may also use one of the "light weight" activities associated with the Cast Iron built-in connector (e.g., get server timestamp or get user information) to establish a session. The outputs of all of the built-in connector activities include a sessionInfo document.
Re: Calling a Custom Salesforce.com API2013-01-04T18:10:21Z in response to SystemAdminThank you for the quick reply! That was a huge help!
I was able to establish a session with Salesforce and login, but my problem now is passing the sessionId and the serverUrl to the web service I am trying to invoke.
The error message I am getting is No operation available for request.
I am not sure if this means the activity is able to connect to the web service, but not executing it, or if the web service was never connected to.
Re: Calling a Custom Salesforce.com API2013-01-04T18:43:21Z in response to SystemAdminSounds like the URL you're passing to the optional "location" HTTP header isn't specifying the name of the Apex class in Salesforce that implements the custom Web service. If you parse the serverURL being returned from the login() call to Salesforce and replace everything following the "../Soap" portion of this URL with "/class/<Apex Class Name>", then Cast Iron should find it.
For example, if you have an Apex class named "mySvc", the URL you pass to the location header in the Invoke Service activity may look something like: https://cs14-api.salesforce.com/services/Soap/class/mySvc.
Hope this helps.