Yes. My problem is solved. Basically you cannot use the standard data servers SAPMEWIP/SAPMEINT for your SQL queries in the MII transaction.You need to create new MII data server pointing to WIPPOOL (This should be defined as XA type under JDBC custom data sources in NWA) and then use this as a source for all your SQL queries inside MII transaction.
Hope this helps!
-Adarsha.K.S