metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
213 stars 156 forks source link

rrpproxy Create Contact #52

Closed commandIKE closed 8 years ago

commandIKE commented 8 years ago

Hello,

I can't get create contact to work with the rrpproxy connection, updating and contact info works fine though. my Code:

`require('../autoloader.php'); use Metaregistrar\EPP\eppConnection; use Metaregistrar\EPP\eppException; use Metaregistrar\EPP\eppContactPostalInfo; use Metaregistrar\EPP\eppContact; use Metaregistrar\EPP\eppCreateContactRequest; use Metaregistrar\EPP\rrpproxyEppConnection;

try { if ($conn = new rrpproxyEppConnection(true,'../Registries/rrpproxyEppConnection/settings.ini')) { if ($conn->login()) { createcontact($conn, 'info@test.com', '+31.201234567', 'Domain Administration', 'Metaregistrar', 'Address 1', 'Zipcode', 'City', 'NL'); $conn->logout(); } } } catch (eppException $e) { echo "ERROR: " . $e->getMessage() . "\n\n"; }`

I get the following error:

ERROR: Error 2001: Command syntax error; value:EPP parser errors: unknown-3361d90:0: Schemas validity error : Element '{urn:ietf:params:xml:ns:epp-1.0}extension': Missing child element(s). Expected is ( ##other{urn:ietf:params:xml:ns:epp-1.0}* ).

I hope you can help me. :)

Thanks in advance

metaregistrar commented 8 years ago

Hello,

Please in the function createcontact() change the line

$contactinfo->setPassword('');

to

$contactinfo->setPassword('abcde');

Somehow, rrpproxy needs this password to be set. It does not matter what string you give, because contact passwords are never used. But you must specify something.

commandIKE commented 8 years ago

Hello,

Thanks for the fast reply!

I have now set the password but im still getting the same Error.

Do you have other ideas what the problem could be?

metaregistrar commented 8 years ago

If you change the connection from this

eppConnection::create('../registries/rrpproxyEppConnection/settings.ini')

to this

eppConnection::create('../registries/rrpproxyEppConnection/settings.ini', true)

You will have debugging and logging enabled to you see what is sent and received.

Please locate the contact:create and paste it here.

commandIKE commented 8 years ago

-----WRITE-----2016-08-17 12:52:39----- auto Domain Administration Metaregistrar Address 1 City Zipcode NL +31.201234567 info@test.com abcde 57b441f732f12 -----END-----

-----READ-----2016-08-17 11:46:09----- Command syntax error EPP parser errors: unknown-254b260:0: Schemas validity error : Element '{urn:ietf:params:xml:ns:epp-1.0}extension': Missing child element(s). Expected is ( ##other{urn:ietf:params:xml:ns:epp-1.0}* ). 57b43261c17ef c5b086f0-53c3-45a6-a361-5f3368395d16 -----END

metaregistrar commented 8 years ago

That did not really work, the epp codes are gone

commandIKE commented 8 years ago

im not sure how to get the correct logs that you are demanding. passing true to the connection did not change my log output. also is there a way to see the request and response in the original xml format?

metaregistrar commented 8 years ago

Use < insert code > at the top of this entry screen

commandIKE commented 8 years ago

i edited the post with the log. it looks exactly like that in my log output, they are no epp codes....

how do i get the correct Log?

metaregistrar commented 8 years ago

Maybe that is php 5.6?

Log should look like this. (i'm on php 7)

-----WRITE-----2016-08-17 13:53:29-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:keysys="http://www.key-systems.net/epp/keysys-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
  <command>
    <create>
      <contact:create>
        <contact:id>MRG57b450392be53</contact:id>
        <contact:postalInfo type="int">
          <contact:name>Domain Administration</contact:name>
          <contact:org>Metaregistrar</contact:org>
          <contact:addr>
            <contact:street>Address 1</contact:street>
            <contact:city>City</contact:city>
            <contact:pc>Zipcode</contact:pc>
            <contact:cc>NL</contact:cc>
          </contact:addr>
        </contact:postalInfo>
        <contact:voice>+31.201234567</contact:voice>
        <contact:email>info@test.com</contact:email>
        <contact:authInfo>
          <contact:pw>deddede</contact:pw>
        </contact:authInfo>
      </contact:create>
    </create>
    <clTRID>57b450392be13</clTRID>
  </command>
</epp>

-----END-----2016-08-17 13:53:29-----

-----WRITE-----2016-08-17 13:53:29-----
Writing: 943 + 4 bytes
-----END-----2016-08-17 13:53:29-----

-----READ-----2016-08-17 13:53:29-----
Reading next: 845 bytes
-----END-----2016-08-17 13:53:29-----

-----READ-----2016-08-17 13:53:29-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <response>
    <result code="1000">
      <msg>Command completed successfully</msg>
    </result>
    <resData>
      <contact:creData xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
        <contact:id>P-DGA8434</contact:id>
        <contact:crDate>2016-08-17T09:15:34.0Z</contact:crDate>
      </contact:creData>
    </resData>
    <extension>
      <keysys:resData xmlns:keysys="http://www.key-systems.net/epp/keysys-1.0">
        <keysys:creData>
          <keysys:validated>1</keysys:validated>
          <keysys:verified>0</keysys:verified>
        </keysys:creData>
      </keysys:resData>
    </extension>
    <trID>
      <clTRID>57b450392be13</clTRID>
      <svTRID>48e038b4-7d7e-4d45-af85-29e6baa360fb</svTRID>
    </trID>
  </response>
</epp>

-----END-----2016-08-17 13:53:29-----
commandIKE commented 8 years ago

`-----WRITE-----2016-08-17 14:04:03----- <?xml version="1.0" encoding="UTF-8"?>

auto Domain Administration Metaregistrar Address 1 City Zipcode NL +31.201234567 info@test.com abcde 57b452b351dd3

-----READ-----2016-08-17 14:04:03----- <?xml version="1.0" encoding="UTF-8"?>

Command syntax error EPP parser errors: unknown-4035480:0: Schemas validity error : Element '{urn:ietf:params:xml:ns:epp-1.0}extension': Missing child element(s). Expected is ( ##other{urn:ietf:params:xml:ns:epp-1.0}* ). 57b452b351dd3 96ed71fe-ae51-4cf8-8067-5d897e717c71 ` i dont know why but i had to look at the site's source code to find them. using PHP 7 and Chrome.
metaregistrar commented 8 years ago

Do you have the latest version of php-epp-client?

Did you modify the file createcontact.php anyhow?

Because in your code i see the use of the element '' but the element is empty.

In my code (createcontact.php) the '' element is not there. I have made no modifications to createcontact.php, only added the settings file.

The reason why you don't see the XML output is because you are using a webbrowser. For EPP testing it is much easier if you start the PHP script from a console or a SSH shell. This will allow you to better test and debug.

commandIKE commented 8 years ago

It finally work's now.

The problem was the empty element <extension></extension>. This was created by me playing around in the eppCreateContactRequest.php while i was searching for another error.

thanks a lot for your help