使用WCF调用SOAP UI模拟服务:“提供的URI方案'https'无效;期望'http'。”

时间:2011-08-03 08:38:32

标签: wcf http https

我的一位同事给了我一份SOAP UI模拟服务项目的副本。我可以在我的机器上打开并运行这个模拟服务。 它运行在地址:http://localhost:8088/mockShipmentInformationService

WSDL在地址http://localhost:8088/mockShipmentInformationService_SOAPBinding?WSDL

上提供

使用提供的WSDL,我向应用程序项目添加了一个服务引用。为了测试调用服务的方法,我还将服务引用添加到Unit测试项目中。

对于这两个项目,将在app.config中添加以下内容:

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="ShipmentInformationService_SOAPBinding" 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>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8088/mockShipmentInformationService_SOAPBinding"
        binding="basicHttpBinding" bindingConfiguration="ShipmentInformationService_SOAPBinding"
        contract="ShipmentInformationService.ShipmentInformationService"
        name="ShipmentInformationServicePort" />
    </client>
  </system.serviceModel>

如您所见,URL使用的是普通的http协议,而不是https。此外,我的安全模式设置为“无”。然而,当我尝试调用服务方法时,我继续收到以下错误消息:

 The provided URI scheme 'https' is invalid; expected 'http'.
 Parameter name: via

是什么给出的?可能会在某处定义一些会造成严重破坏的URL吗?我应该在哪里看?

1 个答案:

答案 0 :(得分:0)

我刚发现它全部在app.config文件中。应用程序项目在applicationSettings部分中有一个错误的URL,并且单元测试项目中没有URL。我现在至少可以打电话给这项服务,虽然我现在还有其他一些问题。

相关问题