Strange 'Procedure Not Present' error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The soap server code & WSDL file is below.
I am using the very useful MacOSX app http://ditchnet.org/soapclient/ to test with - if I write PHP client code, I get the same 'not present' error.

I am being told that my IsRegistered function is not present. The WSDL file validates.

Any ideas on why this would be the case and what I can do to fix the problem?

p.s. if you have any suggestions on improvements I can make to the WSDL file, I would be interested.


<?PHP
	function IsRegistered( $serial_number ) {
		$serialNumbers = array( "42" => 1 );

		if (isset( $serialNumbers[ $serial_number ] ) ) {
		  return true;
		}
		else {
throw new SoapFault( "Server", "Unknown serial number: '$serial_number'." );
		}
	  }

	function Register( $serial_number ) {
		$serialNumbers = array( "42" => 1 );

		if (isset( $serialNumbers[ $serial_number ] ) ) {
		  return true;
		}
		else {
throw new SoapFault( "Server", "Failed To Register: '$serial_number'." );
		}
	}

$server = new SoapServer( "protection.wsdl" );

$server->addFunction( "IsRegistered" );
$server->addFunction( "Register" );

$server->handle();
?>



<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='Protection'
  targetNamespace='http://myCompany.net/Protection'
  xmlns:tns='http://myCompany.net/Protection'
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
  xmlns='http://schemas.xmlsoap.org/wsdl/'>

<message name='submitRegistration'>
  <part name='serial_number' type='xsd:string'/>
</message>
<message name='getSubmitRegistrationResponse'>
  <part name='Result' type='xsd:boolean'/>
</message>

<message name='checkRegistration'>
  <part name='serial_number' type='xsd:string'/>
</message>
<message name='getCheckRegistrationResponse'>
  <part name='Result' type='xsd:boolean'/>
</message>

<portType name='ProtectionPortType'>
  <operation name='Register'>
    <input message='tns:submitRegistration'/>
    <output message='tns:getSubmitRegistrationResponse'/>
  </operation>

  <operation name='IsRegistered'>
    <input message='tns:checkRegistration'/>
    <output message='tns:getCheckRegistrationResponse'/>
  </operation>
</portType>

<binding name='ProtectionBinding' type='tns:ProtectionPortType'>
  <soap:binding style='rpc'
    transport='http://schemas.xmlsoap.org/soap/http'/>

  <operation name='Register'>
    <soap:operation soapAction='urn:myCompany_protection#Register'/>
    <input>
      <soap:body use='encoded' namespace='urn:myCompany_protection'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>
    <output>
      <soap:body use='encoded' namespace='urn:myCompany_protection'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
  </operation>

  <operation name='IsRegistered'>
<soap:operation soapAction='urn:myCompany_protection#IsRegistered'/>
    <input>
      <soap:body use='encoded' namespace='urn:myCompany_protection'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>
    <output>
      <soap:body use='encoded' namespace='urn:myCompany_protection'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
  </operation>

</binding>

<service name='ProtectionService'>
<port name='ProtectionPort' binding='tns:ProtectionBinding'>
<soap:address location='http://localhost/~Eric/protection/ protectionSoapServer.php'/>
</port>
</service>

</definitions>

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux