WSDL web services example php.

In my previous article, i explain the thrmo of the web services using WSDL in php. Now, here i give the example of the WSDL web services, so you should be more clear on the php web services examples.

Below is the complete XML code for helloword wsdl web services in which we load text from the server. here user give there name as input (like php freelancer), while server give the output “hello, php freelancer”.

<?xml version="1.0"?>
<definitions name="helloworld" targetnamespace="urn:helloworld" xmlns:tns="urn:helloworld"  xmlns:xsd="" xmlns:soap="" xmlns:soapenc="" xmlns:wsdl="" xmlns="">
    <xsd:schema xmlns="" targetnamespace="urn:hello">
      <xsd:element name="getname" type="xsd:string" />
	  <xsd:element name="helloresponse" type="xsd:string" />	 	  
  <message name="dohello">
    <part name="yourname" type="tns:getname" />
  <message name="dohelloresponse">
    <part name="return" type="tns:helloresponse" />
  <portType name="helloport">
    <operation name="dohello">
	  <input message="tns:dohello" />
	  <output message="tns:dohelloresponse" />
  <binding name="hellobinding" type="tns:helloport">
    <soap:binding style="rpc" transport="" />
	  <operation name="dohello">
	    <soap:operation soapAction="urn:helloaction" />
		  <soap:body use="encoded" namespace="urn:hello" encodingStyle="" />		  
		  <soap:body use="encoded" namespace="urn:hello" encodingStyle="" />		  
  <service name="helloService">
    <port name="helloport" binding="tns:hellobinding">
	  <soap:address location="http://localhost/test/wsdl/hello_server.php" />