We have just upgraded our env in our lab and wanted to do a PoC.
As a part of the task, we have created 2 partner profiles (Sender and Reciever) in our Trading network. We also created Document Types and Processing rules with two modes of delivery 1. API 2. Batch (Via ATS)
We, also, could successfully run the ATS → TN flow successfully. However, we are interested in knowing, if there is a way, we could start the same TN flow using an API.
We went through a tech community arcticle where it depicted how APIs can be added at partner and Partner group level etc but we couldn’t successfully access TN via an API hosted on the API GW as yet and need some guidance.
Please note that we have followed the steps mentioned in the following article:
Please let us know if we have to do something specific in our API routing policy in addition to what given in the article
wm.tn:receive is callable via HTTP – has been an “API” from the beginning.
You’ll want to consider creating your own TN entry point, rather than allowing other application to call wm.tn:receive directly. I think there are various threads on the forums that cover why that can be beneficial.
I totally follow the comment. But somehow, I am not able to send an XML (application/xml) over rest using restV2 resource. My service receives blanks. I tried with the document, object, string everything in the signature. while I can easily pass & process JSON documents.
My watt.server.http.xmlFormat is set as node by default.
I also agree with Reamon and call should be tried with either using invoke/wm.tn/receive or invoke/wm.tn.doc.xml/routeXml and with node object in the pipeline you don’t have to explicit mapping either…ofcourse must is Content-type=“application/xml” and post method.
Based on your suggestion, I tried to invoke/wm.tn/receive from Postman with content-type=application/xml but somehow TN isn’t able to receive the xml. Dont know if I need to do any watt setting to pass the XML correctly.
How are you checking your service to see if the XML is being received or not? To get XML into TN requires specific conditions, so you probably want to verify that your service is getting the XML first, without calling TN. Try to use nodeToDocument first or some other operation (XQL query) to confirm the XML is received. Then you can work out how to pass it as needed to TN.