Now that we’ve gone thru the basics of invoking a Web Service from within DataStage we can cover some of the more interesting stuff. Here are some guidelines and best practices for using each of the capabilities within Web Services Pack, whether it’s a Web Service Routine (Server) or WSClient or WSTransformer Stages.
These are Server side Routines (create via Import Web Services Function Definitions after you’ve imported the WSDL). Nice because they can be included directly in a Transformer. Of course, that also means that they are not as visual.
- Better for Boolean WS invocation (getting back a true/false) when used in the Constraints of a Transformer.
- Better for when you are calling many Web Services conditionally, or in conjunction with each other, for many columns within a link.
- Best when used with RPC style Web Services
- Best for single output argument, one or more input arguments
- Great for quick testing/prototypes, particularly because of the “Test” function within the Routine editor.
NOT so easily used when:
- Proxy is needed
- Multi-argument out is needed
- Complex XML or array output is needed
- Web Service has a void input message
(these can be done in Routines, but not without difficulty. These really only should be handled in the WSTransformer, where there is a lot more flexibility and support for things like security and proxy)
WS Transformer Stage
Best for single invocations (one call needed per row for a particular service)
Complements the graphical design metaphor
Best when proxy or security options are needed
Consistent for both RPC or complex output scenarios
More easily hack-able for extracting SOAP bodies/envelopes, etc.
Try to always Load link meta data via the Message Load button and NOT via the Column grid load button, especially when you are first using the Stage.
BEST PRACTICE: When first building a job with WSTranformer (or with WSClient, for that matter, connect ONLY empty links to your WS Stage [ie….don’t ‘carry’ meta data from some other plugin over to the WS Stage] and LOAD the meta data only from your imported WSDL!!!!!!). One easy trick is to always surround a new WSTransformer with standard transformers…you can always remove them later once you have things working and you are aware of the behavior of the job and the Service.
WS Client Stage
- Designed for single call (target or source) functionality
- As a source, is easily driven by Job Parameters
- Easiest for void input message signatures (when used as source)
- Easiest for void output message signatures (when used as a target)