|
WSDL. include/import ошибка на стороне .NET client'a
|
|||
---|---|---|---|
#18+
Приветствую, уважаемые! Прошу вашей помощи в решении вопроса... Есть wsdl-файл на стороне сервера <?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='ApiRSE' targetNamespace='http://schemas.xmlsoap.org/wsdl/' xmlns:tns='http://schemas.xmlsoap.org/wsdl/' 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='AuthorizeRequest'> <part name='auth_data' type='tns:AuthorizeRequestType'/> </message> <message name="AuthorizeResponse"> <part name="session_id" type="tns:AuthorizeResponseType"/> </message> <message name="GetFuelRequest"> <part name="request" type="tns:GetFuelRequestType"/> </message> <message name="GetFuelResponse"> <part name="response" type="tns:GetFuelResponseType"/> </message> <types> <xsd:schema targetNamespace=" http://schemas.xmlsoap.org/wsdl/" elementFormDefault="unqualified"> <xsd:import namespace=" http://schemas.xmlsoap.org/soap/encoding/" schemaLocation=" http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:import schemaLocation="GetFuelTypes.xsd"/> <xsd:complexType name="AuthorizeRequestType"> <xsd:all> <xsd:element name="login" minOccurs="1" maxOccurs="1" type="xsd:string"/> <xsd:element name="password" minOccurs="1" maxOccurs="1" type="xsd:string"/> </xsd:all> </xsd:complexType> <xsd:complexType name="AuthorizeResponseType"> <xsd:sequence> <xsd:element name="session_id" minOccurs="1" maxOccurs="1" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="GetFuelRequestType"> <xsd:sequence> <xsd:element name="session_id" minOccurs="1" maxOccurs="1" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="GetFuelResponseType"> <xsd:all> <xsd:element name="fuel" maxOccurs="1" minOccurs="1" type="tns:FuelList"/> </xsd:all> </xsd:complexType> <xsd:complexType name="FuelList"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="Fuel[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="Fuel"> <xsd:all> <xsd:element name="id" type="xsd:int" minOccurs="1" maxOccurs="1"/> <xsd:element name="descr" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType> </xsd:schema> </types> <portType name='ApiPortType'> <operation name="Authorize"> <input message="tns:AuthorizeRequest"/> <output message="tns:AuthorizeResponse"/> </operation> <operation name="GetFuel"> <input message="tns:GetFuelRequest"/> <output message="tns:GetFuelResponse"/> </operation> </portType> <binding name='ApiBinding' type='tns:ApiPortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='Authorize'> <soap:operation soapAction='urn:xmethods-delayed-quotes#Authorize'/> <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> <operation name='GetFuel'> <soap:operation soapAction='urn:xmethods-delayed-quotes#GetFuel'/> <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='ApiService'> <port name='ApiPort' binding='ApiBinding'> <soap:address location='http://asder:2224/api/soap'/> </port> </service> </definitions> подгружаемый файл GetFuelTypes.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd=" http://www.w3.org/2001/XMLSchema" targetNamespace='http://schemas.xmlsoap.org/wsdl/' xmlns:tns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns='http://schemas.xmlsoap.org/wsdl/'> <xsd:import namespace=" http://schemas.xmlsoap.org/soap/encoding/" schemaLocation=" http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:complexType name="GetFuelRequestType"> <xsd:sequence> <xsd:element name="session_id" minOccurs="1" maxOccurs="1" type="xsd:string"/> </xsd:sequence> <xsd:attribute name="method" type="xsd:string"/> </xsd:complexType> <xsd:complexType name="GetFuelResponseType"> <xsd:all> <xsd:element name="fuel" maxOccurs="1" minOccurs="1" type="tns:FuelList"/> </xsd:all> </xsd:complexType> <xsd:complexType name="FuelList"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="tns:Fuel[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="Fuel"> <xsd:all> <xsd:element name="id" type="xsd:int" minOccurs="1" maxOccurs="1"/> <xsd:element name="descr" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:all> </xsd:complexType></xsd:schema> Происходит ошибка автор+ $exception {"SOAP-ERROR: Encoding: string 'SOAP-ERROR: Parsing Schema: can't import schema from '/var/www/asder/default/misc/file/api/GetFuelTypes.xsd', unexpected 'targetNamespace'='\\xf8...' is not a valid utf-8 string"} System.Exception {System.ServiceModel.FaultException} При этом если загружать файл import'ом - вылетает ошибка (Win-окно) --------------------------- Microsoft Visual Studio Express 2012 для Windows Desktop --------------------------- Документ был распознан, но обработать его не удалось. - Документ WSDL содержит ссылки, которые невозможно разрешить. - DTD запрещен в этом документе XML. Метаданные содержат неразрешимую ссылку: " http://asder:2224/api/soap?wsdl". Тип содержимого text/xml;charset=UTF-8 ответного сообщения не соответствует типу содержимого привязки (application/soap+xml; charset=utf-8). При использовании особого кодировщика необходимо правильно реализовать метод IsContentTypeSupported. Первые 1024 байтов ответного сообщения: "<?xml version ='1.0' encoding ='UTF-8' ?> <definitions name='Api' Если загружать схему ссылкой на xsd - тоже ошибка автор <xsd:include schemaLocation=" http://asder:2224/api/soap?xsd=GetFuelTypes.xsd"></xsd:include> Дополнительные сведения: SOAP-ERROR: Parsing Schema: can't import schema from 'http://asder:2224/api/soap?xsd=GetFuelTypes.xsd' Как это исправить и как правильно будет подтянуть xsd-схему к wsdl? ... |
|||
:
Нравится:
Не нравится:
|
|||
16.09.2013, 15:29 |
|
|
start [/forum/topic.php?fid=19&fpage=11&tid=1397047]: |
0ms |
get settings: |
9ms |
get forum list: |
10ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
27ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
31ms |
get tp. blocked users: |
2ms |
others: | 17ms |
total: | 116ms |
0 / 0 |