You may find yourself looping through a data set (such as an input file) amd performing some kind of input logic that requires data from a Workday custom report which accepts a particular object instance as a parameter. Generally, RaaS calls are expensive operations, and running a report for each individual worker/cost center/period/whatever can quickly become a pain point as your input set grows. You're nearly always better off running a report once while passing every instance you'll need in a single call, and retrieving all the relevant data up front (if memory permits.) In the past year alone:
https://wd-url/ccx/service/customreport2/tenant/owner/Report_Name?Worker!WID=418b91b6b064104b21a9ee0d6c2498ab!6854645811284e8182713524d52a30ce
props['Worker_WIDs'] = lp.getReferenceDataList('Workers', 'WID')
props['report_url'] = intsys.reportService.getExtrapath('WorkerReport') + '?Worker!WID='
props['count'] = props['Worker_WIDs'].size() - 1
foreach(i: count) { props['report_url'] = props['report_url'] + '!' + props['Worker_WIDs'].get(i) }You'll first want to ask yourself if there's an easier way before going down this road, such as building your report filter around some other, more manageable (i.e. singular, or static) parameter. You've probably already considered this, but it's worth taking a few minutes to think over. If you still want or need to go this route, please read on.
Start by creating a report and publishing it as a web service, as you would with an EIB or REST-based RaaS report. Off the reports related action, export and save the WSDL locally.
Open your studio project, and from the context menu on the project root folder, select 'Import->Import...' select on the following prompt, select 'File System' and click 'Next'.
Navigate to wherever you saved the WSDL earlier and select the file. Select your project root folder (or a subfolder if you wish) as the destination, and click 'Finish' to bring the WSDL into your project.
On the Schema Explorer to the right, click the leftmost 'Add WSDL or XSD' button, navigate to your newly imported WSDL, and click 'OK'.
You should now see a representation of your report in the 'Schema Explorer' pane. Expand it and you'll see ports for SOAP and REST access to your report. Expand the SOAP port and you'll see the 'Execute_Report' operation; From here, you can right click and 'Open SOAP wrapped request in Web Service Tester' as you would with a delivered Workday Web Service, and construct a request via XSL or a 'write' step.
The request portion of your studio will look something like the above. It's not all that different than calling a Workday Web Service, though there are a few things to keep in mind:
Create a report reference on your Workday-in, and point it to your report. Instead of a Workday-out-SOAP you'll use a standard http-out component and pass a reference in the 'Endpoint' property:
Add a WSSE Header to your request, using the $wss.usernametoken.username and $wss.usernametoken.password variables, so that your report is called with the credentials under which the studio is run. Make sure your integration user has the security needed for the report.
In your response chain, a validate step with an expression similar to the following can be used to trap SOAP faults:
parts[0].xpath('SOAP-ENV:Envelope/SOAP-ENV:Body/SOAP-ENV:Fault', 'SOAP-ENV http://schemas.xmlsoap.org/soap/envelope/') == ''props['report.hash.map'] = new java.util.HashMap()
props['report.hash.key.value'] = parts[0].xpath('/rp:Report_Entry/rp:Employee/rp:Employee_ID')
props['report.hash.map'].put(props['report.hash.key.value'], parts[0].text)2015 @matthewrichen mrichen.github.io/wdlearn/