【044】https访问U9接口报错
侧边栏壁纸
  • 累计撰写 70 篇文章
  • 累计收到 2 条评论

【044】https访问U9接口报错

竹秋廿九
2025-04-08 / 0 评论 / 20 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2025年04月17日,已超过293天没有更新,若内容或图片失效,请留言反馈。

报错信息如下

image.png

解决方式

web service接口

Services目录下找到访问接口的同名配置文件(没有同名配置文件找公共配置web.config),参考以下配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="U9SrvTypeBehaviors">
                    <serviceMetadata httpsGetEnabled="true" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="UFIDA.U9.Sn.BatchCreateSnSVStub" behaviorConfiguration="U9SrvTypeBehaviors">
                <endpoint  contract="UFIDA.U9.Sn.IBatchCreateSnSV" binding="basicHttpBinding" />
            </service>
        </services>
        <bindings>
            <basicHttpBinding>
                <binding>
                    <security mode="Transport"></security>
                </binding>
            </basicHttpBinding>
        </bindings>
    </system.serviceModel>
</configuration>

轻量型接口RestServices

RestServices目录下找到访问接口的同名配置文件(没有同名配置文件找公共配置web.config),参考以下配置:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="U9SrvTypeBehaviors">
                    <serviceMetadata httpsGetEnabled="true"/>
                </behavior>
            </serviceBehaviors>
            <endpointBehaviors>
                <behavior name="U9RestSrvBehaviors">
                    <enableWebScript />
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <services>
            <service name="UFIDA.U9.Cust.HZM.DataCollection.TokenSV.GetTokenServiceStub" behaviorConfiguration="U9SrvTypeBehaviors">
                <endpoint address="" behaviorConfiguration="U9RestSrvBehaviors" binding="webHttpBinding" contract="UFIDA.U9.Cust.HZM.DataCollection.TokenSV.IGetTokenService" />
            </service>
        </services>
        <bindings>
            <webHttpBinding>
                <binding>
                    <security mode="Transport"></security>
                </binding>
            </webHttpBinding>
        </bindings>
    </system.serviceModel>
</configuration>
0

评论

博主关闭了当前页面的评论