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

【044】https访问U9接口报错

秋驰雪隙
2025-04-08 / 0 评论 / 13 阅读 / 正在检测是否收录...

报错信息如下

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

评论 (0)

取消