Tips for WSPack Part III: Best practices and Guidelines

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.

WSRoutines

 

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)
Advertisements

5 Responses to “Tips for WSPack Part III: Best practices and Guidelines”

  1. Arindam Says:

    Hi,
    I’m preety new to Web services in DS. I need to integrate with SalesForce from DS. Am not able to send XML chunks, used for bulk upserts, to the WS tranformer. I’m getting Java null pointer exception if I give a XML element as a parameter to the transformer.
    Thanks

  2. nagaraju Says:

    From your post:
    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)

    But i am getting error if i use void input arguments,

    CustomeContractList..Sequential_File_18.IDENT1: com.ascentialsoftware.wsclient.ServiceInvocationException: Service invocation exception:
    ns1:HTTP
    (404)Not Found

    return code: 404

    at com.ascentialsoftware.wsclient.OperationCall.handleRemoteException(OperationCall.java:369)
    at com.ascentialsoftware.wsclient.OperationCall.invoke(OperationCall.java:274)
    at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1685)
    at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1591)
    at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1544)
    at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:104)
    at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
    at com.ascentialsoftware.jds.StageFactory.runSource(StageFactory.java:335)

  3. John Says:

    Hi Ernie – Question on ISD Load balancing – If I have multiple engine servers, and one Services Tier with ISD running, will ISD load balancer spread the requests across the engine servers, and is this true for an “always on” job as well?

    • dsrealtime Says:

      Hi John. The answer is “yes”. This assumes, as you noted, that you have two individual “engines” in your Information Server domain, that both are available as Information Providers as configured in the Info Server Console (the ISD “client” tooling), and that you have properly migrated (via .dsx usually) the DataStage/QualityStage job to both server engines and compiled it. The “logic” for the load balancing is noted at the Operation page of the ISD deployment client, and can be round-robin or algorithm. I have found round-robin to be the most effective method. The way you actually get them both to be part of the service is at the “deployed application workspace” where you will see the option to “add additional providers”. It is a valid strategy for both standard and “always on” services based DataStage/QualityStage Jobs.

      Ernie

  4. sri Says:

    Hi Ernie

    Thanks for your help
    I have used the Webservices transformer to invoke the web service. It is a simple. I am not sure why it is giveing the following error.
    Web_Services_Transformer_5,0: Fatal Error: Fatal: 0026`:`com.ascentialsoftware.wsclient.ServiceInvocationException: Service invocation exception:
    at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1602)
    at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1544)
    at com.ascentialsoftware.wspack.Transformer.process(Transformer.java:105)
    at com.ascentialsoftware.jds.StageFactory.runStage(StageFactory.java:544)
    at com.ascentialsoftware.jds.StageFactory.runTransformer(StageFactory.java:361)
    Caused by: java.lang.NullPointerException
    at com.ascentialsoftware.wsclient.xml.DerivationParser.match(DerivationParser.java:622)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.element(DerivationParser.java:367)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:271)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:293)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:293)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:293)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:293)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.segment(DerivationParser.java:208)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.expr(DerivationParser.java:171)
    at com.ascentialsoftware.wsclient.xml.DerivationParser.parse(DerivationParser.java:138)
    at com.ascentialsoftware.wsclient.xml.TreeBuilder.compileRules(TreeBuilder.java:84)
    at com.ascentialsoftware.wsclient.MappingHandler.fromArray(MappingHandler.java:304)
    at com.ascentialsoftware.wsclient.InputRequest.buildRequestBodyDocument(InputRequest.java:908)
    at com.ascentialsoftware.wsclient.WebService.callServiceInternal(WebService.java:1625)
    at com.ascentialsoftware.wsclient.WebService.callService(WebService.java:1591)
    … 4 more


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: