Hi,

I'm trying to register a domainname on the horizon test server.
I think i'm very very close, but I keep getting this errormessage:

Failed registration: Data conversion error. Check the command 'SW_REGISTER' syntax.

I checked the srsApiDoc.pdf against the values I pass in my script,
and it seems all normal. Could someone please 'clarify' this
errormessage as it isn't very clear to me now.

The "script" I use is based on register.cgi from the opensrs-client-2.55
package, but modified to what I later need in my own scripts:

-----------------------------------------------------------------------
#!/usr/bin/perl

BEGIN {
    do "/home/ssmeenk/public_html/opensrs-client-2.55/etc/OpenSRS.conf";
}

use CGI ':cgi-lib';
use lib $PATH_LIB;

use OpenSRS::XML_Client qw(:default);

# make a client object we will use to talk to the OpenSRS server
$XML_Client = new OpenSRS::XML_Client(%OPENSRS);
$XML_Client->login;

do_register();

# close the connection to the server
$XML_Client->logout;
exit;


sub do_register {

    my ($xcp_request);

        $xcp_request = {
                'object' => 'DOMAIN',
                'registrant_ip' => '62.216.29.221',
                'protocol' => 'XCP',
                'action' => 'SW_REGISTER',
                'attributes' => {
                        'affiliate_id' => 'hoho',
                        'bulk_order' => '0',
                        'custom_nameservers' => '1',
                        'custom_tech_contact' => '0',
                        'domain' => 'testdomaintje.com',
                        'encoding_type' => 'iso-8899-1',
                        'f_lock_domain' => '0',
                        'handle' => 'save',
                        'link_domains' => '0',
                        'period' => '1',
                        'reg_password' => 'password',
                        'reg_type' => 'new',
                        'reg_username' => 'username',
                        'nameserver_list' => {
                                { 'sort_order' => '1',
                                  'name' => 'ns1.domaindirect.com' },
                                { 'sort_order' => '2',
                                  'name' => 'ns2.domaindirect.com' }
                        },
                        'contact_set' => {
                                { 'admin' => {
                                        'first_name' => 'FirstName',
                                        'last_name' => 'LastName',
                                        'org_name' => 'Organisation',
                                        'address1' => 'Address1',
                                        'address2' => 'Address2',
                                        'address3' => 'Address3',
                                        'postal_code' => '3131 bl',
                                        'city' => 'city',
                                        'state' => 'STATE',
                                        'country' => 'NL',
                                        'fax' => '+3112',
                                        'phone' => '+3112',
                                        'email' => '[EMAIL PROTECTED]',
                                        'url' => 'http://www.freshdot.net/'
                                  }
                                },
                                { 'billing' => {
                                        'first_name' => 'FirstName',
                                        'last_name' => 'LastName',
                                        'org_name' => 'Organisation',
                                        'address1' => 'Address1',
                                        'address2' => 'Address2',
                                        'address3' => 'Address3',
                                        'postal_code' => '3131 bl',
                                        'city' => 'city',
                                        'state' => 'STATE',
                                        'country' => 'NL',
                                        'fax' => '+3112',
                                        'phone' => '+3112',
                                        'email' => '[EMAIL PROTECTED]',
                                        'url' => 'http://www.freshdot.net/'
                                  }
                                },
                                { 'owner' => {
                                        'first_name' => 'FirstName',
                                        'last_name' => 'LastName',
                                        'org_name' => 'Organisation',
                                        'address1' => 'Address1',
                                        'address2' => 'Address2',
                                        'address3' => 'Address3',
                                        'postal_code' => '3131 bl',
                                        'city' => 'city',
                                        'state' => 'STATE',
                                        'country' => 'NL',
                                        'fax' => '+3112',
                                        'phone' => '+3112',
                                        'email' => '[EMAIL PROTECTED]',
                                        'url' => 'http://www.freshdot.net/'
                                  }
                                },
                                { 'tech' => {
                                        'first_name' => 'FirstName',
                                        'last_name' => 'LastName',
                                        'org_name' => 'Organisation',
                                        'address1' => 'Address1',
                                        'address2' => 'Address2',
                                        'address3' => 'Address3',
                                        'postal_code' => '3131 bl',
                                        'city' => 'city',
                                        'state' => 'STATE',
                                        'country' => 'NL',
                                        'fax' => '+3112',
                                        'phone' => '+3112',
                                        'email' => '[EMAIL PROTECTED]',
                                        'url' => 'http://www.freshdot.net/'
                                  }
                                }
                        }
                }
        };

    my $response = $XML_Client->send_cmd( $xcp_request );
    if (not $response->{is_success}) {
        $error = "Failed registration: $response->{response_text}.\n";
        if ($response->{attributes}->{error}) {
            $error .= $response->{attributes}->{error};
        }
        print $error;
        exit;
    }

    print "Domain successfully registered.\n";
}
--------------------------------------------------------------------

Any help appreciated!

Regards,
Sander Smeenk.

-- 
| What ees yewr probleem, yew stewpid fewl?
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D

Reply via email to