Всем доброго времени суток!!!!!!! Хочк создать клента для web службы... Пишу его на C# через Visual C# Express Edition..... При добавлении ссылки на службу(Проект -> Добавить ссылку на службу...) с адресом пробного примера, возникает ошибка такого рода: | Код | Документ HTML не содержит информации обнаружения веб-служб. Метаданные содержат неразрешимую ссылку: "http://elslepas.jino.ru/megafon/soap/soap.wsdl". Тип содержимого text/html; charset=windows-1251 ответного сообщения не соответствует типу содержимого привязки (application/soap+xml; charset=utf-8). При использовании особого кодировщика необходимо правильно реализовать метод IsContentTypeSupported. Первые 1024 байтов ответного сообщения: "<?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='StockQuote' targetNamespace='http://example.org/StockQuote' xmlns:tns=' http://example.org/StockQuote ' 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:". Если служба определена в текущем решении, попробуйте построить решение и добавить ссылку на службу еще раз.
|
wsdl документ находится тут | Код | <?xml version ='1.0' encoding ='UTF-8'?> <definitions name='StockQuote' targetNamespace='http://example.org/StockQuote' xmlns:tns=' http://example.org/StockQuote ' 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='StockQuoteBinding'> <soap:address location='http://elslepas.jino.ru/megafon/soap/soap.php'/> </port> </service> </definitions>
|
код php обработчика wsdl документа(http://elslepas.jino.ru/megafon/soap/soap.php) | Код | <?php $quotes = array( "ibm" => 98.99, "it" => 37.21 );
function getQuote($symbol) { global $quotes; return $quotes[$symbol]; }
ini_set("soap.wsdl_cache_enabled", "0"); // отключаем кэширование WSDL $server = new SoapServer("http://elslepas.jino.ru/megafon/soap/soap.wsdl"); $server->addFunction("getQuote"); $server->handle(); ?>
|
Далал клинта на php, все работает, а вто на C# нет(
|