Canbt get TN to recognize document in the pipeline

OK, so there’s this document in the pipeline, and … :slight_smile:

Well seriously, there is, and it appears to be exactly as it’s expected. I need to provide this document as input to a service that’s set up as a TN Processing Service (expects a BizDoc). So I’ve tried lots of ways to get the document from the pipeline, through TN, and on to my target service (pub.client:http, wm.tn:receive, wm.tn.doc.xml:routeXML, etc.). In most cases the problem is that I end up with an unrecognized DocType (Unknown). The Content tab in the TN transaction shows my document exactly as it should, but doesn’t recognize it. Anyone have an idea what I could be missing? TIA.

Mike Rossi

Most likely you’re missing the:
<?xml version=“1.0” encoding=“UTF-8”?>

at the top of the file. TN needs this.

Will

Thanks Will, you’re right. I am missing the XML declaration. I guess I assumed that since I created the record (ah, DocType) from an XML schema … Anyway, I’ll have to debate the merits of adding this to the DocType (also used by other services) or just mapping it into the document in my flow. If I add it to the DocType, should it just be a string with any name containing the declaration, or does it have to be given a certain name?

Cant we specify the property isXML as true and that way TN will recognize the xml document even without the <?xml> header?
Thanks

Michael: Normally you don’t have to worry about the header. Since you said you created wm schemas and records, when you do a recordToDocument, webmethods defaults the ‘addHeader’ input parameter to ‘true’. It’s usually only an issue if you create your own XML string and then send it to TN without this header.

Vinod: It sounds like you’re using stringToDocument before sending to TN. If you’ve created your XML manually you have to add it yourself. External partners must do the same. If you generate your XML or node from an IData record you won’t have to add the header. wm does this for you.

Will

Vinod,
Where (in what service) would I specify the isXML property? Thanks.

OK, so the XML Declaration may not be the problem after all. But here’s my dilemma. My service is initially invoked by TN upon receipt of the appropriate document type. I transform this document and need to send it off to another service that expects to be invoked from TN. So what’s the best way to get the transformed document through TN?

Object types seem to be very confusing in 6.01 coming from a 4.6 environment. Both receive and routeXML seem to expect a “node” object that’s an instance of class ‘document’, so no strings here. But recordToDocument (a 4.6 leftover) outputs a string. pub.client:http accepts a string, but for some reason TN seems to be tripping on the XML Declaration created (automatically) by recordToDocument. So what conversion would I need to perform to get routeXML or receive to accept a 4.6 record?

There were some bad names used in 4.6 for XML/Node services. But essentially you’ve always had many options for getting a doc into TN from within an IS flow. When TN calls your flow it hands you a bizdoc. Then you usually call bizdocToRecord. Then you map from the record reference to another record of a different type, call recordToBizdoc and then you can call wm.tn:submit.

I’ve also converted a string to a Node (stringToDocument) then called wm.tn:recognize and then wm.tn.route:routeBizdoc. In 6.0.1 it’s xmlStringtoXMLNode.

You could call stringToDocument, then wm.tn:receive which would act like an external client (doing the security checks).

You could do an HTTP post of a string to wm.tn:receive as well. Just make sure you match the input parameter types for the TN service you invoke.

Will

Allright! Now we’ve got it! It turns out that (for some reason) I had to use recordToDocument to turn my record into a string and then xmlStringtoXMLNode to turn it into the proper type for routeXML (or receive or whatever else takes a node). Thanks for hanging in there with me Will!

BTW - is it possible to go right from a record to an XMLNode (without the string in the middle)?

Glad it worked for you. If you want to avoid the ‘string in the middle’, you could convert your record to a bizdoc (wm.tn.doc.xml:recordToBizdoc) then call wm.tn.route:routeBizdoc. No need for a node or string!

Will

Well I wish it were so, but in my case that didn’t work. I tried it and always got hung up on recognize. This is one of the things that was driving me batty. The only thing that’s worked for me so far has been record to string, string to node and then routeXML. Maybe I’ll get ambitious and try to figure out why, but not tonight :-). Thanks again.

I am getting the following error when I am using routexml service to identify TN.
[B2BCORE.0049.9010] Failure invoking unknown service at ‘unlabeled INVOKE’. The service may have been renamed, moved or disabled.
Can anybody help me on this immediately.

Hi,

Check whether the WmTN package is disabled? If it is disabled, enable it.

Regards,
kalyan

Hi Kalyan,
Thanks . But I checked WmTN packege is enabled only. Is there anything / anywhere else I need to check.

Regards
Pavan

kasavaraju,
Check if your TN is working and try to refresh the wmTN package.