Jag valde att använda Net-EPP_client.php från centralnic för att komma igång.



Similar documents
Readme10_054.doc page 1 of 7

Interface Programmera mot interface Johan Eliasson Johan Eliasson Interface kan bryta beroendekedjor Skriv generell kod «Type» Class2 Interface

Functional specifications for the opening of registrations of domain names with 1 & 2 characters in the.fr TLD via EPP

Sweden National H.O.G. Rally July 2010

Manual for Registrars. Automated Interface. General Availability

Category work in courtroom talk about domestic violence: Gender as an interactional accomplishment in child custody disputes

Workshop 1: Can CM find common ground for HW & SW development?

Microsoft + SOA = Sant? Joakim Linghall Principal System Engineer SOA and Business Process joakiml@microsoft.com

SAS Data Integration SAS Business Intelligence

Martin Holmgren Vice President Fleet Management Cramo Group

Tanden Care Provider Interfaces Reverse Claim v1

How To Work For A Car Maker

PRTK. Password Recovery ToolKit EFS (Encrypting File System)

Development allowance and activity grant [Aktivitetsstöd och utvecklingsersättning]

Tanden Care Provider Interfaces PreAssessmentSTB v3

Design Suggestions for Danske Bank SE

Använd SAS för att bearbeta och analysera ditt data i Hadoop

DRb Distributed Ruby. Johan Sørensen

SAS Education Providing knowledge through global training and certification. SAS Foundation. Kursöversikt 2010

The Problem With Adding Positive and Negative Numbers

ANVÄNDARINSTRUKTION Patientlyftvåg SLSC2 200kg/100g

BizTalk 2013, Hands on, IaaS, Paas - Hybridbaserade integrationslösningar med BizTalk lokalt och/eller i molnet

Installation WebInfo 3.3 (deprecated)

När du hämtar mat hos oss kan du också köpa en läsk, 33 cl, för 10:- per portion. Vi tar 12:- för extra ris och 7:- för extra sås.

Viktigaste uppgift: Web Browser SSO

Registrar Ramp Up Process. Prepared by Afilias

Rek. 1995:- Technical specifications SB12V3200E-AC SB12V3200E-AC. Recharges much faster. Longer service life. Only 1/3 of the size.

3gamma Från traditionell IT-leverans till modern, processtyrd tjänsteleverans i en multi-sourcing miljö. Peter Wahlgren, September 2013

School of Electrical Engineering

Configuring and Administering Hyper-V in Windows Server 2012

A Study of Failure Development in Thick Thermal Barrier Coatings. Karin Carlsson

Introduktion till SAS 9 Plattformen Helikopterkursen

Technical documentation

Table of contents. 2. Technical details Protocols used Messaging security Encoding Input and output...

How To Get Healthy With A Game Called Angel Hour

MBA. EA GBG Bolag. EA GBG Bolag Enrollment id Kommunleasing GotEvent Renova

Demo Gotland (Smart Customer Gotland)

owncloud 8 and DigitalOcean Matthew Davidson Bluegrass Linux User Group 03/09/2015

How To Boot A Cisco Ip Phone From A Cnet Vlan To A Vlan On A Cpower Box On A Ip Phone On A Network With A Network Vlan (Cisco) On A Powerline (Ip Phone) On An

Effektiv hantering av Data och Information i M3 Joakim Jannerfeldt Anders Cottman

EPP 1.0 Gateway Resource Guide

Job Aid: Directory Application

Critical section problem (repetition)

BABIES PG st per förpackning, kan även beställas styckevis.

Fall CRM Server Software Design TEAM MEMBERS: Project Owner: Herve Ntareme Champion: Bjorn Pehrson. MAHSA TABATABAEI ( mahsat@kth.

If You Get Sick during a Temporary Stay Abroad [Sjuk vid tillfällig vistelse utomlands]

BankID Relying Party Guidelines

Ange om en aktivitet har medfört att en tjänsteresa har utförts med flyg under 2013, och i sådana fall antal gånger.

INTERNATIONELLA BANKÖVERFÖRINGAR

WINDOWS PRESENTATION FOUNDATION LEKTION 3

VoxStack GSM Gateway API. Version: Author: Joe.Yung

Aqua Connect Load Balancer User Manual (Linux)

1) Testing of general knowledge 25%. Each right question counts 1. Each wrong counts 0.5. Empty

