I have a WSDL generated by a webservice in java, and I need to replicate this same web service in a php application.
I looked, and most scripts I found just generate the client. And I need server side that will be consumed.
WSDL stands for Web Services Description Language.
WSDL is an XML notation for describing a web service. A WSDL definition tells a client how to compose a web service request and describes the interface that is provided by the web service provider.
If you have the WSDL then you can simply pass it to the SoapServer class defined in PHP5.
$server = new SoapServer("some.wsdl");
$server->setClass('MySoapServer');
$server->handle();
Of course, you'll need to write the MySoapServer
class to handle the methods as defined in your WDSL to make this example work.
For example, if the WDSL defined an add($a, $b)
function, the class would be like so:
class MySoapServer
{
public function add($a, $b)
{
return $a + $b;
}
}
Source: http://au1.php.net/manual/en/soapserver.soapserver.php & http://au1.php.net/manual/en/soapserver.setclass.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With