I have to describe my business model in order for any to understand the problem I am facing.
We are trying to integrate diffrerent servicing systems(mainframes). The gateway is a framework service that exposes the services on those systems as web services. We import the WSDLs into webMethods Developer and that generates us with a large XML document to use with that service.
We are getting the data from a database and then converting that into or forming into an IS Document . After that we map that IS doc to XML doc.
As there are 1000s of mapping for each web service, I was wondering if there’s an easier way to map from one document format to another. Having different structure and element types. Or we have continue map all the elements manually.
Thanks, I will appreciate your response.
Hi Net Civilian,
Does your XML doc follows any standard/schema like Rosettanet, xCBL…? If it is a plain flat XML, get the data ifrom DB, then have the data in the IS document which is of same structure as XML and then call IS service to convert it to the XML Data.
Hi Net civilian,
You can use ‘pub.xml:documentToXMLString’ service to convert document to xml format.
The problem is not that I don’t know how to convert a document into an XML string. The problem is mapping between large documents which have different structures and also the elements are also different.
For example, lets say one document is a OAGIS spec and the other ebXML or custom enterprise XML.
I wanted to know if I can script the mappings between thousands of elements or some how automate it.
Transformation from one standard format to another is one of the primary uses of Integration Server. Some eStandards “adapters” may have built-in services to help process various documents, but would not likely have services to transform from one eStandard to another.
You can build Flow services that do nothing more than map from one format to another. If you build them correctly you can reuse them any time you need to transform a particular document (an invoice for example) from one format to another.
Be sure to create your document types either from those included with the eStandard adapters or from XML schemas provided by the eStandards authors. Create your Flow services to accept one format and output the other.
Building the map statements may be tedious, but if done properly, you will only need to develop and test the mapping services once assuming you are using stable standards.
My suggestion is to also develop unit tests for each transformation service that can be used to confirm that the output of your service matches exactly an expected result. Build the test case first, then tackle the transformation service section by section until it passes the test case.
Thanks Mark for the insight.
I am currently doing the same as you have mentioned. But the problem is that the XML Schema changes for every other web service the business expose. i.e., they include new doc types and elements to complement the exposed services.
With hundreds of services and 1000s of mapping for each those services I was just wondering if there’s a better way to deal with this problem and create re-usable tranfomation services that only map from one document format to another. Like scripting or automating the mappings according to the requirement.
Have you ever been in this problem before? And How do you with the changes in XML Schemas. Because as far as I know you have to redo the mapping if the Schema changes. Please correct me if I am wrong.
If i understand your problem correctly, you want to know what schema the XML conforms to at run time and do your mapping accordingly. For this purpose, you could use the pub.schema:validate java service under WmPublic to find what schema it matches.
A pre-requisite would be to create document types for each standard or shema that your application supports in some folder, lets say ‘rec’.
You can use either of the methods after that :
Create a properties file which will contain the fully qualified name of each doucment created, for example, <schema_name> = rec:doc1. When you get an input XML in your flow service, loop through the properties in the properties file and check to which document type it conforms using the pub.schema:validate service(which in turn means which schema).
You need to create a master document before hand which can will have elements as document reference to each of the documents created. Set the Required property of each of these elements to ‘false’.
Pass the xml node which you passed to pub.schema:validate service to pub.xml:xmlNodeToDocument. Map the output of this service to the master document. Check each of the elements in the master document to check if it has a value. You can know which doument type it corresponds to (which shows the schema).
After getting the document type name, you can have set values of variables to appropriate elements in the map. I hope this simplifies your problem.