Re: [SOAP] Strange 'Procedure Not Present' error

From: Date: Wed, 24 Jan 2007 20:15:16 +0000
Subject: Re: [SOAP] Strange 'Procedure Not Present' error
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-2451@lists.php.net to get a copy of this message
Well, it suddenly started working. The only thing that I can think of that might have caused it to start working now is that my machine rebooted and perhaps reset something cached somewhere. Does this make sense? If it matters, I am running PHP 5.2 on MacOSX 10.4.8 with Apache 1.3. On Jan 24, 2007, at 2:29 PM, Eric Gorr wrote:
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


« previous php.soap (#2451) next »