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
How can I send this data and then receive data from the server?
Read RFC 5734 "Extensible Provisioning Protocol (EPP) Transport over TCP" multiple times, and very carefully.
Of course to really understand it you will need to read all RFCs regarding EPP, that is RFC 5730 to 5733 and then if you are serious about being a registrar you will need to read the one on RGP and the one on secDNS-1.1 for the 2 major extensions used almost everywhere. Then of course registry specific extensions (I believe you are trying to connect to EURid or DNSBelgium).
In short:
open a TLS socket to the registry EPP server, typically on port 700
do your cryptography correctly: validate the server certificate!
start to read, as the server speaks first, with the <greeting>
extract objURI and extURI from there to build your <login> correctly (check registry documentation for which extensions are mandatory)
send your <login> frame
check the return code, and then do all other command/responses.
Make sure to understand from RFC 5734 that each EPP frame has to be prefixed by 4 octets encoding the length of the frame: on input (from registry) this let you know how much data you are getting, on output you have to generate it properly, otherwise the registry won't read your response.
If you are beginning in the registrar world, building from scratch a proper EPP client may not be the most desirable job, and I wouldn't necessarily recommend you to do that. There are a lot of small details to get right, specifically if you plan to connect to different registries.
If you search on EPP tag here you can easily find other questions, and answers that should help you:
PHP socket fread response takes forever
PHP TCP connection to EPP API using SSL certificate authentication
Client certificate on EPP Call
EPP call is returning empty value on xml post
You can also find that PHP libraries exist to do EPP so this might save you some time (and make you loose some in understanding the library and fitting it in your own ecosystem). See centralnic PHP EPP library - login frame for a lead for example.
PS: I participated in EPP specifications, and wrote multiple EPP clients and servers over the last 20 years or so.
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:
What is the type of the API I'm trying to interact with?
Is it a XML-RPC? SOAP? Maybe REST API?
Is it a custom API?
What are the API endpoints?
Does this API have a manual?
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
Related
for a customer I want to implement the OTA service in an interface to check availabilty and things like that.
I've downloaded the 2017 specifications from OpenTravel. But I lack some information. I want to realize it with PHP and SOAP and later connect it to Magento. But I can't find any url for the SOAP client to send those XMLs to.
I would greatly appreciate any help on this topic or maybe suggestions to do it in an easier way.
Greetings
Consuming OTA SOAP web services is tricky as PHP SoapClient class does not handle it properly.
First you should generate the PHP sdk from the WSDL corresponding to the availabilities you need to send requests to. You should give the PackageGenerator project from Github a try.
Nevertheless, as I said, the native PHP SoapClient class does not map the parameters to the XML request correctly. This is where you have to write your proper code to handle the mapping from the PHP objects to the XML request.
As I work regularly on these sorte of issues, I can help you further but only privately at contact#wsdltophp.com.
I am consuming a web service written in PHP. I am using axis to generate client jar on my side but when i generate client code from WSDL and make request, request xml contains multiRef tag and the php server can not understand this tag. I will ask them to generate a wsdl in a new way. I searched and there are many ways in php to create wsdl. Which method is the best way for the clients using axis? Have you experienced such a problem before? if yes what did you do?
Thanks.
The service was rpc-encoded, i ask them to change it to rpc-literal and the problem is solved.
I´m trying to do an integration between my own PHP application, and other external software which is 'waiting for' (listening) SOAP messages. But the key question on my situation is that this software which is listening for SOAP messages only accepts RAW contents and has no method which could be called, or Wsdl to be used.
Yes I know... it´s quite strange because with SOAP you usually should send a method request with some parameters, but in this case the only that I have is a URL where I should send with SOAP message that should contain only an string (formatted in a special way which is not a problem), and then this server will return to my PHP application another SOAP message that will contain a string. And that´s all.
Seems that in my case I can not use a PHP SOAP library because I have no method (or function) to call; the only thing that I have is a URL and a string that I should pass like a parameter. I´ve been thinking of using PHP sockets to create a basic SOAP message to that 'strange soap server', but I have no clue about how to do it, or how I woule create with PHP a way to keep my application waiting for the answer comming from that external server.
Thank you so much for your help in advance.
You might be best of by just making the WSDL on your own. It isn't the most trivial thing to do, but it is well documented so you should be able to figure it out.
THere is no need to get the WSDL from the service you're sinding your requests to (it is rather better to have WSDL locally in some cases), so you just initialize the default SOAP client in PHP with that local WSDL, and off you go.
I have to write soap wsdl server in php.
Requirement:
request:two parameters say startDate & endDate
response: as follows
<students>
<student FirstName='Mr. A' LastName='B' />
<student FirstName='Mr. B' LastName='C' />
</students>
Can any one help me writing wsdl file & soap server for the above requirement. I tried many ways but failing for last 4 days.
Please help in writing WSDL file & SOAP Server which communicates with WSDL file, if possible a test client to verify.
Thanks in Advance
Try the SoapServer class:
http://www.php.net/manual/en/class.soapserver.php
Keep in mind that this class is not always available:
http://www.php.net/manual/en/soap.installation.php
Using Google I found a few tutorials explaining how to set up a SOAP web service:
http://devzone.zend.com/25/php-soap-extension/
http://www.phpeveryday.com/articles/Web-Services-WSDL-Creating-SOAP-Server-P477.html
Please help in writing WSDL file & SOAP Server which communicates with
WSDL file, if possible a test client to verify.
IMHO quite high expectations on a simple Q&A site...
Hey!
I don't really understand what soap is but it doesn't matter. I need to make some soap site that redirect to normal site or have simple content in it like 'test'.
I will need to acces it by soap:// ---- is it ever possible ?
Never good idea to use something that you classify as "I don't really understand what soap is but it doesn't matter"
http://www.w3schools.com/SOAP/soap_intro.asp
Go through it its quite good and simple
And yea its not possible at least to my knowledge
And if you do not feel like clicking link this might help (from w3schools.com)
What is SOAP?
SOAP stands for Simple Object Access Protocol
SOAP is a communication protocol
SOAP is for communication between applications
SOAP is a format for sending messages
SOAP communicates via Internet
SOAP is platform independent
SOAP is language independent
SOAP is based on XML
SOAP is simple and extensible
SOAP allows you to get around firewalls
SOAP is a W3C recommendation
No it's not really possible. Yes, it does mater if you understand what SOAP is.
You can't redirect from a SOAP "site" to a "normal" site. That's because there are no SOAP "sites". SOAP uses XML that is not able to be parsed by a web browser. The web browser needs to do the redirecting.
If you mean to say that you want a certain URL that runs a SOAP service to redirect web browsers to a different page, then you'll have to look reading the user agent, and giving the appropriate response.
This is in fact a useful and good idea if you are developing a SOAP service, but it doesn't sound like that's what you are doing.