[ome-devel] XML-RPC

Harry Hochheiser hsh at nih.gov
Mon Jan 30 15:09:31 GMT 2006


Bernd:

I've only got a passing acquaintance with TCL/TK, but it seems that a  
bit of tweaking and modification to this code should make it do the  
trick for you.

I'd suggest something like the following:

set port 80

set RE1 { http://([^:]+:([0-9]+)}

set RE2 {http://([^:]+)}

if (![regexp $RE $url {} host port] } {
	if (! [regexp $RE $url {} host] ) {
		return [errReturn "Malformed URL"]
        }
}

Some code along these lines should allow you to handle urls without   
a port - ie., http://localhost, with a default of 80.

I would, of course, test any such changes thoroughly.

There's one other thing that you'll have to watch out for. As XML-RPC  
does not handle NULL values very cleanly, the OME back-end uses the  
convention that the string "*([-NULL-])*" indicates a null value.  
When you get back your response from the XML-RPC server, you'll want  
to look for that string and interpret it appropriately.

Looking at the code, it seems as if one way to do this would be to  
add special handling to the unmarshalling and marshalling code,  
specifically by chaning xmlrpc::umString (for unmarshalling) and the  
appropriate clause in xmlprc::marshall.

hope this helps...

good luck,

harry




On Jan 27, 2006, at 6:06 PM, Bernd Jagla wrote:

> I am trying to access OME via XML-RPC from within a TCL/TK  
> application (Partek’s Screener’s Solution, a commercial package for  
> analyzing HTS data). I found a package for XML-RPC –TCL/TK (xmlrpc  
> 0.3, Written by Eric Yeh), but looking at the source of this, I  
> found out that it only processes URL of the form http://{something}: 
> [0-9]+
>
>
>
> Snippet from the source
>
> (           set RE {http://([^:]+):([0-9]+)}
>
>             if {![regexp $RE $url {} host port]} {
>
>                         return [errReturn "Malformed URL"]
>
>             }
>
>
>
> )
>
>
>
> Now before I go and try to play with this source, I wanted to ask  
> you, if anyone has a better solution.
>
> I am not an expert in neither TCL/TK nor XML-RPC.
>
>
>
> I also attached the source for the xmlrpc0.3 (TCL/TK) in case  
> someone is sooo familiar with it that it would take him any time to  
> fix it… ;-)
>
>
>
> Thanks for your kind help.
>
>
>
> Bernd
>
> Bernd Jagla, PhD
> Associate Research Scientist
> Columbia University
> 1150 St. Nicholas Avenue
> Russ Berrie Medical Pavilion, Room 520
> New York, NY 10032
> Tel: 212 - 851 5560 x16
> Fax: 212 - 851 5570
> e-mail: baj2107 at columbia.edu
>
>
>
>
> <xmlrpc.tcl>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel



More information about the ome-devel mailing list