Sample client implementation
#!/usr/bin/perl
# This program assembles the check domain xml,
# posts request to the server,
# and prints the server response.
use HTTP::Request;
use LWP::UserAgent;
# assemble request xml
# check domain xml for domain mysrs requested by i-register
my $check_domain_xml=<<'EOF';
<?xml version="1.0"?>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Header>
<T:Tran xmlns:T="http://dotph.com">
<T:UserID>i-register</T:UserID>
<T:Password>i-register1</T:Password>
</T:Tran>
</SOAP:Header>
<SOAP:Body>
<CheckDomain>
<domain>mysrs</domain>
</CheckDomain>
</SOAP:Body>
</SOAP:Envelope>
EOF
# path of MySRS API test server
my $path = 'http://mysrstest.domains.ph/cgi-bin/phbackend.pl';
# post request($check_domain_xml) to MySRS API test server
my $ua = LWP::UserAgent->new;
my $req = new HTTP::Request 'POST', $path;
$req->header('content-type' => 'text/xml');
$req->content($check_domain_xml);
my $response = $ua->request($req);
# print server response(checkdomain results)
print $response->content;
July 10, 2003
[ Back ]