[MOBY-l] MobyRequest or CentralImpl ?

Paul Gordon gordonp at cbr.nrc.ca
Tue May 18 13:33:12 UTC 2004


Benjamin Good wrote:

> Hello,
>
> When I want to execute a moby service from my java client, it seems 
> that there are two choices present in cvs,  the invokeService() method 
> from the MobyRequest class and the doCall method from the CentralImpl 
> class.
>
>  Any opinions about which one I should be using ?

MobyRequest is designed specifically for this purpose.  If you look at 
the ChangeLog, there is an example:

    // Assumes you already have a service (mobyService) and data 
(mobyInputData) around
    mobyRequest = new MobyRequest(new CentralImpl());
    mobyRequest.setDebugMode(true);
    mobyRequest.setService(mobyService);
    mobyRequest.setInput((MobyDataInstance[]) mobyInputData);
    try{
        mobyRequest.invokeService();
    } catch(MobyException mobye){
        System.err.println("Failure in MOBY protocol: " + mobye);
    } catch(SOAPException soape){
        System.err.println("Failure in SOAP transaction: " + soape);
    } catch(NOSuccessException nse){
        System.err.println("Failure in MOBY logic (input was not 
acceptable " +
                           "for this service)" + nse);
    }


You can reuse the MobyRequest object as many times as you like...

>
> thanks
> -Ben
>
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
>





More information about the moby-l mailing list