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

From: Date: Thu, 15 Nov 2007 12:59:11 +0000
Subject: Re: [SOAP] Strange 'Procedure Not Present' error
References: 1 2  Groups: php.soap 
Request: Send a blank email to php-soap+get-2697@lists.php.net to get a copy of this message
I had the same problem and in turned out that it was caused by WSDL-Caching. I used a faulty WSDL file that was cached. I changed the WSDL, but the soap server object kept using the cached one, resulting in procedure not present errors. After removing the cached WSDL (files in /tmp/wsdl-XX) everything worked fine. For development, you can swith of the caching in the php.ini or use an ini_set in your code. Johan Eric Gorr wrote: > > 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/'Nþ >> –°ÄÿT*xÂKÜìÍ >> 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 >> > > > -- > PHP Soap Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- View this message in context: http://www.nabble.com/Strange-%27Procedure-Not-Present%27-error-tf3084041.html#a13767119 Sent from the Php - Soap mailing list archive at Nabble.com.

« previous php.soap (#2697) next »