I've been in the process of searching for the code all day, and now I've decided to write it here.
First Login:
<epp xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<login>
<clID>ClientX</clID>
<pw>epp123</pw>
<options>
<version>1.0</version>
<lang>en</lang>
</options>
<svcs>
<objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
<objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
<svcExtension>
<extURI>http://test/epp/xml/schema/contact-ext-1.0</extURI>
</svcExtension>
</svcs>
</login>
<clTRID>ABC-12345</clTRID>
</command>
</epp>
Then: Some XML
And then Logout:
<epp xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<logout />
<clTRID>ABC-12345</clTRID>
</command>
</epp>
How can I send this data and then receive data from the server? Can anyone send me example?
Thank you
First, you need to check how the server API is expecting to receive this data. So far we know it's expecting XML but how is the XML to be delivered? Questions you should ask:
The underlying transport mechanism of most web APIs is through HTTP requests. For that you could use PHP native libraries like cURL or PHP libraries like Guzzle. Guzzle is a good one if you are dealing with a REST API.
But you can also find more specific libraries like the SOAP client if you are dealing with a SOAP API
UPDATE:
I just realized EPP is the protocol. Let me know if this link helps, it uses cURL:
https://doc.openprovider.eu/Example_Script_EPP_PHP