Re: New API

From: Daniel Manley (dmanley@tucows.com)
Date: Fri Sep 01 2000 - 12:26:01 EDT


Yes, that perl hash and the XML you included are equivalent.

Straight from the developer's mouth (or keyboard):
> The msg_type is always "standard". The msg_id is a combination of the PID
> (process ID) of the running process, and a sequence number which starts at 0
> when the object (OPS.pm) is first instantiated, and increments by one for
> each message that is passed through it (either decode or encode). It will
> be unique withing a given running process, BUT it is not gauranteed to be
> globally unique.

For those not using the OPS.pm and XML_Codex.pm packages (or not using
Perl at all), these tags are currently optional. msg_id was originally conceived to
maintain sequence (eg. in asynchronous connections -- which the client does not
use). msg_type is being reserved for possible use in future releases.

Dan

Colin Viebrock wrote:

> I'm just doing some light reading of the new API, in preparation
> for writing my own client.
>
> The specs describe the OPS message format (XML), but the
> description of the actual commands ("lookup", "register", etc.)
> only give the Perl hash that gets passed to the Perl client
> functions, for example:
>
> {
> protocol => "XCP",
> action => "lookup",
> object => "domain",
> registrant_ip => "111.121.121.121",
> attributes => {
> domain => "www.foobar.com",
> affiliate_id => ?1212133?
> }
>
> Now, there is no detail on what the actual XML message should be.
> This, I think, would be useful. I can only make an educated
> guess, so can someone at OpenSRS confirm that the above Perl hash
> would be converted into the following OPS XML message:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
> <OPS_envelope>
> <header>
> <version>1.0</version>
> <msg_id>1.123456789</msg_id>
> <msg_type>standard</msg_type>
> </header>
> <body>
> <data_block>
> <dt_assoc>
> <item key="protocol">XCP</item>
> <item key="action">lookup</item>
> <item key="object">domain</item>
> <item key="registrant_ip">111.121.121.121</item>
> <item key="attributes">
> <dt_assoc>
> <item key="domain">www.foobar.com</item>
> <item key="affiliate_id">1212133</item>
> </dt_assoc>
> </item>
> </dt_assoc>
> </data_block>
> </body>
> </OPS_envelope>
>
> Also, how is msg_id determined, and is "standard" the only
> msg_type?
>
> __________________________________________________________________
> Colin Viebrock easyDNS Technologies
> Co-Founder control your domain
> http://www.easyDNS.com



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:35:49 EDT