metaregistrar / php-epp-client

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

No valid response class found for request class Metaregistrar\EPP\ficoraEppCreateContactRequest #108

Closed GVeidenberg closed 6 years ago

GVeidenberg commented 6 years ago

Hello

I have been struggling with this Ficora contact create and I am now in this point, where I get error No valid response class found for request class Metaregistrar\EPP\ficoraEppCreateContactRequest

My createcontact.php looks like this :

`<?php require('/var/www/html/EPPtest/autoloader.php');

use Metaregistrar\EPP\eppConnection; use Metaregistrar\EPP\eppContactPostalInfo; use Metaregistrar\EPP\eppContact; use Metaregistrar\EPP\eppCreateContactRequest; use Metaregistrar\EPP\eppException; use Metaregistrar\EPP\eppCheckDomainRequest; use Metaregistrar\EPP\eppCheckDomainResponse; use Metaregistrar\EPP\eppDomain; use Metaregistrar\EPP\eppHost; use Metaregistrar\EPP\eppContactHandle; use Metaregistrar\EPP\eppCheckContactRequest; use Metaregistrar\EPP\eppCheckHostRequest; use Metaregistrar\EPP\ficoraEppCreateContactRequest; use Metaregistrar\EPP\eppCreateDomainRequest; use Metaregistrar\EPP\eppCreateHostRequest; use Metaregistrar\EPP\ficoraEppCheckBalanceRequest; use Metaregistrar\EPP\ficoraEppCheckBalanceResponse; use Metaregistrar\EPP\eppPollRequest; use Metaregistrar\EPP\eppPollResponse;

/**

try { // Please enter your own settings file here under before using this example if ($conn = eppConnection::create('settings.ini')) { // Connect to the EPP server 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"; }

/**

Ficora eppConnection.php looks like this : `<?php namespace Metaregistrar\EPP;

class ficoraEppConnection extends eppConnection {

public function __construct($logging = false, $settingsfile = null) {
    // Construct the EPP connection object en specify if you want logging on or off
    parent::__construct($logging, $settingsfile);

    // Specify timeout values in seconds, test interface is kind of slow
    parent::setTimeout(200);
    // Enable DNSSEC, Ficora supports this
    parent::enableDnssec();

    // Make sure services are not added to the main EPP commands
    parent::setServices(null);

    // Not a real extension, but okay then
    parent::addExtension('ficora','http://www.ficora.fi/epp/ficora');
    // Add the commands and responses specific to this registry
    // Please make sure the corresponding PHP files are present!
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppCreateContactRequest', 'Metaregistrar\EPP\eppCreateContactResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppCheckBalanceRequest', 'Metaregistrar\EPP\ficoraEppCheckBalanceResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppUpdateDomainRequest', 'Metaregistrar\EPP\eppUpdateDomainResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppInfoDomainRequest', 'Metaregistrar\EPP\ficoraEppInfoDomainResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppInfoContactRequest', 'Metaregistrar\EPP\ficoraEppInfoContactResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppUpdateContactRequest', 'Metaregistrar\EPP\eppUpdateContactResponse');
    parent::addCommandResponse('Metaregistrar\EPP\ficoraEppRenewRequest', 'Metaregistrar\EPP\eppRenewResponse');
}

}`

Can anyone help`? Connection is working, etc.

metaregistrar commented 6 years ago

I have tried to revamp the way that extensions are added, also checked the ficora extension so that the additional function in this class are mapped properly.

Can you please try again with the latest version of php-epp-client?

GVeidenberg commented 6 years ago

Just downloaded. still get error with createcontact.php

No valid response class found for request class Metaregistrar\EPP\ficoraEppCreateContactRequest

If I use the original createcontact.php from Examples. The one you have in you script. I get errors:

PHP Fatal error: Uncaught Error: Call to undefined function Metaregistrar\EPP\mb_check_encoding() in /var/www/html/php-epp-client-master/Protocols/EPP/eppRequests/eppRequest.php:177 Stack trace:

0 /var/www/html/php-epp-client-master/Protocols/EPP/eppRequests/eppCreateContactRequest.php(67): Metaregistrar\EPP\eppRequest::isAscii('Domain Administ...')

1 /var/www/html/php-epp-client-master/Protocols/EPP/eppRequests/eppCreateContactRequest.php(39): Metaregistrar\EPP\eppCreateContactRequest->setPostalInfo(Object(Metaregistrar\EPP\eppContactPostalInfo))

2 /var/www/html/php-epp-client-master/Protocols/EPP/eppRequests/eppCreateContactRequest.php(17): Metaregistrar\EPP\eppCreateContactRequest->setContact(Object(Metaregistrar\EPP\eppContact))

3 /var/www/html/php-epp-client-master/Examples/createcontact.php(45): Metaregistrar\EPP\eppCreateContactRequest->__construct(Object(Metaregistrar\EPP\eppContact))

4 /var/www/html/php-epp-client-master/Examples/createcontact.php(19): createcontact(Object(Metaregistrar\EPP\eppConnection), 'info in /var/www/html/php-epp-client-master/Protocols/EPP/eppRequests/eppRequest.php on line 177

metaregistrar commented 6 years ago

The function mb_check_encoding is in PHP since version 4.4.3, strange that you get this error.

You could change the lines 67-71 in eppCreateContactRequest.php yourself and set postal type to INT or LOC as the registry requires.

in Protocols/EPP/eppExtensions/ficora/includes.php you find this line: $this->addCommandResponse('Metaregistrar\EPP\ficoraEppCreateContactRequest', 'Metaregistrar\EPP\eppCreateContactResponse');

This connects the function 'ficoraEppCreateContactRequest' to the response 'eppCreateContactResponse'

So unless there is a typo somewhere, this should work.