Гость
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / Add Service Reference / 8 сообщений из 8, страница 1 из 1
18.01.2017, 12:33
    #39386762
INFINITs
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
В студии делаю Add Service Reference... указываю
http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004656?wsdl

Получаю следующие варнинги. Подскажите в какую сторону копать?

Аналогично если делать через svcutil.exe
Но svcutil.exe /t:metadata http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004656?wsdl успешно выкачивает все xsd и т.д.

Warning 1
Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'CRACheckRequest' and namespace 'http://smev.gosuslugi.ru/rev111111' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://smev.gosuslugi.ru/rev111111'.
Please check the XSD documents provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mvd.ru/services/cra']/wsdl:portType[@name='CRAService']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Warning 2
Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://mvd.ru/services/cra']/wsdl:portType[@name='CRAService']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mvd.ru/services/cra']/wsdl:binding[@name='CRAServicePortBinding']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Warning 3
Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://mvd.ru/services/cra']/wsdl:binding[@name='CRAServicePortBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://mvd.ru/services/cra']/wsdl:service[@name='CRAService']/wsdl:port[@name='CRAServicePort']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Warning 4
Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'CRACheckRequest' and namespace 'http://smev.gosuslugi.ru/rev111111' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://smev.gosuslugi.ru/rev111111'.
Please check the XSD documents provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev24/ws']/wsdl:portType[@name='NCoreDxSmev24Port']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Warning 5
Custom tool warning: Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev24/ws']/wsdl:portType[@name='NCoreDxSmev24Port']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev24/ws']/wsdl:binding[@name='NCoreDxSmev24Binding']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Warning 6 Custom tool warning: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev24/ws']/wsdl:binding[@name='NCoreDxSmev24Binding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev24/ws']/wsdl:service[@name='NCoreDxSmev24Service']/wsdl:port[@name='NCoreDxSmev24Port']
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4

Error 7
Custom tool error: Failed to generate code for the service reference 'ServiceReference1'.
Please check other error and warning messages for details.
c:\users\infinits\documents\visual studio 2013\Projects\Test\ConsoleApplication4\ConsoleApplication4\Service References\ServiceReference1\Reference.svcmap 1 1 ConsoleApplication4
...
Рейтинг: 0 / 0
18.01.2017, 14:30
    #39386895
МихаилР
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
INFINITsВ студии делаю Add Service Reference... указываю
http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004656?wsdl
Получаю следующие варнинги. Подскажите в какую сторону копать?


В сторону разработчиков СМЭВ, а точнее разработчиков сервиса с namespace http://mvd.ru/services/cra.
Собственно проблема понятная. В вашем WSDL объявлено, что структура сервиса CRAService выглядит вот так (я выбросил лишнее):
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
   <message name="CRAGetRequestInput">
    <part name="data" element="smev:CRAGetRequest" />
  </message>
  <message name="CRAGetRequestOutput">
    <part name="data" element="smev:CRAGetResponse" />
  </message>
  <message name="CRACheckRequestInput">
    <part name="data" element="smev:CRACheckRequest" />
  </message>
  <message name="CRACheckRequestOutput">
    <part name="data" element="smev:CRACheckResponse" />
  </message>
  <portType name="CRAService">
    <operation name="getGunsInfo">
      <input message="mvd:CRAGetRequestInput" />
      <output message="mvd:CRAGetRequestOutput" />
    </operation>
    <operation name="checkStatus">
      <input message="mvd:CRACheckRequestInput" />
      <output message="mvd:CRACheckRequestOutput" />
    </operation>
  </portType>
  <binding name="CRAServicePortBinding" type="mvd:CRAService">
     <!-- ... -->
  </binding>
  <service name="CRAService">
    <port name="CRAServicePort" binding="mvd:CRAServicePortBinding">
      <soap:address location="http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004656/1.00" />
    </port>
  </service>



Т.е. парсер WSDL пытается разобрать структуру порта <portType name="CRAService">. Этот порт включает в себя 2 операции getGunsInfo и checkStatus. С первой, как ни странно всё в порядке, а вот со второй - сложности.
Для обеих операций используются по 2 сообщения (на вход и выход: CRAGetRequestInput/CRAGetRequestOutput, CRACheckRequestInput/CRACheckRequestOutput) каждая имеет структуру, которая должна быть описана в пространстве имен
Код: xml
1.
xmlns:smev="http://smev.gosuslugi.ru/rev111111".



Смотрим откуда можно взять схему для этого пространства имен. Ссылка ровно 1:
Код: xml
1.
<xs:import schemaLocation="http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004656/1.00/wsdl/FSSP02/12d59e6a-6dda-4e14-a5f0-518a5a02b0f6" namespace="http://smev.gosuslugi.ru/rev111111" />



Качаем эту XSD, и обнаруживаем там только
Код: xml
1.
2.
3.
4.
5.
6.
  <xs:element name="CRAGetRequest">
       <!-- ... -->
  </xs:element>
  <xs:element name="CRAGetResponse">
    <!-- ... -->
  </xs:element>



Т.е. для первой операции структуры есть, а для второй - нет.
Почему так - ответить могут только разработчики.

Я могу только предложить следующее: т.к. в описании самого биндинга
Код: xml
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
  <binding name="CRAServicePortBinding" type="mvd:CRAService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsp:PolicyReference URI="#SmevPolicy" />
    <operation name="getGunsInfo">
      <soap:operation soapAction="" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>



