На главную
ПРАВИЛА FAQ Помощь Участники Календарь Избранное DigiMania RSS
msm.ru
Модераторы: maxim84_, juice
  
> WCF на HTTPS, не могу перевести
    здравствуйте господа
    возникла проблема при переходе с HTTP на HTTPS.
    вот конфиг, правильно работающий на HTTP. (лишнее вырезано)
    ExpandedWrap disabled
      <?xml version="1.0"?>
      <configuration>
         <system.web>
          <compilation debug="true" targetFramework="4.0" />
        </system.web>
        <system.serviceModel>
          <behaviors>
            <serviceBehaviors>
              <behavior>
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="false"/>
              </behavior>
            </serviceBehaviors>
          </behaviors>
          <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
        </system.serviceModel>
      <system.webServer>
          <modules runAllManagedModulesForAllRequests="true"/>
        </system.webServer>
      </configuration>

    и соответствуиший wsdl.
    ExpandedWrap disabled
      <?xml version="1.0" encoding="utf-8" ?>
      - <wsdl:definitions name="Transfer" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
      - <wsdl:types>
      - <xsd:schema targetNamespace="http://tempuri.org/Imports">
        <xsd:import schemaLocation="http://REAL IP:9097/Transfer.svc?xsd=xsd0" namespace="http://tempuri.org/" />
        <xsd:import schemaLocation="http://REAL IP:9097/Transfer.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
        <xsd:import schemaLocation="http://REAL IP:9097/Transfer.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/BankConstanta.SoflisVaucheri" />
        </xsd:schema>
        </wsdl:types>
      - <wsdl:message name="ITransfer_createMoneyTransfer_InputMessage">
        <wsdl:part name="parameters" element="tns:createMoneyTransfer" />
        </wsdl:message>
      - <wsdl:message name="ITransfer_createMoneyTransfer_OutputMessage">
        <wsdl:part name="parameters" element="tns:createMoneyTransferResponse" />
        </wsdl:message>
      - <wsdl:portType name="ITransfer">
      - <wsdl:operation name="createMoneyTransfer">
        <wsdl:input wsaw:Action="http://tempuri.org/ITransfer/createMoneyTransfer" message="tns:ITransfer_createMoneyTransfer_InputMessage" />
        <wsdl:output wsaw:Action="http://tempuri.org/ITransfer/createMoneyTransferResponse" message="tns:ITransfer_createMoneyTransfer_OutputMessage" />
        </wsdl:operation>
        </wsdl:portType>
      - <wsdl:binding name="BasicHttpBinding_ITransfer" type="tns:ITransfer">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
      - <wsdl:operation name="createMoneyTransfer">
        <soap:operation soapAction="http://tempuri.org/ITransfer/createMoneyTransfer" style="document" />
      - <wsdl:input>
        <soap:body use="literal" />
        </wsdl:input>
      - <wsdl:output>
        <soap:body use="literal" />
        </wsdl:output>
        </wsdl:operation>
        </wsdl:binding>
      - <wsdl:service name="Transfer">
      - <wsdl:port name="BasicHttpBinding_ITransfer" binding="tns:BasicHttpBinding_ITransfer">
        <soap:address location="http://REAL IP:9097/Transfer.svc" />
        </wsdl:port>
        </wsdl:service>
        </wsdl:definitions>

    после перевода на HTTPS,
    ExpandedWrap disabled
                <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />

    полученный wsdl даёт внутренний soap:address.
    ExpandedWrap disabled
        <?xml version="1.0" encoding="utf-8" ?>
      - <wsdl:definitions name="Transfer" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
      - <wsdl:types>
      - <xsd:schema targetNamespace="http://tempuri.org/Imports">
        <xsd:import schemaLocation="https://REAL IP:444/Transfer.svc?xsd=xsd0" namespace="http://tempuri.org/" />
        <xsd:import schemaLocation="https://REAL IP:444/Transfer.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
        <xsd:import schemaLocation="https://REAL IP:444/Transfer.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/BankConstanta.SoflisVaucheri" />
        </xsd:schema>
        </wsdl:types>
      - <wsdl:message name="ITransfer_createMoneyTransfer_InputMessage">
        <wsdl:part name="parameters" element="tns:createMoneyTransfer" />
        </wsdl:message>
      - <wsdl:message name="ITransfer_createMoneyTransfer_OutputMessage">
        <wsdl:part name="parameters" element="tns:createMoneyTransferResponse" />
        </wsdl:message>
      - <wsdl:portType name="ITransfer">
      - <wsdl:operation name="createMoneyTransfer">
        <wsdl:input wsaw:Action="http://tempuri.org/ITransfer/createMoneyTransfer" message="tns:ITransfer_createMoneyTransfer_InputMessage" />
        <wsdl:output wsaw:Action="http://tempuri.org/ITransfer/createMoneyTransferResponse" message="tns:ITransfer_createMoneyTransfer_OutputMessage" />
        </wsdl:operation>
        </wsdl:portType>
      - <wsdl:binding name="BasicHttpBinding_ITransfer" type="tns:ITransfer">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
      - <wsdl:operation name="createMoneyTransfer">
        <soap:operation soapAction="http://tempuri.org/ITransfer/createMoneyTransfer" style="document" />
      - <wsdl:input>
        <soap:body use="literal" />
        </wsdl:input>
      - <wsdl:output>
        <soap:body use="literal" />
        </wsdl:output>
        </wsdl:operation>
        </wsdl:binding>
      - <wsdl:service name="Transfer">
      - <wsdl:port name="BasicHttpBinding_ITransfer" binding="tns:BasicHttpBinding_ITransfer">
        <soap:address location="http://ws-test.constanta.ge:9097/Transfer.svc" />
        </wsdl:port>
        </wsdl:service>
        </wsdl:definitions>

    а если в конфиге статически прописать soap:address, то xsd:import адреса генерит внутренние.
    как лечить?
    спасибо
    Сообщение отредактировано: Kobra -
    Я знаю только то, что ничего не знаю
    0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
    0 пользователей:


    Рейтинг@Mail.ru
    [ Script Execution time: 0,0793 ]   [ 18 queries used ]   [ Generated: 22.09.18, 21:31 GMT ]