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

TResponse:getFirstXMLObject:getDocument not org.w3c.dom.Doc

  • 1.  TResponse:getFirstXMLObject:getDocument not org.w3c.dom.Doc

    Posted 05/29/07 12:05 PM

    Hello everybody!

    I make a query and the result is returned in a TResponse object. From there, I take the firstXMLObject and then I make a getDocument to returned (as specified) a org.w3c.dom.Document.
    The problem is that the return of the “getDocument()” method is NOT a org.w3c.dom.Document but a DeferredDocumentImpl…

    Can someone help me to get this Document in the right “format”???

    I use :

    • tamino v 4.4.1
    • sunOne 6.1
    • jre 1.5

    Here is the code I use:

    
    try{
    TConnectionFactory connectionFactory = TConnectionFactory.getInstance();
    TConnection connection = connectionFactory.newConnection("http://myserver/tamino/mydb/");
    
    TAccessLocation accessLocation = TAccessLocation.newInstance("forms");
    TXMLObjectModel objectModel = TDOMObjectModel.getInstance();
    TXMLObjectAccessor accessor = connection.newXMLObjectAccessor(accessLocation, objectModel);
    TResponse response = accessor.query(new TQuery("form[(@owner='admin')]"));
    connection.close();
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document document = db.newDocument();
    if(response.hasFirstXMLObject()){
    document = (Document)response.getFirstXMLObject().getDocument();
    }
    }catch(Exception e){
    e.printStackTrace();
    }

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