|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-25 19:08 UTC] tony2001@php.net
[2007-07-03 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 19:00:01 2025 UTC |
Description: ------------ Title: ini_set("soap.wsdl_cache_enabled", "0"); not work under the debian Phenomenons: server1.php <?php $quotes = array ( "ibm" => 98.42 ); function getQuote($symbol) { global $quotes; //return $quotes[$symbol]; return "kill soap"; }; ini_set("soap.wsdl_cache_enabled", "0"); $server = new SoapServer("http://192.168.0.110/model/stockquote.wsdl"); $server -> addFunction ("getQuote"); $server -> handle(); ?> client1.php <?php /* * Created on 2007-6-11 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ $client = new SoapClient("http://192.168.0.110/model/stockquote.wsdl", array ( "trace" => 1, "exceptions" => 0)); try { $value = $client -> getQuote("ibm"); echo "value=" . $value."\n"; var_dump ( $client -> __getFunctions() ); if (is_soap_fault($value)) { trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR); } print "<pre>\n"; echo "RequestHeaders:\n".htmlspecialchars( $client -> __getLastRequestHeaders()) . "\n"; echo "Request:\n". htmlspecialchars ( $client -> __getLastRequest() ) . "\n"; echo "ResponseHeaders:\n". htmlspecialchars ( $client -> __getLastResponseHeaders()) . "\n"; echo "Response:\n" . htmlspecialchars ( $client -> __getLastResponse()) . "\n"; print "</pre>"; } catch ( SoapFault $exception) { echo 'Exception=' . $exception . "\n<br/>"; } ?> stockquote.wsdl <?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='StockQuote' targetNamespace='http://example.org/StockQuote' xmlns:tns=' http://localhost/voddler/ ' 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='getQuoteRequest'> <part name='symbol' type='xsd:string'/> </message> <message name='getQuoteResponse'> <part name='Result' type='xsd:float'/> </message> <portType name='StockQuotePortType'> <operation name='getQuote'> <input message='tns:getQuoteRequest'/> <output message='tns:getQuoteResponse'/> </operation> </portType> <binding name='StockQuoteBinding' type='tns:StockQuotePortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='getQuote'> <soap:operation soapAction='urn:xmethods-delayed-quotes#getQuote'/> <input> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> </binding> <service name='StockQuoteService'> <port name='StockQuotePort' binding='tns:StockQuoteBinding'> <soap:address location='http://192.168.0.110/server1.php'/> </port> </service> </definitions> In browser prompt: not found. In the apache "error.log" prompt "/var/www/voddler/server1.php not found or unable to stat".( We have define <soap:address location='http://192.168.0.110/voddler/server1.php'/> in the stockquote.wsdl. After clear the "wsdl_cache_dir" contents. It works.