Get Document Type Name during runtime

Hello Experts,

I hope you can help me with my problem. I am using webMethods 6.1 and I have built a service that will convert the contents of a document into XML string and save it to an Oracle database. I now have to write a service to retrieve the XML string from the database and convert it back to a document and then publish it. The only problem I have is that I don’t know how to get the documentTypeName (dynamically) which is a required field for the publish step.

These services have to be able to handle different document types.

I was thinking that I could get the document type name dynamically at the start and insert it into the database as a varchar, then I can retrieve it and publish the document.

I’ve been reading and searching for 2 days now but I still can’t find what I need.

Thanks in advance for your help,

Xochi

I was thinking that I could get the document type name dynamically at the start and insert it into the database as a varchar, then I can retrieve it and publish the document.

Can you tell us where you got stuck in the flow?

When you are inserting the XML string to database at that time itself store the corresponsing docType and some ID,and later retrieve the doctypename,xmlstring using the ID before publishing.So that you will have some hold while publishing the corresponding document.

HTH,

Hello RMG,

Thanks you very much for your reply. I am essentially looking for a way to get the doc type name of a document given just the document object itself. I want my service to take any document as input and save it as XML to the database together with the document type name. If possible, I want to be able to extract the doc type name(namespace) of the document from the document itself and not have the calling service supply it explicitly.

I am also searching for such a service …
Did you find any way to get the document type from the document object ?
maybe using the Java API (IDataUtil, etc) …

Hi,

There is a service in WmPublic “pub.xml:getXMLNodeType” which gives you the root node, namespace etc of the document.
For e.g, if the following xml is converted to node using “pub.xml:xmlStringToXMLNode” and by calling “pub.xml:getXMLNodeType” , you get “inv” as the root node.

<?xml>
<inv>
<invheader>
</invheader>
<invdetail>
</invdetail>
<summary>
</summary>
</inv>

I think that you are looking for this. If I wrongly understood you then excuse.

Regards,
Kalyan