Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770
Форумы портала PHP.SU :: Версия для печати :: помогите плиз
Форумы портала PHP.SU » » Вопросы новичков » помогите плиз

Страниц (1): [1]
 

1. FreeRus - 27 Сентября, 2011 - 07:27:51 - перейти к сообщению
выводит ошибку:

SoapFault exception: [HTTP] Not Found in L:\home\cti.ru\www\webservice\client1.php:5
Stack trace:
#0 [internal function]: SoapClient->__doRequest('__call('getQuote', Array)
#2 L:\home\cti.ru\www\webservice\client1.php(5): SoapClient->getQuote('ibm')
#3 {main}

Коды следующие:

файл - stockquote.wsdl

CODE (xml):
скопировать код в буфер обмена
  1. <?xml version ='1.0' encoding ='UTF-8' ?>
  2. <definitions name='StockQuote'
  3. targetNamespace='http://example.org/StockQuote'
  4. xmlns:tns=' http://example.org/StockQuote '
  5. xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  6. xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  7. xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
  8. xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
  9. xmlns='http://schemas.xmlsoap.org/wsdl/'>
  10.  
  11. <message name='getQuoteRequest'>
  12.  <part name='symbol' type='xsd:string'/>
  13. </message>
  14. <message name='getQuoteResponse'>
  15.  <part name='Result' type='xsd:float'/>
  16. </message>
  17.  
  18. <portType name='StockQuotePortType'>
  19.  <operation name='getQuote'>
  20.   <input message='tns:getQuoteRequest'/>
  21.   <output message='tns:getQuoteResponse'/>
  22.  </operation>
  23. </portType>
  24.  
  25. <binding name='StockQuoteBinding' type='tns:StockQuotePortType'>
  26.  <soap:binding style='rpc'
  27.  transport='http://schemas.xmlsoap.org/soap/http'/>
  28.  <operation name='getQuote'>
  29.   <soap:operation soapAction='urn:xmethods-delayed-quotes#getQuote'/>
  30.   <input>
  31.    <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
  32.    encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
  33.   </input>
  34.   <output>
  35.    <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
  36.    encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
  37.   </output>
  38.  </operation>
  39. </binding>
  40.  
  41. <service name='StockQuoteService'>
  42.  <port name='StockQuotePort' binding='StockQuoteBinding'>
  43.   <soap:address location='http://cti.ru/webservice/stockquote.php'/>
  44.  </port>
  45. </service>
  46. </definitions>


Файл - client1.php

PHP:
скопировать код в буфер обмена
  1. <?PHP
  2.   $client = new SoapClient("stockquote.wsdl");
  3.   try {
  4.     echo "<pre>\n";
  5.     print($client->getQuote("ibm"));
  6.     echo "\n";
  7.     print($client->getQuote("microsoft"));    
  8.     echo "\n</pre>\n";
  9.   } CATCH (SoapFault $exception) {
  10.     echo $exception;        
  11.   }
  12. ?>


Файл - server1.php

PHP:
скопировать код в буфер обмена
  1. <?PHP
  2. $quotes = array("ibm" => 98.42);    
  3.  
  4. function getQuote($symbol) {
  5.   global $quotes;
  6.   return $quotes[$symbol];
  7. }
  8.  
  9. ini_set("soap.wsdl_cache_enabled", "0"); // отключаем кэширование WSDL
  10. $server = new SoapServer("stockquote.wsdl");
  11. $server->addFunction("getQuote");
  12. $server->handle();
  13. ?>
2. morosit - 27 Сентября, 2011 - 07:42:38 - перейти к сообщению
могу ошибаться но кажется ругается на неопределённый обьект

FreeRus подождем пока модераторы код в спецтеги оформят или вы сами справитесь
3. FreeRus - 27 Сентября, 2011 - 07:46:41 - перейти к сообщению
Подскажите пожалуйста где именно нужно исправить!

 

Powered by ExBB FM 1.0 RC1