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.  Update problem!!

    Posted 09/18/02 01:56 PM

    who can give me one Update example program code.

    this is my XML Document:
    <?xml version="1.0" ?>

    <order_number>1</order_number>


    <com_name>CYUT</com_name>
    <com_id>11</com_id>
    <com_div>Marketing</com_div>
    <com_add>168, GIFeng East Road Wufeng, Taichung County, Taiwan</com_add>
    <com_tel local=“(04)”>23323001</com_tel>
    <com_fax local=“(05)”>23323002</com_fax>



    if i want to update element “com_name” vlaue,use dom4j.
    my system :apache+tamino


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


  • 2.  RE: Update problem!!

    Posted 10/02/02 11:43 AM

    This is an example of how to do updating:
    ==================================================
    /import classes/
    import org.w3c.dom.;
    import com.softwareag.tamino.API.dom.
    ;
    import com.docuverse.dom.*;



    TaminoClient tamino=new TaminoClient(“url of your database”);
    tamino.startSession();

    TaminoResult tr = tamino.query("Order[order_number=“1”]);

    if (!tr.hasMoreElements()){
    //do something here if result is not found
    }else{
    Document doc = tr.getDocument();
    Element order = (Element)tr.nextElement();
    Element eComName = (Element)order.getElementsByTagName(“com_name”).item(0);

    eComName.getChildNodes().item(0).setNodeValue(“new value”);
    tamino.update(order);
    tamino.commit(true);
    tamino.endSession();


    ==================================================

    Hope this helps! :slight_smile:


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