SWITCH, Werdstrasse 2, P.O. Box, CH-8021 Zürich EPP Manual. Version with DNSSEC and RGP. November 7, 2013 SWITCH

IBM idag. Johan Rittner VD IBM Svenska

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

FTP, IIS, and Firewall Reference and Troubleshooting

RMS FTP PUBLIC. FTP Recommendations for Meter Data Retrieval. Issue 4.0 IMP_GDE_0085. Provides the three approaches to FTP as recommended by IESO.

How to set up & configure GADD Dashboard Server 1.4

Panthera - A Helpdesk System developed in Visual Studio.NET

Web-based address book

Tanden Care Provider Interfaces Submit Claim v3

How To Install Storegrid Server On Linux On A Microsoft Ubuntu 7.5 (Amd64) Or Ubuntu (Amd86) (Amd77) (Orchestra) (For Ubuntu) (Permanent) (Powerpoint

ConVox Inbound call Center. Inbound Call Center solution at your premisis

Automated CPanel Backup Script. for home directory backup, remote FTP backup and Amazon S3 backup

Install an SSL Certificate onto SilverStream. Sender Recipient Attached FIles Pages Date. Development Internal/External None 5 6/16/08

Åtdragningsmoment & Bultordning Åbergs VTC Parts AB

Projektet Computer: Specifikation. Objektorienterad modellering och diskreta strukturer / design. Projektet Computer: Data. Projektet Computer: Test

Configuring and Monitoring FTP Servers

Setup Instructions for Secure Hummingbird FTP

Art. nr: Art. nr: WiFi till restauranger, konferenslokaler mm Data till reklampelare Internet till campingplatser

Parental benefit [Föräldrapenning]

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

Computer animations in physical chemistry. Kim Bolton School of Engineering, University College of Borås, SE , Borås

Temporary parental benefit for care of children [Tillfällig föräldrapenning vid vård av barn]

Marknadsföring som en del av intäktsprocessen.

linux20 (R12 Server) R Single Node SID - TEST linux1 (10gAS Server) Oracle 10gAS ( ) with OID SID - asinf server name

What Is the Productivity Gain in Machine Translation of Subtitles?

ISM Configuration Step by Step Guide HTTP Monitor. Overview. ISM Configuration Step by Step Guide HTTP Monitor

Transcription:

EPP och PHP Det finns flera olika klienter där ute för att hantera epp. Net_EPP_client.php phpsrs Hanterar bara EPP kommunikationen. Enkel http://labs.centralnic.com/net_epp_client.php Mer komplett Klarar inte ssl http://sourceforge.net/projects/phpsrs Openepp Ser ganska komplett ut Alla kommentarer och texter på rysska http://www.epp.org.ua/downloads Jag valde att använda Net-EPP_client.php från centralnic för att komma igång. Installera Net_EPP_Client & PHP Ladda hem från http://labs.centralnic.com/net_epp_client.php Packa upp Kopiera Net/EPP/Client.php Editera Client.php rad 29 /* $GLOBALS[Net_EPP_Client_Version] = '0.0.3'; */ För att få PHP att fungera med XML stöd behövs paketer php-xml installeras, i alla fall om man kör RedHat EL5 eller CentOS 5.2. När detta är gjort kan msg.php köras givetvis efter det att ni editerat user and password. Exemplet är det samma som i dom andra språken, dvs det loggar in. Talar om om det finns några meddelande in kön, och om det finns det så hämtar programmet hem det första meddelande och visar en del information om medlenade. OBS!! Exemplet gör inte ACK på meddelande så detta ligger kvar i kön.

#!/usr/bin/php # <?php require('./client.php'); // To change $host = 'epptest.iis.se'; $port = 700; $timeout = 10; $ssl = true; $EPP_USER = 'test'; $EPP_PWD = '1234abcdefghijkl'; // Defines // define( 'XMLNS_EPP', 'urn:ietf:params:xml:ns:epp-1.0' ); define( 'XSCHEMA_EPP', 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd' ); define( 'XMLNS_XSCHEMA', 'http://www.w3.org/2001/xmlschema-instance' ); define( 'XSCHEMA_DOMAIN', 'urn:ietf:params:xml:ns:domain-1.0' ); define( 'XSCHEMA_CONTACT', 'urn:ietf:params:xml:ns:contact-1.0' ); define( 'XSCHEMA_HOST', 'urn:ietf:params:xml:ns:host-1.0' ); define( 'XSCHEMA_EXTDNSSEC', 'urn:ietf:params:xml:ns:secdns-1.0' ); define( 'XSCHEMA_EXTIIS', 'urn:se:iis:xml:epp:iis-1.0' ); function xmlcreateattribute( $doc, $attrname, $attrvalue ) { $attr = $doc->createattribute( $attrname ); $attr->nodevalue = $attrvalue; return $attr; function eppresultparse( $xml ) { $node = new DOMDocument; if ( @$node->loadxml( $xml ) == false ) { print "Parse error\n"; exit(1); $xpath = new DOMXPath( $node ); $xpath->registernamespace( 'epp', XMLNS_EPP ); $xpath->registernamespace( 'con', XSCHEMA_CONTACT ); $xpath->registernamespace( 'dom', XSCHEMA_DOMAIN ); $xpath->registernamespace( 'hos', XSCHEMA_HOST ); $xpath->registernamespace( 'iis', XSCHEMA_EXTIIS ); $xpath->registernamespace( 'secdns', XSCHEMA_EXTDNSSEC ); return $xpath; // Main //

//- Connect to server ------------------------------------------------------- $epp = new Net_EPP_Client; $greeting = $epp->connect($host, $port, $timeout, $ssl); $xpath = eppresultparse( $greeting ); $svid = $xpath->query( '/epp:epp/epp:greeting/epp:svid/text()' )->item(0)- print "Connected to server ".$svid."\n"; //- Create the login xml ---------------------------------------------------- $doc = new DOMDocument("1.0", "UTF-8"); #$doc->formatoutput = true; $doc->standalone = false; // Build the root $root = $doc->appendchild( $doc->createelement( 'epp' ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns', XMLNS_EPP ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns:xsi', XMLNS_XSCHEMA ) ); $root->appendchild( xmlcreateattribute( $doc, 'xsi:schemalocation', XSCHEMA_EPP ) ); $doc->appendchild( $root ); // Build the command $cmd = $root->appendchild( $doc->createelement( 'command' ) ); $login = $cmd->appendchild( $doc->createelement( 'login' ) ); $login->appendchild( $doc->createelement( 'clid', $EPP_USER ) ); $login->appendchild( $doc->createelement( 'pw', $EPP_PWD ) ); $opts = $login->appendchild( $doc->createelement( 'options' ) ); $opts->appendchild( $doc->createelement( 'version', '1.0' ) ); $opts->appendchild( $doc->createelement( 'lang', 'en' ) ); $svcs = $login->appendchild( $doc->createelement( 'svcs' ) ); $svcs->appendchild( $doc->createelement( 'objuri', XSCHEMA_DOMAIN ) ); $svcs->appendchild( $doc->createelement( 'objuri', XSCHEMA_CONTACT ) ); $svcs->appendchild( $doc->createelement( 'objuri', XSCHEMA_HOST ) ); $svcx = $svcs->appendchild( $doc->createelement( 'svcextension' ) ); $svcx->appendchild( $doc->createelement( 'exturi', XSCHEMA_EXTDNSSEC ) ); $svcx->appendchild( $doc->createelement( 'exturi', XSCHEMA_EXTIIS ) ); $clienttran = "PHP-". gmstrftime('%y%m%dt%h%m%sz'). "-". getmypid(); $cmd->appendchild( $doc->createelement( 'cltrid', $clienttran ) ); $login = $doc->savexml(); $epp->sendframe($login); //- Check responses --------------------------------------------------------- $answer = $epp->getframe(); $xpath = eppresultparse( $answer ); $rescode = $xpath->query( '/epp:epp/epp:response/epp:result/@code' )->item(0)- if ($rescode!= 1000) { $msg = $xpath->query( '/epp:epp/epp:response/epp:result/epp:msg/text()' )- print "Login Fail - Code ".$rescode." - ".$msg."\n"; else { $msgq = $xpath->query( '/epp:epp/epp:response/epp:msgq/@count' )->item(0)-

if ($msgq!= 0) { $msgid = $xpath->query( '/epp:epp/epp:response/epp:msgq/@id' )- print "You have ".$msgq." message in queue - first id is ".$msgid."\n"; ------ //- Create the poll xml ----------------------------------------------- $doc = new DOMDocument("1.0", "UTF-8"); $doc->formatoutput = true; $doc->standalone = false; // Build the root $root = $doc->appendchild( $doc->createelement( 'epp' ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns', XMLNS_EPP ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns:xsi', XMLNS_XSCHEMA ) ); $root->appendchild( xmlcreateattribute( $doc, 'xsi:schemalocation', XSCHEMA_EPP ) ); $doc->appendchild( $root ); // Build the command $cmd = $root->appendchild( $doc->createelement( 'command' ) ); $poll = $cmd->appendchild( $doc->createelement( 'poll' ) ); $poll->appendchild( xmlcreateattribute( $doc, 'op', 'req' ) ); $clienttran = "PHP-". gmstrftime('%y%m%dt%h%m%sz'). "-". getmypid(); $cmd->appendchild( $doc->createelement( 'cltrid', $clienttran ) ); $poll = $doc->savexml(); $epp->sendframe($poll); //- Check responses --------------------------------------------------- ------ $answer = $epp->getframe(); $xpath = eppresultparse( $answer ); $rescode = $xpath->query( '/epp:epp/epp:response/epp:result/@code' )- $msg = $xpath->query( '/epp:epp/epp:response/epp:result/epp:msg/text()' )- print "Msg - Code ".$rescode." - ".$msg."\n"; //- Get message ------------------------------------------------------- ------ $qdate = $xpath->query( '/epp:epp/epp:response/epp:msgq/epp:qdate' )- $svtrid = $xpath->query( '/epp:epp/epp:response/epp:trid/epp:svtrid' )- print ("qdate: ".$qdate."\n"); print ("svtrid: ".$svtrid."\n"); $name = $xpath->evaluate( 'name(/epp:epp/epp:response/epp:resdata/*[1])' ); switch ($name) { case 'iis:createnotify': print ("Message type: Create\n"); $node = ':infdata/'; case 'iis:updatenotify': print ("Message type: Update\n"); $node = ':infdata/'; case 'iis:deletenotify':

print ("Message type: Delete\n"); $node = ''; case 'iis:transfernotify': print ("Message type: Transfer\n"); $node = ':trndata/'; default: print ("Unknown type: ".$name."\n"); $type = $xpath->evaluate( 'name(/epp:epp/epp:response/epp:resdata/'.$name.'[1]/*[1])' ); switch (substr($type,0,3)) { case 'dom': print ("Object type: domain\n"); if (strlen($node)!= 0) $node = 'dom'.$node; $node2 = 'dom:name'; case 'hos': print ("Object type: host\n"); if (strlen($node)!= 0) $node = 'hos'.$node; $node2 = 'hos:name'; case 'con': print ("Object type: contact\n"); if (strlen($node)!= 0) $node = 'con'.$node; $node2 = 'con:id'; default: print ("Unknown objtype: ".$name."\n"); $query = '/epp:epp/epp:response/epp:resdata/'.$name.'[1]/'.$node.$node2; $id = $xpath->query( $query )- print ("Object ID: ".$id."\n"); else { print "No message in queue\n"; //- Create the logout xml --------------------------------------------------- $doc = new DOMDocument("1.0", "UTF-8"); #$doc->formatoutput = true; $doc->standalone = false; // Build the root $root = $doc->appendchild( $doc->createelement( 'epp' ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns', XMLNS_EPP ) ); $root->appendchild( xmlcreateattribute( $doc, 'xmlns:xsi', XMLNS_XSCHEMA ) ); $root->appendchild( xmlcreateattribute( $doc, 'xsi:schemalocation', XSCHEMA_EPP ) ); $doc->appendchild( $root ); // Create the command $cmd = $root->appendchild( $doc->createelement( 'command' ) ); $cmd->appendchild( $doc->createelement( 'logout' ) ); $clienttran = "PHP-". gmstrftime('%y%m%dt%h%m%sz'). "-". getmypid(); $cmd->appendchild( $doc->createelement( 'cltrid', $clienttran ) );

$logout = $doc->savexml(); $epp->sendframe($logout); //- Check responses --------------------------------------------------------- $answer = $epp->getframe(); $xpath = eppresultparse( $answer ); $rescode = $xpath->query( '/epp:epp/epp:response/epp:result/@code' )->item(0)- if ($rescode!= 1500) { $msg = $xpath->query( '/epp:epp/epp:response/epp:result/epp:msg/text()' )- print "Logout Fail - Code ".$rescode." - ".$msg."\n"; else { $msg = $xpath->query( '/epp:epp/epp:response/epp:result/epp:msg/text()' )- print "Logout Result code ".$rescode." - ".$msg."\n"; //- Dissconnct -------------------------------------------------------------- $epp->disconnect();?>