How to handle incoming XML docs with different namespaces

Hi there,

just want to say Hello. I am new to the webMethods community. I joined because I thought I could get som help here with the Integration server. Well, actually I work with the SAP Business Connector 4.7 which I believe is the same thing as webMethods integration server.

Probably will be out of here soon, since in the SAP world the do not support new development on the webMethods platform.

By the way, does anybody know how to handle incoming XML invoices, with different namespace names. It is the same invoice (following the Danish OIOXML standard) and should start with <Invoice xmlns=…, but some people write <pie:Invoice xmlns:pie=… and then some write <ns0:Invoice xmlns:ns0=…

This gives me problems when reading in with the documentToRecord service.

How to handle that?

best regards BennyBA

Hi Benny,

I had the same problem where I was getting different prefixes from different applications/clients so to solve it I simply use the xmlNodeToDocument service to convert the SOAP Body into document and then Map whatever I needed from the SOAP msg. I won’t say this is the best way to overcome this problem but thats what I used.

See this thread for a similar issue. In short, read the docs on the nsDecls parameter and use that to accomplish your objective of processing equivalent XML documents with different namespace prefixes.

Mark

One more thread for reference…

[url]wmusers.com

  1. How can we get prefix and namespace out of source xml to validate them?
    Solution : convert xmltoNode then query xmlnode.
    namespace = //namespace() (XQL)
    prefix = //prefix() (XQL)
    This will give you original namespace and prefix in pipeline as variables. Now you can validate prefix in you list of valid values.

  2. Validate document against document your document created from Schema.
    Solution : You would have document created from schema with ns: prefix and with original name space. Now when you convert your incoming xmlnode to document set nsDecls name=ns value= %namespace% (which is original incoming namespace from xmlfile). This will create incoming document with ns prefix, now we can validate against our webMethods document.

Hope this helps…

Cheers,
Ajit