Closed matbcvo closed 4 years ago
I looked up eppConnection.php file again and found addDefaultNamespace.
So I added:
$conn->addDefaultNamespace('https://epp.tld.ee/schema/epp-ee-1.0.xsd', 'xmlns');
But still getting error from EIF EPP server.
ERROR: Error 2001: 2:0: ERROR: Element '{xmlns:https://epp.tld.ee/schema/epp-ee-1.0.xsd}epp': No matching global declaration available for the validation root.
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="lib/schemas/epp-ee-1.0.xsd">
<response>
<result code="2001">
<msg lang="en">2:0: ERROR: Element '{xmlns:https://epp.tld.ee/schema/epp-ee-1.0.xsd}epp': No matching global declaration available for the validation root.</msg>
</result>
<trID>
<clTRID>5e62145d65c7d</clTRID>
<svTRID>ccReg-9217581279</svTRID>
</trID>
</response>
</epp>
==== LOG ====
-----Connection made-----2020-03-06 10:14:05-----
Stream opened with protocol TLSv1.2, cipher ECDHE-RSA-AES128-GCM-SHA256, 128 bits TLSv1.2
-----END-----2020-03-06 10:14:05-----
-----WRITE-----2020-03-06 10:14:05-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="xmlns:https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<command>
<login>
<clID>XXXXXXXXXXXXXXXX</clID>
<pw>XXXXXXXXXXXXXXXX</pw>
<options>
<version>1.0</version>
<lang>en</lang>
</options>
<svcs>
<objURI>https://epp.tld.ee/schema/domain-eis-1.0.xsd</objURI>
<objURI>https://epp.tld.ee/schema/contact-ee-1.1.xsd</objURI>
</svcs>
</login>
<clTRID>5e62145d65c7d</clTRID>
</command>
</epp>
-----END-----2020-03-06 10:14:05-----
-----READ-----2020-03-06 10:14:05-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="lib/schemas/epp-ee-1.0.xsd">
<response>
<result code="2001">
<msg lang="en">2:0: ERROR: Element '{xmlns:https://epp.tld.ee/schema/epp-ee-1.0.xsd}epp': No matching global declaration available for the validation root.</msg>
</result>
<trID>
<clTRID>5e62145d65c7d</clTRID>
<svTRID>ccReg-9217581279</svTRID>
</trID>
</response>
</epp>
-----END-----2020-03-06 10:14:05-----
-----DISCONNECT-----2020-03-06 10:14:05-----
Disconnected
-----END-----2020-03-06 10:14:05-----
The adddefaultnamespace will always add 'xmlns:', which is not applicable in this case.
Maybe you can try: $this->defaultnamespace['xmlns'] = 'https://epp.tld.ee/schema/epp-ee-1.0.xsd';
and see what that does?
Thanks for reply. I added another function in eppConnection.php file
public function addDefaultNamespace2($xmlns, $namespace) {
$this->defaultnamespace[$namespace] = $xmlns;
}
and I added $conn->addDefaultNamespace2('https://epp.tld.ee/schema/epp-ee-1.0.xsd', 'xmlns');
Then it was able to login to EIF EPP server without error. Domain check even works.
==== LOG ====
-----Connection made-----2020-03-06 10:40:11-----
Stream opened with protocol TLSv1.2, cipher ECDHE-RSA-AES128-GCM-SHA256, 128 bits TLSv1.2
-----END-----2020-03-06 10:40:11-----
-----WRITE-----2020-03-06 10:40:11-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<command>
<login>
<clID>XXXXXXXXXXXXXXXX</clID>
<pw>XXXXXXXXXXXXXXXX</pw>
<options>
<version>1.0</version>
<lang>en</lang>
</options>
<svcs>
<objURI>https://epp.tld.ee/schema/domain-eis-1.0.xsd</objURI>
<objURI>https://epp.tld.ee/schema/contact-ee-1.1.xsd</objURI>
</svcs>
</login>
<clTRID>5e621a7bed16b</clTRID>
</command>
</epp>
-----END-----2020-03-06 10:40:11-----
-----READ-----2020-03-06 10:40:12-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="lib/schemas/epp-ee-1.0.xsd">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<trID>
<clTRID>5e621a7bed16b</clTRID>
<svTRID>ccReg-0085268740</svTRID>
</trID>
</response>
</epp>
-----END-----2020-03-06 10:40:12-----
-----LOGIN-----2020-03-06 10:40:12-----
Logged in
-----END-----2020-03-06 10:40:12-----
-----WRITE-----2020-03-06 10:40:12-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd" xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
<command>
<check>
<domain:check>
<domain:name>example.ee</domain:name>
</domain:check>
</check>
<clTRID>5e621a7c1d149</clTRID>
</command>
</epp>
-----END-----2020-03-06 10:40:12-----
-----READ-----2020-03-06 10:40:13-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="lib/schemas/epp-ee-1.0.xsd">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<resData>
<domain:chkData xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:cd>
<domain:name avail="1">example.ee</domain:name>
</domain:cd>
</domain:chkData>
</resData>
<trID>
<clTRID>5e621a7c1d149</clTRID>
<svTRID>ccReg-6044630888</svTRID>
</trID>
</response>
</epp>
-----END-----2020-03-06 10:40:13-----
-----WRITE-----2020-03-06 10:40:13-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd" xmlns:contact="https://epp.tld.ee/schema/contact-ee-1.1.xsd">
<command>
<logout></logout>
<clTRID>5e621a7de8dab</clTRID>
</command>
</epp>
-----END-----2020-03-06 10:40:13-----
-----READ-----2020-03-06 10:40:14-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="lib/schemas/epp-ee-1.0.xsd">
<response>
<result code="1500">
<msg>Command completed successfully; ending session</msg>
</result>
<trID>
<clTRID>5e621a7de8dab</clTRID>
<svTRID>ccReg-9163635710</svTRID>
</trID>
</response>
</epp>
-----END-----2020-03-06 10:40:14-----
-----LOGOUT-----2020-03-06 10:40:14-----
Logged out
-----END-----2020-03-06 10:40:14-----
-----DISCONNECT-----2020-03-06 10:40:14-----
Disconnected
-----END-----2020-03-06 10:40:14-----
Would be nice if addDefaultNamespace function has another argument, so you can specify to add 'xmlns' or not. eg
public function addDefaultNamespace($xmlns, $namespace, $arg = true) {
if($arg == false) {
$this->defaultnamespace[$namespace] = $xmlns;
} else {
// 'xmlns' will be added by default
$this->defaultnamespace[$namespace] = 'xmlns:' . $xmlns;
}
}
i will see to that - this is the first time that i encounter a registry that messes with the standard epp-1.0 namespace (normally they only add their namespaces to the 'extension' part of the epp message).
Done
Server replies with error when trying to login to EIF EPP server.
So error is about this line:
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
But there are EIF EPP documentation: https://github.com/internetee/registry/blob/master/doc/epp_examples.md And it contains one example for login:
This example has this line:
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
How I can change xmlns to this? At the moment I couldn't find that method.
PHP file
EIF EPP schemas: https://epp.tld.ee/schema/