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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Another Update Problem!

    Posted 08/29/02 07:55 AM

    my codes:

    public static int GetUniqueID(String dbURL)
    throws Exception
    {
    TaminoClient taminoClient;
    TaminoResult taminoResult;
    taminoClient = new TaminoClient(dbURL);
    taminoClient.startSession();
    taminoResult = taminoClient.query(“*”,“UniqueID”);
    Document doc = taminoResult.getDocument();
    String id = DOMWrapper.getDOMElementTextByTagName(doc.getDocumentElement(),“UniqueID”);
    System.out.println(doc);
    int UniqueID = (Integer.parseInt(id.trim())) + 1;
    Element element = (Element)doc.getElementsByTagName(“UniqueID”).item(0);
    element.getChildNodes().item(0).setNodeValue(id.valueOf(UniqueID));
    System.out.println(element);
    TaminoResult tr = taminoClient.update(element);
    System.out.println(“result:” + tr.getDocument());
    taminoClient.endSession();

    return 0;
    }
    }


    console info:

    <?xml version='1.0'?><ino:response xmlns:ino=‘http://namespaces.softwareag.com/tamino/response2’ xmlns:xql=‘XQL FAQ (XML Query Language - Frequently Asked Questions)’ ino:sessionid=‘11’ ino:sessionkey=‘12548’>xql:queryUniqueID</xql:query><ino:message ino:returnvalue=‘0’>ino:messagelineXQL Request processing</ino:messageline></ino:message>xql:result
    0
    </xql:result><ino:cursor ino:count=‘1’><ino:first ino:href=‘?_XQL(1,5)=UniqueID’></ino:first></ino:cursor><ino:message ino:returnvalue=‘0’>ino:messagelineXQL Request processed</ino:messageline></ino:message></ino:response>

    1

    result:<?xml version='1.0'?><ino:response xmlns:ino=‘http://namespaces.softwareag.com/tamino/response2’ xmlns:xql=‘XQL FAQ (XML Query Language - Frequently Asked Questions)’ ino:sessionid=‘11’ ino:sessionkey=‘23136’><ino:message ino:returnvalue=‘0’>ino:messagelinedocument processing started</ino:messageline></ino:message><ino:object ino:collection=‘ino:etc’ ino:doctype=‘UniqueID’ ino:id=‘1’></ino:object><ino:message ino:returnvalue=‘0’>ino:messagelinedocument processing ended</ino:messageline></ino:message></ino:response>


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 2.  RE: Another Update Problem!

    Posted 08/29/02 09:32 AM

    You didn’t specify the problem.
    If it is that the document is stored in ino:etc instead of be updated in your collection, then I think you must use another “update” method like:
    update(org.w3c.dom.Element element,
    java.lang.String collection,
    java.lang.String doctype)

    The reason is that you don’t include the collection in the dbURL (so you use “query(query,collection)”) and then at update time, the collection is missing.

    Regards.

    [This message was edited by Juanjo on 29 Aug 2002 at 08:36.]


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 3.  RE: Another Update Problem!

    Posted 08/29/02 12:17 PM

    Thank you :slight_smile:
    I need a UniqueID for each of my Issues,u have solved my problem. update successfully.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management