Transforming xml attributes

We get a custom XML in TN. The XML has a sender-id and an id-type (qualifier).

When doing a transformation, TN expects us to hard code the “id-type” of sender-id (DUNS, Mutually Defined etc).
It does not allow me to dynamically assign the “type” using the id-type field in the XML.

Has anyone achieved this before? Help appreciated.

Thanks,
Vikas.

you can use service:
wm.tn.profile:getInternalID to get the right profile.
check webMethods Trading Networks
Built-In Services Reference for detail

I am not sure how I would use wm.tn.profile:getInternalID. After we routeXML, the TN engine needs to recognize the sender and receiver. To do that we have to set the document attribute senderID using an xquery. If my ID was always DUNS, this was no problem. I can set the transformation to DUNS and I am done. But my ID type is dynamic and its value is provided in the same xml.

So you mean to say, you have multiple external id’s (duns,mutually defined etc) for same partner and you want them dynamically assgin it while transformation right?

Can’t you use getExternalID in your flow or maintain some way in a custom table and retrieve from using the key you said in the XML?

HTH,
RMG

Precisely.

The problem is that I don’t get a handle on the bizdoc before the TN engine does its pre-processing (before even the processing rule). The only service that can possible get invoked is the transformation service. That transformation service only gets the xquery in “values”, isArray and arg (wm.tn.rec:StringAttributeTransformService).

One way I could do this is by parsing every different XML structure before I route to TN and identify the sender and receiver ID. But this will be a nightmare as there are many different XML documents being exchanged.

I am not sure if there is any easy way around unless you parse the original XML and retrieve the identifier for dynamic look up.