首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WCF使用Https服务

WCF使用Https服务
EN

Stack Overflow用户
提问于 2014-03-23 21:20:22
回答 1查看 1.6K关注 0票数 0

目前我在我的应用程序中使用第三方Web服务,Web服务是单向SSL,但在我使用Visual Studio中的服务之后。在Web.Config文件绑定服务变成没有SSL,它应该下载的Https,但现在是Http。下面是我的Web服务。这里的任何人。请帮帮忙。谢谢

代码语言:javascript
复制
http://ws2.oriongateway.com:22836/willani2/services/ogltngws (No way SSL)
https://ws2.oriongateway.com:22837/willani2/services/ogltngws (1 way SSL)

我的app.Config

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.diagnostics>
        <sources>
            <!-- This section defines the logging configuration for My.Application.Log -->
            <source name="DefaultSource" switchName="DefaultSwitch">
                <listeners>
                    <add name="FileLog"/>
                    <!-- Uncomment the below section to write to the Application Event Log -->
                    <!--<add name="EventLog"/>-->
                </listeners>
            </source>
        </sources>
        <switches>
            <add name="DefaultSwitch" value="Information" />
        </switches>
        <sharedListeners>
            <add name="FileLog"
                 type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
                 initializeData="FileLogWriter"/>
            <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
            <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        </sharedListeners>
    </system.diagnostics>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="OglTngWsSoap11Binding1" />
            </basicHttpBinding>
            <customBinding>
                <binding name="OglTngWsSoap12Binding1">
                    <textMessageEncoding messageVersion="Soap12" />
                    <httpTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="http://ws2.oriongateway.com:22836/willani2/services/ogltngws.OglTngWsHttpSoap12Endpoint/"
                binding="customBinding" bindingConfiguration="OglTngWsSoap12Binding1"
                contract="aService.OglTngWsPortType" name="OglTngWsHttpSoap12Endpoint1" />
            <endpoint address="http://ws2.oriongateway.com:22836/willani2/services/ogltngws.OglTngWsHttpSoap11Endpoint/"
                binding="basicHttpBinding" bindingConfiguration="OglTngWsSoap11Binding1"
                contract="aService.OglTngWsPortType" name="OglTngWsHttpSoap11Endpoint1" />
        </client>
    </system.serviceModel>
</configuration>
EN

回答 1

Stack Overflow用户

发布于 2014-03-23 22:14:25

尝试下一步更改:

代码语言:javascript
复制
        <basicHttpBinding>
            <binding name="OglTngWsSoap11Binding1" />
            <security mode="Transport"> // add security mode
        </basicHttpBinding>

将端点地址更改为https,同时不要忘记更改端口:

代码语言:javascript
复制
            <endpoint address="https://ws2.oriongateway.com:22837/willani2/services/ogltngws.OglTngWsHttpSoap11Endpoint/"
            binding="basicHttpBinding" bindingConfiguration="OglTngWsSoap11Binding1"
            contract="aService.OglTngWsPortType" name="OglTngWsHttpSoap11Endpoint1" />

如果它起作用了,请告诉我。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22591440

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档