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.

 View Only
  • 1.  Quip 2.1.1 Java API

    Posted Thu March 28, 2002 12:43 PM

    Hello.
    I checked out Quip 1.6.1 version via Java API . That version seemed good to use and was provided with Java API documentation.

    As we tested new 2.1.1 version via SAG QuipGUI it seems more promisable, but ufortunately API specification is not delivered with it. As we explored Quip.jar it differs from previous version.

    Where should i find API docs?

    Regards
    Novak Leonid
    novak@ispras.ru


    #Tamino
    #API-Management
    #webMethods


  • 2.  RE: Quip 2.1.1 Java API

    Posted Wed April 03, 2002 07:53 AM

    Sorry,
    javadoc of the quipAPI got lost in the latest
    distribution of Quip. However. the JavaAPI should
    be usable in the same way as in the previous version of quip. Only small changes were made in
    this part of quip. So most things should still
    be valid from the documentation of quip 1.6.1.
    Did you encounter any problem when you tried to
    use the javaAPI the same way as with quip1.6.1?

    Sven Eric


    #API-Management
    #Tamino
    #webMethods


  • 3.  RE: Quip 2.1.1 Java API

    Posted Thu April 04, 2002 10:28 AM

    Hello.
    That code doesn’t work with current version
    (but worked with previous):

    QuiPConnection qpc;
    public QuipFileSystemConnection(String Path) throws XQueryException
    {
    qpc=new QuiPConnection(Path,null);
    //Path is URI file system directory
    }
    Bat afterwords, as i understood , that there is no QuiPConnection class i changed the code slightly:

    Connection qpc;
    public QuipFileSystemConnection(String Path) throws XQueryException
    {
    Properties obj = new Properties();
    obj.put(“home”,“C:/” );
    obj.put(“quipcmd”,“./ru/server/quip.exe” );
    qpc=DriverManager.getConnection(Path ,obj);
    }

    Now everything works fine, but still we have some problems:
    1)Suppose i run my program from c:\test1\ directory, and file “test.xml” is placed in c:\test2\ directory. In previous version we initialized Path variable with “file://c:/test2/” string . And everything was good.
    In this version it doesn’t work: (“QuipError:file not found”) (we also tried to use “home” variable). Now we need to rewrite query:
    document(“c:\test2\test.xml”) instead of document(“test.xml”)
    2)Here is the code of execution of query:
    public synchronized String executeToString(String xquery) throws Exception
    {
    QueryResult qres =qpc.executeQuery(xquery);
    String res=qres.getRawString();
    return res;
    }
    We get an answer to our query with a huge amount of “space symbols”. And when we parse the answer we get additional text nodes, which contain only space symbols.
    3) when we tried to query “really big” xml file (10 MB) we received an error:
    “System error: quip.exe: fatal error: Windows programs can only use 256Mb of heap; sorry!”
    What does it mean? As i know (MSDN library) Windows programs can use more than 256Mb of heap

    Regards, Leonid Novak novak@ispras.ru


    #API-Management
    #webMethods
    #Tamino


  • 4.  RE: Quip 2.1.1 Java API

    Posted Thu April 04, 2002 10:31 AM

    Hello.
    That code doesn’t work with current version
    (but worked with previous):

    QuiPConnection qpc;
    public QuipFileSystemConnection(String Path) throws XQueryException
    {
    qpc=new QuiPConnection(Path,null);
    //Path is URI file system directory
    }
    Bat afterwords, as i understood , that there is no QuiPConnection class i changed the code slightly:

    Connection qpc;
    public QuipFileSystemConnection(String Path) throws XQueryException
    {
    Properties obj = new Properties();
    obj.put(“home”,“C:/” );
    obj.put(“quipcmd”,“./ru/server/quip.exe” );
    qpc=DriverManager.getConnection(Path ,obj);
    }

    Now everything works fine, but still we have some problems:
    1)Suppose i run my program from c:\test1\ directory, and file “test.xml” is placed in c:\test2\ directory. In previous version we initialized Path variable with “file://c:/test2/” string . And everything was good.
    In this version it doesn’t work: (“QuipError:file not found”) (we also tried to use “home” variable). Now we need to rewrite query:
    document(%


    #API-Management
    #Tamino
    #webMethods


  • 5.  RE: Quip 2.1.1 Java API

    Posted Thu April 04, 2002 02:50 PM

    1)
    It slipped our attention that the API has changed
    in some respects and the javaDoc got lost in our
    documentation folder. I am sorry for that.

    There are no longer the QuipConnection classes but
    these have been replaced by the
    QMachineConnection. But you do not need to bother,
    if you use the DriverManager.

    The following class shows how to use this and
    how to set the base drectory for your queries:

    import java.util.;
    import com.softwareag.xtools.quip.xqueryAPI.
    ;

    public class TestAPI {
    public static void main(String args){
    Properties prop = new Properties();
    try {
    prop.put(“quipcmd”,“quip.exe” );

    Connection conex
    = DriverManager.getConnection( “file:c:\cygwin\home\”, prop );

    QueryResult res = conex.executeQuery((String)args[0]);
    System.out.println(res.getRawString());
    }
    catch (XQueryException e) {
    System.out.println(“XQueryException: " + e.getMessage());
    }
    }
    }

    noltic that the uri in the connection is of the
    form:
    file:c:/…

    so in this case no slashes after the first colon.


    2) You noticed the whitespaces. The current quip
    version keeps all whitespaces. They are
    text node constructors. Actually whitespace
    is a rather nasty thing. So we better keep them.
    These are text-nodes.

    You can avoid unwanted white-spaces
    in the way you layout your query:

    write:
    {

    $x/a/b/c


    }

    instead of:

    {$x/a/b/c}


    and write

    <a
    ><b
    />

    instead of:


    3) on windows the quip.exe cannot exceed 256M
    during execution. The error message you get
    is actually produced by the Haskell runtime
    system of ghc (Home — The Glasgow Haskell Compiler)

    You can avoid this message if you set the maximum
    heap size of the quip.exe to some smaller value
    by the command line argument:
    +RTS -M200M -RTS

    In the API you set this value as command line
    property:
    prop.put(“qmachineoptions”,”+RTS -M200M -RTS");

    However this might end up in the message:
    System error: Heap exhausted


    hope this helps

    Sven Eric


    #API-Management
    #webMethods
    #Tamino


  • 6.  RE: Quip 2.1.1 Java API

    Posted Tue April 09, 2002 04:01 PM

    Hello.
    Thank you very much for answers to my questions. The answer to question 1) (concerning path property) really helped us, but other questions are still open:

    We have two xml files: test1.xml and test2.xml. And a query:
    FOR $x in document(“test1.xml”)/* RETURN $x

    test1.xml is 1MB file , and test2.xml is 10MB file
    Also they contain no whitespaces
    (e.g hh…)
    1) After we execute this query under Quip we receive an answer with whitespaces, while initial document didn’t contain them. Moreover we have two line breaks after each element node.
    2)when we run FOR $x in document(“test2.xml”)/* RETURN $x
    we receive “not enough memory” error. As you explained this is Haskell error (Heap size is set to 256M). Can you tell me what is the maximum size of xml document, that can be queried with quip engine.

    Regards, Leonid Novak novak@ispras.ru


    #webMethods
    #API-Management
    #Tamino


  • 7.  RE: Quip 2.1.1 Java API

    Posted Wed April 10, 2002 11:36 AM

    You are right, Quip layouts its result and adds
    whitespaces. However only whitespaces which are
    not significant, which are so to speak allowed
    to add. (unless you prove the opposite, which
    would mean that there is a bug)

    It is hard to tell, which the maximum doc size
    is you can process with quip. (on linux this is
    only restricted on your hardware memory). It
    depends what you are doing with the document.
    BTW: you should set the heap size a bit smaller
    than 256 Mb, beacuse the quip.exe allocates some
    more memory (for stack etc.) and the complete
    amouint may not exceed 256mb. (it might be that
    this restriction is dropped from the Haskell guys
    some day…)

    Sven Eric


    #webMethods
    #Tamino
    #API-Management


  • 8.  RE: Quip 2.1.1 Java API

    Posted Tue May 07, 2002 10:13 PM

    Can the Documentation be made available by some means ??

    Regards,

    Amit


    #Tamino
    #API-Management
    #webMethods