wcf: 打开时出错 URL 'local:////star5/schema//STARTransport2005.wsdl'

wcf: Error opening URL 'local:////star5/schema//STARTransport2005.wsdl'

我创建了一个使用 wsdl 文件的 wcf 服务。 wcf 使用我在 web.config 中配置的证书进行保护。该服务有两种方法,一种用于拉取,另一种用于放置。当我使用 pull 方法发出请求时它有效但是当我尝试使用 put 方法时我收到以下错误:

Error opening URL 'local:////star5/schema//STARTransport2005.wsdl'

这里是配置文件(web.config)

  <endpointBehaviors>
    <!-- Ford LDS-->
    <behavior name="Ford_WSSecBehavior">
      <clientCredentials>
        <clientCertificate storeLocation="CurrentUser" storeName="My" x509FindType="FindBySubjectName" findValue="LD00BD.b2d.ford.com"/>
        <serviceCertificate>
          <defaultCertificate storeLocation="CurrentUser" storeName="Root" x509FindType="FindBySubjectName" findValue="b2dgwqa.ford.com"/>
          <authentication revocationMode="NoCheck"/>
        </serviceCertificate>
      </clientCredentials>
      <clientVia viaUri="https://b2dgwqa.ford.com/5027/StarTransport"/>
    </behavior>
  </endpointBehaviors> <binding name="Ford_starTransport" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="UserName" algorithmSuite="Default"/>
      </security>
    </binding> <customBinding>
    <!-- Ford LDS-->

    <binding name="Ford_Secure_https" closeTimeout="00:05:00" openTimeout="00:05:00"
      receiveTimeout="00:05:00" sendTimeout="00:05:00">
      <textMessageEncoding  messageVersion="Soap11WSAddressing10">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      </textMessageEncoding>

      <security defaultAlgorithmSuite="Basic128Rsa15" allowSerializedSigningTokenOnReply="true"
        authenticationMode="MutualCertificate" includeTimestamp="true" enableUnsecuredResponse="true"
        messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
      <httpsTransport maxReceivedMessageSize="5000000" maxBufferSize="5000000" />
    </binding>
  </customBinding> <endpoint  address="urn:ford/star/services/v1/GenericPull"
           behaviorConfiguration="Ford_WSSecBehavior"
           binding="customBinding"
           bindingConfiguration="Ford_Secure_https"
           contract="AutoIt.Backend.FordIntegration.Proxcies.Ford.RequestSalesLeadService.starTransportPortTypes"
           name="Ford_starTransport">
    <identity>
      <dns value="b2dgwqa.ford.com" />
    </identity>
  </endpoint>

  <endpoint  address="urn:ford/star/services/v1.0/SalesLead/EU"
         behaviorConfiguration="Ford_WSSecBehavior"
         binding="customBinding"
         bindingConfiguration="Ford_Secure_https"
         contract="Proxcies.Ford.ProcessSalesLeadService.starTransportPortTypes"
         name="Ford_starTransport">
    <identity>
      <dns value="b2dgwqa.ford.com" />
    </identity>
  </endpoint>

  <endpoint  address="urn:ford/star/services/v1.0/SalesLead/EU"
       behaviorConfiguration="Ford_WSSecBehavior"
       binding="customBinding"
       bindingConfiguration="Ford_Secure_https"
       contract="AutoIt.Backend.FordIntegration.Proxcies.Ford.UpdateSalesLeadService.starTransportPortTypes"
       name="Ford_starTransport">
    <identity>
      <dns value="b2dgwqa.ford.com" />
    </identity>
  </endpoint>

我终于解决了这个问题。问题是我缺少在请求的 header 中调用的服务的版本号。当我给出版本号时,错误消失了。这是一个非常疯狂的错误,它没有指出错误发生的原因。对于那些面临此类错误的人,如果您在请求的 header 中遗漏了某些内容,它只会发生。