[MOBY-dev] Bug in MobyRequest ?

Paul Gordon gordonp at ucalgary.ca
Mon Jan 7 22:47:27 UTC 2008


Hi Andreas,

I wouldn't really call it a bug, MobyRequest just didn't expect you to 
be lazy :-)

For example, it doesn't check that you're sending primary parameters of 
the right data types either.  This was primarily because I wanted to be 
able to create data envelopes and send them without consulting the 
ontologies if I so desired.  On the other hand, I already have the 
secondary data, so it doesn't hurt to add those that aren't already 
specified in the request.  I've done this now (do a cvs update), and 
have documented that the MobyContentInstance you pass in may be modified 
in this way.

Regards,

Paul

Andreas Groscurth wrote:
> Hi,
>
> I'm not sure, but I think there is something wrong in the MobyRequest - or I 
> (again) miss something...
>
> The situation is the following:
>
> I want to call a service which has secondaries. I dont give any secondaries in 
> the call, because I want to use the default ones the service was registered 
> with
>
> In the method convertMOBYDataToMOBYRequest the secondaried from the service 
> are fetched correctly
>
> MobyData[] secondaries = mobyService.getSecondaryInputs();
>
> but then the secondaryParameters from the call are fetched and the following 
> comparison makes me wonder
>
> if(secondaries != null && secondaries.length != secondaryParams.size()){
> 		throw new MobyException("Service " + mobyService.getName() + " was provided 
> " +  secondaryParams.size() + " secondary input parameter(s), but takes " + 
> secondaries.length +	" (query " + queryName + ")");
> }
>
> This means - if i dont provide any secondaries in my call, the method will 
> always throw an exception, although i want that the defaults to be taken.
>
> In my opinion, it should check whether any secondaries from the call are 
> present and if not, then use the default ones from the service.
>
> So, am I right or what did I miss ?
>
> Thanks
> Andreas
>   



More information about the MOBY-dev mailing list