[MOBY-l] Where does articleName belong? How can I set it in a Simple, using jMoby?
gordonp at ucalgary.ca
Fri Aug 19 11:21:38 EDT 2005
> I'm having trouble understanding where articleName belongs. I thought
> I understood it before, but now that I'm trying to use jMoby to access
> services that I'm providing from Perl, I'm confused again..... (But I
> note from the MOBY digest that just landed in my mailbox that that's
> OK, since articleName has several uses/meanings, and may perhaps soon
> acquire some more, so perhaps I'm not the only one ;)
> My (Perl) services expect input that looks like this:
> <Simple articleName='interactorID'>
> <Object ..../>
> In jMoby, from reading TestRequest.java, I can see that it's easy to
> build an object to contain a message like, using one of the
> constructors (it takes two String arguments: namespace and id). But
> how do I set the articleName for the enclosing <Simple> tag? Calling
> setName() on the service input MobyDataObject that wraps it, results
> in that articleName being handed down to the child element (Object),
> when it should remain with the Simple.
To me it makes sense: calling object.setName() sets the article name in
the Object tag, not the Simple.
The Simple is not a data object of any sort, it is just a wrapper used
to name parameters in calls to services.
I can reuse the Object in another service, with a completely different
parameter name, or even use it as part of a collection. I should not
have to modify the Object name itself to make these calls, as it is
exactly the same Object tag as before. In fact, I never use
object.setName(), it's there because there are other parts of the code
that call it, when you are building composite objects and the
articleName is needed to identify the data member. I'll add a message
to the javadoc stating this.
Because most people are just using one parameter inputs, it's easy to
falsely make the connection object name == simple name.
Was there not some dicussion on the list of changing articleName to
paramName for Simples? If not, we should defiunitely do this!
In any case, the jMOBY code right now doesn't deal nicely with named
parameters. I was striuggling before with how to deal with XML that
both named and unnamed parameters, very confusing. But now that all
parameters have to be named (since API 0.86) its much easier. I'll fix
the code on the weekend. Thanks for pointiung this out.
> Maybe I've got it all wrong. This has worked for me with the Perl API
> for over a year, but when trying to interact with those services using
> jMoby, it barfs because the response (which looks not unlike the input
> above) contains Simples with children, which "is NOT expected" [sic].
> But I though Simples could contain fundamental datatypes like String &
> friends. Perhaps this relates to the discussion over the last weeks
> about what a Collection is for.
Can you send me your exact XML?
> Hopefully, I've overlooked something in the javadocs - if so, I'd
> appreciate a pointer to the right class.
> Thanks in advance.
> PhD, Computational Biologist,
> Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA
> 02115, USA.
> Tel: 617-432-3555 Fax: 617-432-3557
> moby-l mailing list
> moby-l at biomoby.org
More information about the moby-l