[ome-devel] ome access with c++

Harry Hochheiser hsh at nih.gov
Wed Oct 5 17:24:12 BST 2005


Gerhard:

I think there's a bit of a conceptual issue here that might need a  
bit of clarification.

OME exposes a set of API calls via XML-RPC. To access data, you'll  
create XML-RPC requests that specifically call these procedures. As a  
result, the XML-RPC interface is not object-oriented: there is no  
notion of getting a factory object and then asking it to do work for  
you.

The createSession call that you encountered earlier is the first  
example of the procedural calls supported by the remote API. Other  
calls can be located by looking at the Facade.pm file under src/perl2/ 
OME/Remote, and in the specific facades found under the Facades  
directory of that subdirectory.

 From Facade.pm, you might see that calls like serverVersion,  
createSession, authenticateSession, closeSession, and dispatch are  
directly supported.

Dispatch is the workhorse call. For a call with a methodName of  
"dispatch",  the first parameter is the name of a sub-method.  
Facade.pm will find a specialized facade that implements the method  
in question, and then call that method on the remaining arguments.

For example,  GenericFacade provides an implementation of  
retrieveObjects.  to use this, you would construct an XML-RPC call  
with method name "dispatch", and a string of arguments. The first  
argument would be "retrieveObject", and the remaining arguments would  
be the object type, the criteria, and the list of requested fields.   
This call would return the results of the given query.

Does this help make things clearer?

-harry
On Oct 5, 2005, at 11:48 AM, gerhard wrote:

> Hello here's another XMLRPC problem How do I get back the Factory. The
> response of the following code is a parameters do not match exception.
> I think the problem is the <array> tag. Because I don't know how to
> write that there is no parameter in the prototype.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <methodCall>
>       <methodName>dispatch</methodName>
>       <params>
>         <param><value>>>OBJ:OME::Session=HASH(0x817e178)</value></ 
> param>
>         <param><value>>>OBJ:OME::Session=HASH(0x817e178)</value></ 
> param>
>         <param><value>Factory</value></param>
>         <param><value><array>
>                             <data>
>                                  <value>  </value></data>
>                       </array>
>               </value>
>         </param>
>        </params>
> </methodCall>
>
> Thanks very much
>
>
>
> gerhard wrote:
> >Sorry, I worked on the wrong machine, so I used the wrong password.
> >Now it works.
> >
> >Thanks very much
> >
> >
> >Ilya Goldberg wrote:
> >
> >>The createSession method expects a username and a password
> >>parameter.   Your parameters were:
> >>
> >>>        <param><value>user</value></param>
> >>>        <param><value>omeuser</value></param>
> >>>
> >>can you log in using the username "user" and password "omeuser" on
> >>you  system (i.e. does that work in the web UI/Shoola)?
> >>Also, what version of the code-base are you using (CVS or 2.4.0)?
> >>And what is the URL you sent the XMLRPC to?
> >>
> >>-I
> >>
> >>
> >>On Oct 3, 2005, at 11:41 AM, gerhard wrote:
> >>
> >>
> >>>Ilya Goldberg wrote:
> >>>
> >>>>On Sep 27, 2005, at 5:44 AM, gerhard wrote:
> >>>>
> >>>>>Thanks for your answers,
> >>>>>At the moment I deal with QT so I just thought about a
> >>>>>simple application to query the database and get a specific
> >>>>>picture  out
> >>>>>of OME.
> >>>>>Because QT has classes for http and xml it should be no  
> problem to
> >>>>>use
> >>>>>them to access OME.
> >>>>>But how works OME inside. The use of XML-RPC can only query the
> >>>>>database. So I can use this to get an specific Picture ID out of
> >>>>>OME  and
> >>>>>then use the ID to contact OMEIS. Is this right?
> >>>>>
> >>>>Yes.  Specifically, the ID you want to send OMEIS is
> >>>>Image.default_pixels.ImageServerID
> >>>>The URL to the OMEIS server that's storing the given pixels  
> (there may
> >>>>be more than one OMMEIS defined) is
> >>>>Image.default_pixels.Repository.ImageServerURL
> >>>>
> >>>>You can request that OMEIS render the pixels for you (3  
> channels max)
> >>>>and return a tiff, jpeg or png:
> >>>>http://www.openmicroscopy.org/api/omeis/composite.html
> >>>>
> >>>>Or you can get an arbitrarily-sized thumbnail of the previously- 
> set
> >>>>"view" for the image, or you can request arbitrary planes/ 
> stacks/ROIs
> >>>>of raw pixel data and render them yourself.
> >>>>
> >>>>
> >>>>>And what happens if I import an picture to OMEIS. Am I  
> responsible
> >>>>>for
> >>>>>calling the proper methods so that OME (Database) knows about  
> the new
> >>>>>picture?
> >>>>>
> >>>>OMEIS and OME operate independently.  More exactly, OMEIS  
> doesn't know
> >>>>anything about OME.  So yes, you would import a File (or  
> Pixels) into
> >>>>OMEIS, then create a new OME Image and a new set of Pixels (or  
> another
> >>>>set of Pixels for an existing Image), and specify the  
> ImageServerID
> >>>>you get from the OMEIS FinishPixels call (as well as a  
> reference to
> >>>>the correct Repository object).
> >>>>
> >>>>-Ilya
> >>>>
> >>>>
> >>>Hello,
> >>>looking at the specification from XML-RPC it should be no  
> problem to
> >>>use
> >>>xml-rpc within QT. But how can I login into OME. I  took a look  
> at the
> >>>ALLIGATOR tool.
> >>>Alligator send the following post to login:
> >>><?xml version="1.0" encoding="ISO-8859-1"?>
> >>><methodCall>
> >>>      <methodName>createSession</methodName>
> >>>      <params>
> >>>        <param><value>user</value></param>
> >>>        <param><value>omeuser</value></param>
> >>>      </params>
> >>></methodCall>
> >>>
> >>>I tried to post the same. As result I got the following:
> >>>
> >>><?xml version="1.0"
> >>>encoding="UTF-8"?
> >>>
> >>>><methodResponse><fault><value><struct><member><name>faultString</
> >>>>
> >>>name><value><string>Cannot
> >>>create session at
> >>>/usr/lib/perl5/site_perl/5.8.6/OME/Remote/Dispatcher.pm line 172.
> >>></string></value></member><member><name>faultCode</
> >>>name><value><int>102</int></value></member></struct></value></ 
> fault></
> >>>methodResponse>
> >>>
> >>>So is there a way how I can login into the system.
> >>>
> >>>Thanks very much gerhard
> >>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>_______________________________________________
> >>>>>ome-devel mailing list
> >>>>>ome-devel at lists.openmicroscopy.org.uk
> >>>>>http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
> >>>>>
> >>>>>
> >>>>
> >>
> >
> >_______________________________________________
> >ome-devel mailing list
> >ome-devel at lists.openmicroscopy.org.uk
> >http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
> >
> >
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20051005/7d8cb2fd/attachment-0001.html


More information about the ome-devel mailing list