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.  Set a Node Value does not commit?

    Posted 06/12/01 09:16 AM

    Hi friends,

    I wanted to set value spike:project to “testing”, in the following xml. the System.out.print prints right result (please refer to my java code after xml) but when I check on the actual database, it is not set, any advise would be very much appreciated.

    My Xml file:


    rdf:RDF
    rdf:Description
    dc:titleF1 testing</dc:title>
    dc:descriptiontesting at 6:44</dc:description>
    spike:clientToyata</spike:client>
    spike:projectF1 Prototype</spike:project>
    spike:departmentSystem Integration</spike:department>
    spike:ownerAlan Huang</spike:owner>
    spike:methodologyJSP methodology Testing</spike:methodology>
    </rdf:Description>
    </rdf:RDF>

    The following is the Java Code:

    import java.util.;
    import org.w3c.dom.
    ;
    import com.softwareag.tamino.API.dom.;
    import java.sql.
    ;
    import java.text.*;

    public class testupdate {

    public testupdate() {
    }
    public static void main(String args) {

    try {
    TaminoClient tamino = new TaminoClient( “http://au1rdv6/tamino/KMS/knowledge” );

    tamino.setPageSize(5);

    tamino.startSession();


    TaminoResult tr = tamino.query(“/document[@ino:id=11]”);
    Document doc = tr.getDocument();
    while(tr.hasMoreElements()) {
    Element el=tr.getNextElement();
    System.out.println(el.getElementsByTagName(“spike:project”).item(0).getFirstChild().getNodeValue());
    el.getElementsByTagName(“spike:project”).item(0).getFirstChild().setNodeValue(“testing me project”);

    }
    tamino.commit(true);
    tamino.endSession();
    System.out.println(tr.getDocument().getElementsByTagName(“document”).item(0).getAttributes().getNamedItem(“ino:id”).getNodeValue());
    System.out.println(tr.getDocument().getElementsByTagName(“spike:project”).item(0).getFirstChild().getNodeValue());

    }
    catch(Throwable th) {
    th.printStackTrace(System.out);
    }

    }

    }


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: Set a Node Value does not commit?

    Posted 06/12/01 12:59 PM

    Hi,

    to me it seems there is missing a call of the update() method of the TaminoClient instance, right before you .commit() it.

    Is that right?

    Regards,

    Andreas


    #Tamino
    #API-Management
    #webMethods