Wednesday, August 01, 2007

Informatica PowerConnect for Webservices

I started working with Informatica powerconnect for webservices with Informatica version 8. I was mighty disappointed to see that the infromatica manual said very little about how to use the transformations. The web wasn’t of much help either. Lots of trial and error, figuring around and hours of calls with Informatica support finally got our mappings working the way it had to. More because the webservice we were calling were rather complex, but even with a far simpler webservice it still is a herculian task getting the thing to work without help.

This article is written with the assumption that the reader has gone through the Informatica manual related to power connect for web services.

We can use powerconnect as a source, target or consumer transformation. The chance that you use as a consumer transformation being the highest I will talk mostly about that.

You start with using a WSDL file that the webservice provider has given you. Most probably this would have been provided this on their website. The wsdl file is like a dictionary that has all the information of the operations that the webservice provides the URL to the soap requests and so on.

In Informatica if you select consumer transformation it takes you to a import WSDL pane. Browse to the point where you have the WSDL.

There is on tricky option here that turned to be of great importance in my experience. The webservice that I was calling was returning images in binary format. The werbservice was failing with base64binary conversion error. Eventually it turned out this was because I had to set the field lengths of ports very high since the data stream was very long.

Click on advanced options to override field lengths if you are expecting long strings of data.


Select the operation you need to use in the next window.

After you have done this step you are presented with a window which gives you an option to use entity relationship or hierarchy relationship for your xml view of the webservice transformation.

This is another area I found tricky. Heirarchy relationship gives issues unless you are using every group of input ports. I found using entity relationships better when you don’t plan to use all input groups.



You are now presented with the consumer transformation in its xml view in the mapping. You can see there are different groups of input ports. Each group has its own primary key. Make sure you provide a sequence generator to the primary keys in each of the group you are using.

Each group is related to another with foreign keys. So make sure you connect the sequence generator output of the groups primary-key to the other groups foreign-key.

Eg:

If you have two groups, envelope and body.

Envelope has primary_key

Pk_envolope

Body has a primary-key pk_body and a foreign-key fk_body_envolope.

Connect a sequence generator output to pk_envolope of group envelope. Connect the same sequence generator to fk_body_envolope in group body.

Connect a different sequence generator output to pk_body in group body.


Once you have connected all input and out fields as required you are all set as far as mapping development goes.

When you configure session for webservice, create a “Application connection” with username and password as the webservice provider expects.

Its likely the webservice fails (mine got me working on it for 3 days before it started giving me outputs the way I wanted) the first time you run it. The easy way to analyze errors is to set the override tracing in session to verbose data. This way the soap request and soap response is visible in xml format. There would be a fault message embedded in the SOAP response that tells you what the issue is.

Above all this Informatica Support turned out to be quite helpful in resolving our issue.