submit to TN via File Polling

Here is my process

  1. WebMethods creates my xml invoices
  2. I wait for a .tif file
  3. The files are moved to a folder for sending when both the invoice and tif exist
  4. I have a service that will be ran daily looking for files in the folder and confirming both files exist.
  5. I am using pub.file:getFile to retrieve the file(loadAS) tried both stream and bytes
  6. wm.tn.doc.xml:recordToBizdoc - to get the body
  7. wm.tn:submit - submit the document

I have TWO problems

  1. the document, sender and reciever are all unknown
  2. I am unable to see the contents of the file

The service wm.tn:submit does not do the recognition part - it assumes that the document is already recognized. Use wm.tn.doc.xml:routeXml instead which recognizes the XML and submits it for processing.

Since routeXML takes xml node as an input, use documentToXMLString and xmlStringToXMLNode in conjunction to get xml node from your xml document - if your invoice is an IS document or just xmlStringToXMLNode if the invoice is just an xml string.

Hope this helps
~Rohit

Can you comment on best practice

  1. Schedule this to run once a day list files and sending

or

  1. File Poller that pulls the file looks for .tif then processes it

I am really kind of lost on the approach to take.

As always a big thanks
Cheryl

In general I think the scheduled task would work better since processing has to wait until 2 separate files are present. You have more control over how the file is handled. You might want to see [thread=9950]this[/thread] thread which discusses a similar situation.

Tim

Scheduled task it is… Thanks for the article.

I have been fighting all day with getting my document sender reciever recognized. My process includes

  1. get File
  2. xmlStringToXMLNode
  3. routeXml
    on side note…
  4. I do have a document set up
  5. I do have the trading partner set up

My xml data is making it to TN as Unknown Unknown Unknown. I can see the xml data and it looks great.

I notice that routeXml has two services in it
recognize
routeBizdoc

I do not see a way to set TN_param sender and reciever data like you would in a flat file. Can someone tell me what I am missing?

Thanks in Advance
Cheryl

More specifically after recongnize bizdoc loses the Sender Reciever Document
setting.

In the TN Document Type that you have setup for your Invoice, check if the document identification is properly set and also double check the extraction queries SenderID and ReceiverID for that Document type. Then resubmit the data to TN using routeXML and see if it works.

I am pretty sure you would find your solution in one of the above.

~Rohit

Reason for your unknown recognizition is because it is TN defaultrule is selected.Are you sure your TN setup (profiles,externalid’s,documenttype recognition,processing rule are confirgured properly??).Please make sure step by step and see whats going on in the Activitylog/IS logs.

Rohit’s comments above are also pointing in the same direction.Pls check the same.

HTH,
RMG

Cheryl,

If your document, sender, and receiver are not getting recognized, then first focus on figuring out why the document is not getting recognized. If TN can’t recognize the document type, then it definitely won’t recognize the sender/receiver, since sender/receiver identification queries are stored in the document type definition.

I suggest opening the TN console, going to the Document Types screen, and using the “Test document types” button to run your XML through. If a message comes back saying “1 Document Type found”, then you know that something your service is causing the problem. Otherwise, you’ll probably have to change your document type defintion (ie. the Root Tag and/or identification queries).

  • Percio

Okay, let’s take an example… assume your xml looks like the following:
<?xml version="1.0"?>

110022333
66999665
110022333-c0a87a66f70d6a8b0015d850-Product Provider
110022333_d6a8b0015d850R_Request.rno
WmUsers-Member

<RNET_TransactionId>TXN-ID-EXAMPLE</RNET_TransactionId>
Request
REGISTRATION-NUM
DEBIT-NO
000000009385.21
0001
INVOICE-NUM-102562
2006-11-17 08:09:18
0000095
ROSETTANET
Quote-Num-102562
40-TrackNum
CUSTOMER
USD
D


Now, in the TN Document type for above XML, the identification can be based on the Root Tag - ie,
Root Tag = DesignClaimRequest

The SenderID Query (under Extract tab) should be set to
DesignClaimRequest/SenderID and

The ReceiverID Query (under Extract tab) should be set to
DesignClaimRequest/ReceiverID

Besides, let’s say you want to extract RNET_TransactionId, the query for that would be:
DesignClaimRequest/DesignClaim/RNET_TransactionId

So you see, you have to set an identification criteria that uniquely identifies your document and then, you set up extraction query, which is the path of the attribute in your XML, to get the attribute(s) that you want to extract.

HTH, Rohit

Thanks to all who have so patiently helped me.
Percio… I had no idea you could test a document thanks for the tip.

I have it recognizing the document type but something is WRONG.
(PIDX 1.0)
root tag Invoice
It finds the document type and handles it

HOWEVER
If any identifying queries are added via the Test Query it STOPS working.

My thinking is… In document set up if I load the file, Test the Query, and have the program insert the Identifying Query when I test that same document IT SHOULD WORK. But is isn’t

attached is the document I am trying to process… I will continue to look into this.

Cheryl
34072330.FRST.200611150952.zip (1.63 KB)

Cheryl,

Q1: What is the identifying query you are tyring to use?
Q2: Do you really need an identifying query? In other words, will there be more than one document type that have the root tag Invoice?

  • Percio

Chill,

I believe the root tag should be "pidx:Invoice"?? and not just Invoice as per your PIDX XML document.Did you tried this??What is your current identifying queries set to Sender/Receiver/DocumentID etc…recognition??

HTH,
RMG


I suspect that the identifying queries may be failing due to namespace issues. Make sure you have the namespace stuff configured in your doc type, if you want to use identifying queries instead of just the root tag.

It is the namespace.

You all have been a tremendous help in giving me useful knowledge/tool and solving this issue.

Sincerely

Cheryl

As always this was great quidance. Thanks

As always this was great guidance. Thanks

This is a great example. I have a couple of questions.

  1. The xml I am receiving has no dtd or xsd associated with it. Does this matter?
  2. It has no <?xml version="1.0"?>. Does that matter
  3. In XML spy it is a well formatted document. I can query the document in TN but when I run the document not document type is found.

FYI…In general any XML document must/should have this tag starting with <?xml version="1.0"?> otherwise even xmlspy or any other product cannot validate or consider it as proper XML doc nor be well formed.

HTH,
RMG