[MOBY-dev] java api

ywong at infobiogen.fr ywong at infobiogen.fr
Wed Feb 16 14:30:43 UTC 2005


PS: I've put the sources at this url:
    The API: http://yan.wong.free.fr/Public/wsGenoplante.tar.bz2
    The two examples: http://yan.wong.free.fr/Public/jws.tar.bz2

    you'll need a login and password:
    login: Invite
    password: invite

    Documentation of the API is in <wsGenoplante_src_dir>/dist/
    a compiled jar is also in this directory

    You'll find the two examples in the <jws_src_dir>/src/ directory
    To setup the webservice (in the case of axis) just copy the
MobyWebService.java to the axis directory as a jws file:

   cp <jws_src_dir>/src/MobyWebService.java
<jakarta_instance_directory>/webapps/axis/

  and use Perl, Python Java API to query the service :p

  A more exhaustive documentation of the API will be produced but I lack
some time doing it... (maybe just look at the examples to have an idea)

  The two projects were written using netbeans 4.0 but the ant file should
work without it:

 build from source:
 $ant
 the resulting jar will be found in the dist directory
<wsGenoplante_src_dir>/dist/wsGenoplante.jar

> Hi,
>   My API was based on my Python API and uses Xerces library (but can use
> any DOM API compatible library) and as for the Python library, was
> intended to be generic:
>
>   XML Moby String <-> Java Objects
>
>   People should only use java object and serialize their results in moby
> XML .
>
>   The only thing it doesn't support (yet) is the PIB. It is also intended
> to ease the building of java webservices without being tied to any
> webservice's API (j2ee or axis or anything else)
>
>   It can also execute moby webservices (client interface) but doesn't
> support registration of objects/services to the bioMoby directory.
>
>   For instance, the documentation of the API is just in plain javadoc  and
> there are just two examples (client querying a bioMoby webservice and a
> server serving moby contents)
>
>   The client API can query the bioMoby directory (find a service)
>
>   I can send the source and documentation to whom it may concern but
> consider the code to be beta quality code :p ...
>
> one example of usage:
>
>     public String aHelloWorld(String mobyContent) throws
> MobyParserException {
>         MobyContent mobyInput=new MobyContent();
>         MobyContent mobyOutput=new MobyContent(this.authority,
> this.notes);
>
>         mobyInput.fromXML(mobyContent);
>
>         /*browse all the queries */
>         Iterator iterator=mobyInput.keys().iterator();
>
>         while (iterator.hasNext()) {
>             String queryID=(String)iterator.next();
>
>             MobyQuery mq=mobyInput.getQuery(queryID);
>             MobyQuery queryResult=new MobyQuery(queryID);
>
>             if (mq.getObjects().size()>0) {
>                 MobyObject o=(MobyObject)mq.getObjects().elementAt(0);
>
>                 queryResult.addObject(o);
>                 queryResult.addObject(new MobyObject(o.getArticleName(),
> "Global_Keyword", "hello world"));
>
>                 mobyOutput.setQuery(queryResult);
>             }
>         }
>
>         return mobyOutput.toXML();
>     }
>
>
> Don't know if it is easy enough...
>
>> Hi all,
>>
>> as Yan has mentioned, i have joined  the PlaNet  project  at MIPS since
>> 3  months  now.
>> one of my first tasks was to provide a generic API to  simplify access
>> to the pameters (queryID, namespace, id)
>> one needs from the moby input xml to run the services and also methods
>> to generate moby conform xml result.
>>
>> I have used DOM4J and XPATH to implement concrete classes for this
>> purpose.
>> At the moment all you need to get your parameters is to use the method
>> "allParsedData(inputxml)" no matter how complex the inputxml is.
>> This method return a vector of the form e.g.:
>>
>> (((queryID1,ns,id))) for a simple type
>>
>> or (((queryID1,ns1,id1),(queryID1,ns2,id2),(queryID1,ns3,id3))) for a
>> collection
>>
>> or
>> (((queryID1,ns,id),(queryID1,ns,id),(queryID1,ns,id)),((queryID2,ns1,id1)))
>> for an input with 2 invocations, the first been a collection and the
>> second a simple type.
>>
>> currently i do not handle secondary articles, but this should not be
>> difficult.
>>
>> we habe tried in our java services and everything seems to be ok.
>>
>> i am commenting the code now. once it is finished, i will like to share
>> it with you for comment or rectification and of course use.
>> Is there any possibility to upload this in central repository?
>>
>> best regards
>>
>> octave
>>
>>>
>>>
>>> Hi,
>>>  I know that someone at mips (Octave Noubibou) is also working on that
>>> field, on my side, I have an API in Java (based on the Python API) that
>>> helps me to build moby webservices (with axis or j2ee)
>>>
>>>
>>>>> Hi Mark,
>>>>>
>>>>> I'll see how things are looking and get the documentation together.
>>>>> The
>>>>> basic goal was to create some basic classes to simplify access to the
>>>>> MOBY payload of a webservice call so that we could concentrate on
>>>>> getting the services up rather than parsing the MOBY XML and
>>>>> rewriting
>>>>> the XML prior to returning the result. We've been using Axis to
>>>>> handle
>>>>> the webservice part of the equation, we've created some core classes
>>>>> and have a simple test service prototype that we are gearing up to do
>>>>> something meaningful with. If you have people doing similar things it
>>>>> would be great to get an overview of what you are working on too so
>>>>> we
>>>>> can divide and conquer where possible.
>>>>>
>>>>> Simon.
>>>>>
>>>>>
>>>>> On Feb 14, 2005, at 10:04 PM, mwilkinson wrote:
>>>>>
>>
>> _______________________________________________
>> MOBY-dev mailing list
>> MOBY-dev at biomoby.org
>> http://www.biomoby.org/mailman/listinfo/moby-dev
>>
>
>
> _______________________________________________
> MOBY-dev mailing list
> MOBY-dev at biomoby.org
> http://www.biomoby.org/mailman/listinfo/moby-dev
>





More information about the MOBY-dev mailing list