wsdl soap server not returning xml - php

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...

Related

How can I send XML (epp) request and then receive data? (PHP)

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

PHP SOAP OTA Connection

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.

How to test a wsdl webservice?

i'm completely new to webservices (and especially with SOAP / WSDL)
Right now, i have a .WSDL in the root of my server which i have fully automatically generated.
How to test that my webservice is functionning (echoing the right results) without bugs ?
*How to interact with that .wsdl file ?*
Regards.
Or use SOAP UI.
If you want to use PHP, I would say you look into PHP SoapClient.

PHP site to post data to ASP.net Webservice

I've got a site running on php and I need my form to post data to an ASP.Net web service. All I have from the ASP.Net web service is a url ending in .svc and then I open up the url I get another link that I can click on which ends in .svc?wdsl
This is all pretty new to me so I'm not sure where to begin, any pointers?
Thanks
The ASP.NET site is exposing a WCF service, and the ?wsdl url you're seeing (pronounced wis-dul) is a XML file which describes all of the functionality provided by the service and the input/output parameters. See the Wikipedia article on Web Services Description Language for more info.
With the small amount of background info, you can find some examples about consuming a WCF service from PHP (the fact that it's a WCF service shouldn't make any difference btw, so any example of consuming a web service should work):
http://weblogs.asp.net/gunnarpeipman/archive/2007/09/17/using-wcf-services-with-php.aspx
http://spacebug.com/php-calling-wcf-part-2-html/
The .svc?wsdl link will give you the WSDL for the web service (which describes which methods are available and what their parameters are).
Once you have the WSDL, you can construct a SoapClient with it and call the methods.
It sounds like you've been given a .NET SOAP Web Service to consume.
Check out the PHP docs for consuming/working with SOAP Services:
PHP: SOAP - Manual (Paying close attention to SoapClient which is what you'll use to actually construct and call the service)
steven,
you'll need to do a refresher on wsdl and webservices under .net.
there are obviously lots of places to look online but certainly if you google: 'asp.net wcf wsdl webservice' you should get plenty of hits to help you along.
jim

PHP Soap (Server)

I am trying to create a webservice using the PHP Soap extension and I am having problems with the .wsdl. Is there an easy way to generate 2.0 wsdl's? Where is a good site (or book) that I can look to in order to determine how to build the WSDL? I have no problem getting my soap client to retrieve soap messages from other web services so I know soap is installed and working. I have found a few links out there that generate WSDL's for you, but most of the sites are down. Any help pointing me in the right direction would be helpful
PHP does not have a built-in WSDL generation utility. I would recommend using Zend_Soap_Server which supports WSDL generation via its Autodiscover feature.

Categories