document comparision

Hi All,

I am trying to find the difference in data between 2 documents. These 2 documents have same structure. They differ only in data.

Right now I am converting these docs to respective Strings as name=value pairs with a delimiter, using a custom Java service and then doing a string comparision.

I guess there should be a better way of doing this. Please guide.


You can do this with a Java service. You need to use webMethods API. I had done this a while ago. I wagely remember it. If you see the API and start using the methods you can write this java service.

You need to use IDataCursor class and its methods. Typically you will send two documents as input to this service.

  1. Create two IDataCursor objects
  2. Use next(), getValue() and hasMoreData() methods to achive this.
  3. Traverse thru the first object and get value for each element and compare with the second object’s value in do/while loop.

Hope this Helps…


If appropriate, you might try using the pub.xml:documentToXMLString in the WmPublic package. You can convert the data to XML and then shunt it off to a file or whatnot. Once it is in XML any number of standard tools will help you parse and compare it.