Объявлена только 1 операция, то вторая просто пока не готова. Поэтому попробуйте скачать все файлы wsdl и xsd, а затем удалите из wsdl
операцию "checkStatus" из описания port type

описание сообщений CRACheckRequestInput и CRACheckRequestOutput

И попробуйте сгенерировать код из полученных файлов.

У меня прошло без ошибок в генерации контрактов, но споткнулось на определении политик безопасности. И да, тип GunsListType, тоже, похоже, не удастся просто так импортировать - (он, похоже, используется во второй операции, но он не совместим с DataContractSerializer, судя по всему).
...
Рейтинг: 0 / 0
19.01.2017, 01:35
    #39387279
INFINITs
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
Огромное спасибо.
Будем писать разработчикам и попробую сделать как Вы сказали.
...
Рейтинг: 0 / 0
19.01.2017, 09:05
    #39387350
INFINITs
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
МихаилРУ меня прошло без ошибок в генерации контрактов, но споткнулось на определении политик безопасности.


Как оказалось существует еще один сервис, в котором они вырезали не доделанные методы.
http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004657?wsdl

Но как я понимаю, как раз это и есть проблема с политиками.
Как я понимаю, отчасти на это можно забить а все привязки описать самому в app.config и все будет гуд?
Или все же можно, как-то настроить чтобы студия все сгенерила сама?

Warning 1
Custom tool warning: Cannot import wsdl: binding
Detail: An exception was thrown in a call to a policy import extension.
Extension: System.ServiceModel.Channels.SecurityBindingElementImporter
Error: An unsupported security policy assertion was detected during the security policy import: <sp:AsymmetricBinding xmlns:sp=" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:Policy xmlns:wsp=" http://www.w3.org/ns/ws-policy">
<sp:InitiatorToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken=" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Always">
<wsp:Policy>
<sp:RequireThumbprintReference />
</wsp:Policy>
</sp:X509Token>
</wsp:Policy>
</sp:InitiatorToken>
<sp:RecipientToken>
<wsp:Policy>
<sp:X509Token sp:IncludeToken=" http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Always">
<wsp:Policy>
...
XPath to Error Source: //wsdl: definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev25/ws']/wsdl: binding[@name='NCoreDxSmev25Binding']

Warning 2
Custom tool warning: Cannot import wsdl: port
Detail: There was an error importing a wsdl: binding that the wsdl:port is dependent on.
XPath to wsdl: binding: //wsdl:definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev25/ws']/wsdl: binding[@name='NCoreDxSmev25Binding']
XPath to Error Source: //wsdl: definitions[@targetNamespace='http://www.red-soft.biz/ncore/dx/1.1/smev25/ws']/wsdl: service[@name='NCoreDxSmev25Service']/wsdl:port[@name='NCoreDxSmev25Port']
...
Рейтинг: 0 / 0
19.01.2017, 10:41
    #39387418
INFINITs
Гость
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
Как я понимаю basicHttpBinding не о собо совместим algorithmSuite="BasicGost", видимо надо делать какой-то custombinding?

Или же все вынести в код где algorithmSuite будет определяться сторроней библиотекой?

Код: c#
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="NCoreDxSmev25Binding" textEncoding="utf-8">
                    <security mode="Transport">
                        <message clientCredentialType="Certificate" algorithmSuite="BasicGost" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://smev-mvf.test.gosuslugi.ru:7777/gateway/services/SID0004657/1.00"
                binding="basicHttpBinding" bindingConfiguration="NCoreDxSmev25Binding"
                contract="fssp.NCoreDxSmev25Port" name="NCoreDxSmev25Port" />
        </client>
    </system.serviceModel>
</configuration>
...
Рейтинг: 0 / 0
19.01.2017, 17:44
    #39387862
МихаилР
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
INFINITs,

По поводу шифрования ничего сказать не могу, не занимался.
Знаю только, что вся криптография (включая ассиметричную и сертификаты в том числе), построена на базе семейства алгоритмов GOST.

В это форуме коллеги уже обсуждали как его добавить к WCF. Если не ошибаюсь, при этом использовались криптомодули от кого-то из сертифицированных поставщиков.

Увы, это всё чем могу помочь. Попробуйте поднять старые темы.
...
Рейтинг: 0 / 0
19.01.2017, 18:09
    #39387879
МихаилР
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
МихаилРЗнаю только, что вся криптография (включая ассиметричную и сертификаты в том числе), построена на базе семейства алгоритмов GOST.
Имеется в виду криптография для СМЭВ и прочих госсервисов.
...
Рейтинг: 0 / 0
06.02.2017, 18:10
    #39399510
Алымов Анатолий
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Add Service Reference
Для шифрования придется использовать сертифицированных поставщиков и соответственно сертификаты от них (CryptoPro, VipNet и т.п.) По мне так наиболее удобен CryptoPro, т.к. у него есть библиотеки для NET и Java и не надо на низком уровне программировать.
...
Рейтинг: 0 / 0
Форумы / WCF, Web Services, Remoting [игнор отключен] [закрыт для гостей] / Add Service Reference / 8 сообщений из 8, страница 1 из 1
Целевая тема:
Создать новую тему:
Автор:
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]