IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  document comparision

    Posted Wed March 28, 2007 04:26 PM

    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.

    Thanks
    Sateesh


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: document comparision

    Posted Wed March 28, 2007 08:51 PM

    Sateesh-
    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…

    Rajesh.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: document comparision

    Posted Fri March 30, 2007 03:15 AM

    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.

    !!!
    -greg


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods