metaregistrar / php-epp-client

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

I can not connect to SIDN? #169

Closed kvanleeuwen20 closed 5 years ago

kvanleeuwen20 commented 5 years ago

hello,

I've set my credentials and whitelisted my IPV4 addresses with SIDN.. But still I get the message that the login failed.... (I instantiate the service by creating a new sidnEppConnection(); ). Any clues?

paulhermanseu commented 5 years ago

Are you sure you are connecting with that whitelisted IP? Maybe you are connecting with IPv6 or another IPv4 address on the same machine?

metaregistrar commented 5 years ago

Please also check that your firewall is not blocking outgoing traffic for port 700. Nowadays most firewalls are standard blocking everything going out except the obvious ports.

kvanleeuwen20 commented 5 years ago

Thank you, it worked! One more question: I would like to register a domainname. If I use this code:

if(!checkhosts($conn, array($ns1))) createhost($conn, $ns1);

    if(!checkhosts($conn, array($ns2)))
        createhost($conn, $ns2);

        $nameservers = array($ns1, $ns2);
        $contactid = createcontact($conn,'email@email','+31.61000000','name', null,'Teststreet 1','1010AR','Test','NL');

        if($contactid)
        {
            createdomain($conn, $domainname, $contactid, $contactid, $contactid, $contactid, $nameservers);
            echo 'OK';
        }

It returns me an exception: The number of field/message component occurrences is incorrect (min=1, max=1). ( Error 2308: Validation of the transaction failed). I also get the message that the nameserver already exists... (even if the check is provided?) Any clues?

metaregistrar commented 5 years ago

Hi Kevin,

Please use $conn = eppConnection::create('configfile',true) to enable debugging. Then, all commands will show a log of what happened, making it easier to see what goes wrong.

kvanleeuwen20 commented 5 years ago

as I thought, everything succeeds, expect this:

-----READ-----2019-01-15 11:24:07-----

  | <?xml version="1.0" encoding="UTF-8"?>   |   |   |   | Validation of the transaction failed.   |   |   |   |   | The number of field/message component occurrences is incorrect (min=1, max=1)</sidn-ext-epp:msg>   | </sidn-ext-epp:response>   | </sidn-ext-epp:ext>   |   |   | {id}   | {trixid}   |   |   |

The number of field/message component occurrences is incorrect (min=1, max=1) is it mandatory to provide a legal_form?
metaregistrar commented 5 years ago

yes, sidn needs that field. Please use sidnEppCreateDomainRequest instead of eppCreateDomainRequest to create a domain name with SIDN

kvanleeuwen20 commented 5 years ago

Clear, thank you! It actually goes wrong when trying to create a new contact instead of registrating a new domain name. So here:

try { $contactinfo = new eppContact(new eppContactPostalInfo($name, $city, $country, $organization, $address, null, $postcode, Metaregistrar\EPP\eppContact::TYPE_LOC), $email, $telephone);

    $contact = new eppCreateContactRequest($contactinfo);
    if ($response = $conn->request($contact)) 
    {
        echo "Contact created on " . $response->getContactCreateDate() . " with id " . $response->getContactId() . "\n";
        return $response->getContactId();
    }
}catch(eppException $e)
{
    echo $e->getMessage() . "\n";
}
return null;

Do I need to use SidnEppContact?

kvanleeuwen20 commented 5 years ago

Yes, I found it, it works now, thank you very much!