Я пытаюсь добавить ссылку на службу в свой проект, и я получаю постоянную ошибку.Ссылка на службу не загружается: Схема с целевым пространством имен не найдена
Я создал макет службы с SOAP UI, который кажется хорошо, то я пытаюсь добавить ссылку на службу в этом макете службы и появляется ошибка:
Warning 14 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Schema with target namespace 'urn:oasis:names:tc:dss:1.0:core:schema' could not be found.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/esign']/wsdl:portType[@name='EsignServiceSoap11PortType']
Ввоз на WSDL где схемы с Пространство имен урна: оазис: имена: дц: ДСС: 1.0: ядро: схема загружаемые:
<wsdl:types>
<schema xmlns="urn:oasis:names:tc:dss:1.0:core:schema">
<import namespace="urn:oasis:names:tc:dss:1.0:core:schema" schemaLocation="oasis-dss-core-schema-v1.0-os.xsd"/>
</schema>
.....
</wsdl:types>
Я уже пытался связать SchemaLocation непосредственно в файл в той же папке, чем WSDL, чтобы URL, где он публикуется на частном сервере и публичном uri, где он также опубликован.
У меня всегда такая же ошибка, и я начинаю чувствовать, что, может быть, я ошибаюсь с источником проблемы.
Любое понимание будет оценено по достоинству.
ОБНОВЛЕНИЕ: я ввел urn: oasis: names: tc: dss: 1.0: core: полное определение схемы внутри моего wsdl-файла вместо того, чтобы его импортировать. Когда я делаю так, SOAP UI все еще правильно создает службу насмешливый, однако, когда я пытаюсь добавить ссылку на службу, эта ошибка возникает при обнаружении службы:
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- DTD is prohibited in this XML document.
Metadata contains a reference that cannot be resolved: 'http://elite8100-3:8088/mockEsignServiceSoap11Binding?WSDL'.
The content type text/html; charset=iso-8859-1 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 455 bytes of the response were: '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>Server</soap:Value>
</soap:Code>
<soap:Reason>
<!--1 or more repetitions:-->
<soap:Text xml:lang="en">Missing operation for soapAction [null] and body element [null] with SOAP Version [SOAP 1.2]</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>'.
The remote server returned an error: (500) Internal Server Error.
If the service is defined in the current solution, try building the solution and adding the service reference again.
edit2: Я использовал Fiddler, чтобы проверить HTTP трафика при попытке создать прокси-сервер, как это было предложено в ответе. Во время создания на Fiddler появляется ошибка 500 внутренних серверов при попытке достичь URL-адреса mockService, ответ с сервера: «Отсутствует операция для soapAction [null] и элемента body [null] с версией SOAP [SOAP 1.2]».
Это, в настоящее время, WSDL, который я использую для создания mockService.
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="http://aplicaciones.serpasa.es/CONTROLAMBIENTAL/oasis-dss-core-schema-v1.0-os.xsd"/>
</schema>
<schema xmlns="http://princast.es/esign/2.0/esign.xsd">
<import namespace="http://princast.es/esign/2.0/esign.xsd" schemaLocation="http://aplicaciones.serpasa.es/CONTROLAMBIENTAL/esign.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="SignRequestMessage">
<wsdl:part element="dss:SignRequest" name="payload"/>
</wsdl:message>
<wsdl:message name="SignResponseMessage">
<wsdl:part element="dss:SignResponse" name="payload"/>
</wsdl:message>
<wsdl:message name="VerifyRequestMessage">
<wsdl:part element="dss:VerifyRequest" name="payload"/>
</wsdl:message>
<wsdl:message name="VerifyResponseMessage">
<wsdl:part element="dss:VerifyResponse" name="payload"/>
</wsdl:message>
<wsdl:message name="GetSignInfoFromDocumentRequestMessage">
<wsdl:part element="esign:SignInfoRequest" name="payload"/>
</wsdl:message>
<wsdl:message name="GetSignInfoFromDocumentResponseMessage">
<wsdl:part element="esign:SignInfo" name="payload"/>
</wsdl:message>
<wsdl:message name="GetSignConfigurationRequestMessage">
<wsdl:part element="esign:SignConfigurationRequest" name="payload"/>
</wsdl:message>
<wsdl:message name="GetSignConfigurationResponseMessage">
<wsdl:part element="esign:SupportedSignConfiguration" name="payload"/>
</wsdl:message>
<!-- Port -->
<wsdl:portType name="EsignServiceSoap11PortType">
<wsdl:operation name="sign">
<wsdl:input message="impl:SignRequestMessage" name="signRequest"/>
<wsdl:output message="impl:SignResponseMessage" name="signResponse"/>
</wsdl:operation>
<wsdl:operation name="verify">
<wsdl:input message="impl:VerifyRequestMessage" name="verifyRequest"/>
<wsdl:output message="impl:VerifyResponseMessage" name="verifyResponse"/>
</wsdl:operation>
<wsdl:operation name="getSignConfiguration">
<wsdl:input message="impl:GetSignConfigurationRequestMessage" name="getSignConfigurationRequest"/>
<wsdl:output message="impl:GetSignConfigurationResponseMessage" name="getSignConfigurationResponse"/>
</wsdl:operation>
<wsdl:operation name="getSignInfoFromDocument">
<wsdl:input message="impl:GetSignInfoFromDocumentRequestMessage" name="getSignInfoFromDocumentRequest"/>
<wsdl:output message="impl:GetSignInfoFromDocumentResponseMessage" name="getSignInfoFromDocumentResponse"/>
</wsdl:operation>
</wsdl:portType>
<!-- Binding -->
<wsdl:binding name="EsignServiceSoap11Binding" type="impl:EsignServiceSoap11PortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sign">
<wsdl:documentation>
Realiza una firma digital delegada sobre un
documento segun el estandard OASIS Digital Signature Service (DSS)
</wsdl:documentation>
<wsdlsoap:operation soapAction="urn:sign"/>
<wsdl:input name="signRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="signResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="verify">
<wsdl:documentation>
Verifica una firma digital OASIS Digital
Signature Service (DSS)
</wsdl:documentation>
<wsdlsoap:operation soapAction="urn:verify"/>
<wsdl:input name="verifyRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="verifyResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSignConfiguration">
<wsdl:documentation>
Obtiene los certificados con los que una
aplicacion en el MC de Firma Digital puede realizar
una firma
</wsdl:documentation>
<wsdlsoap:operation soapAction="urn:getSignConfiguration"/>
<wsdl:input name="getSignConfigurationRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getSignConfigurationResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getSignInfoFromDocument">
<wsdl:documentation>
Obtiene informacion de un fichero de firma
</wsdl:documentation>
<wsdlsoap:operation soapAction="urn:getSignInfoFromDocument"/>
<wsdl:input name="getSignInfoFromDocumentRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getSignInfoFromDocumentResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EsignService">
<wsdl:documentation>
Servicio web de firma digital
</wsdl:documentation>
<wsdl:port binding="impl:EsignServiceSoap11Binding" name="EsignServiceSoap11Port">
<wsdlsoap:address location="http://someexternalsite.com"/>
</wsdl:port>
</wsdl:service>
Я скачал каждый XSD-ассоциированных и опубликовал их на общедоступном сервере, также я изменил schemaLocations поэтому они указывают на адреса на этом общедоступном сервере, однако , проблема, похоже, связана с структурой WSDL.
Для вашего обновления похоже, что заголовок типа содержимого не задан правильно, text/html вместо (application/soap + xml; charset = utf-8), хотя полезная нагрузка выглядит как мыльный конверт. Также сервер бросает (500) Внутреннюю ошибку сервера. У вас есть доступ к ошибкам на этом сервере? – Dijkgraaf
@Dijkgraaf Ошибка типа контента полностью дезориентирует меня, так как когда я просто включаю схему, нет никаких проблем с ней. К сожалению, у меня нет доступа к ошибкам на удаленном сервере. – Bardo
Быстрый вопрос, попытались выяснить, что происходит, когда вы пытаетесь подключиться к локальной тестовой схеме? схема в том же месте, что и проблемная схема? Основной вопрос заключается в том, является ли проблема с доступом к схемам вообще или к этим конкретным схемам? Я знаю, что это не решит проблему, но она будет локализовать проблему. – user3569147