I am a novice when it comes to TN… and in one of our requirements we are receiving an xls file from a partner (thru http). Due to some reason, we want this file to be routed through TN, but my understanding was that TN can handle only xml or flat files. Is there a way we can handle an xls file in TN?
Any help is greatly appreciated.
There are multiple ways you could approach this.
If you want the actual content of the Excel file to drive TN document recognition, you will have to pre-process it in a TN gateway service before delivering it to TN.
I have found the Apache-Jakarta poi library helpful for this purpose.
You could convert the entire spreadsheet to XML before it goes to TN. If you need to deliver an Excel spreadsheet internally, you can reverse the process, creating your own spreadsheet with poi on the other side of TN.
Although this approach requires a little more work than treating the spreadsheet as a “blob”, it allows you to expose the business content contained in the spreadsheet and process it with your webMethods environment.
Of course when I say the other side of TN, I really mean the other side of the Broker!
Thanks for your response… Im glad to know that I was thinking in the right direction. I already am using HSSF POI to process the excel files and convert them into xml… but just wasn’t sure that sending to TN after this pre processing is the right way to do it. Even now I am not sure that my understanding is correct… Let me know whether I am correct or not -
- I receive files through http invoke of a service configured on IS (6.1)
- The Service processes the incoming file and creates an XML out of it.
- Finally I send this XML to TN using routeXML or whatever service (I still have to do some study on how to route documents to TN).
- Have the TN do its thing - identify, extract and pre process/action.
Thanks for your help again Mark,
You’ve got the big picture.
You use routeXML instead of wm.tn:receive in order to bypass authentication checks. This assumes you are controlling access at the gateway service or earlier.
When you define the TN document type, there are two sets of XML queries you will create:
The first set on the identify tab identify the document.
The second set on the extract tab identify which XML elements to extract the sender, receiver, and document id attributes that drive the selection of a TN processing rule.
The service that your processing rule invokes can convert the document to a canonical and publish it to the Broker. You will get more value from TN if you make frequent use of the wm.tn:log and wm.tn.doc:changeStatus services through conversion to canonical format and publication to the Broker. This will make it easier to track the processing history for the document and re-submit if an error occurs.