metaregistrar / php-epp-client

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

760 line exception in eppConnection.php,call funtion $response->loadXML($xml) #259

Closed jansen-s closed 4 years ago

jansen-s commented 4 years ago

In verisign, when using the ack of the command to operate a non-existent id, the epp server returns the following response: `<?xml version="1.0" encoding="UTF-8"?>

Object does not exist 5ebe66f4eb75a 957644504-1589536535007 ` $ response-> loadXML ($ xml) When converting this response to xml dom, the following exception message will be reported: `DOMDocument::loadXML(): Namespace prefix epp on poll is not defined in Entity, line: 1`
metaregistrar commented 4 years ago

I have been experimenting with this message a little bit, but basically, the XML that Verisign sends is not correct.

The element suggest that there should be a namespace with the name 'epp' and that namespace is not defined in the message.

Correct would be:

<?xml version="1.0" encoding="UTF-8"?> <epp xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"> <response> <result code="2303"> <msg>Object does not exist</msg> <value> <epp:poll msgID="1993369" op="ack"/> </value> </result> <trID> <clTRID>5ebe66f4eb75a</clTRID> <svTRID>957644504-1589536535007</svTRID> </trID> </response> </epp>

The xmlns:epp defines the namespace 'epp' so it can be used later in epp:poll.

Since this message comes from Verisign and there is not much you can do about that, you can disable error reporting with this line:

$response->loadXML($xml,LIBXML_NOERROR);

That will suppress the error in XML.