Trading network access via API

10.15

Hi guys,

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

Regards

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.

2 Likes

Hi,

one reason is, that you can protect you own entry points with custom ACLs while wm.tn:receive is protected by a central “TN Users” ACL.

See TN Users Guide and/or TN Built-In-Services Reference for details.

Regards.
Holger

1 Like

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.

Please help. This is a bit frustrating.


Thanks

Have you tried using the invoke directive instead of restv2? I’m not sure using restv2 provides any value in this case.

http://yourhost.com:5555/invoke/tradingNetwork/receive

Tried INVOKE too but still the XML isnt passed to the service :frowning:

Can you share what you’ve done to determine the state of the pipeline when the service is called? What is the response being returned?

Hi Dhiraj,

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.

HTH,
RMG

Thanks guys.

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.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.