zoukankan      html  css  js  c++  java
  • WCF异常: 提供的 URI 方案“https”无效,应为“http”。 参数名: via

    前几天,在用wcf服务是,遇到这么一个问题:WCF异常: 提供的 URI 方案“https”无效,应为“http”。 参数名: via

    本身对wcf不是很熟悉,在网上查找一番。终于解决问题。如有遇到此类问题,希望能有所帮助。

    原因解析:

    wcf原引用地址:https://192.168.1.1:8090/temp/sitservice

    后因为服务地址改为:http://192.168.1.2:8090/temp/sitservice

    然后运行就出现了上述的错误(我只改了web.config 的引用服务地址,别的没改)。

    解决:

    把这个节点

    <httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
    maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
    bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
    keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
    realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
    useDefaultWebProxy="true" />
    

    改为http的

    <httpTransport manualAddressing="false" maxBufferPoolSize="524288"
    maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
    bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
    keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
    realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
    useDefaultWebProxy="true" />

    重新编译,运行成功。

  • 相关阅读:
    数据结构:树[data struct: tree]
    关于计算机学科的一些期刊和会议(转)
    这个世界究竟是怎么了
    [思考]怎么在C#中加入新功能
    vsta相关
    Practical numerical methods with C#
    C# (CSharp)中的foreach,for关键词
    代码生成相关
    没有可用于当前位置的源代码 解决办法
    access数据库删除两个日期之间 的数据 SQL语句
  • 原文地址:https://www.cnblogs.com/for917157ever/p/4597551.html
Copyright © 2011-2022 走看看