V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Gnnbb
V2EX  ›  程序员

C#WebService 接口求大佬解惑

  •  
  •   Gnnbb · Dec 1, 2022 · 1385 views
    This topic created in 1244 days ago, the information mentioned may be changed or developed.
    是这样的,前两天简单学了一下 webservice 接口,要提供给厂家那边调用,然而前几天蛮好的。今天测试完整理资料写教程,结果就出现了以下困惑。最后贴代码链接。
    问题:接口发布到了 IIS 10 上,请求地址是: http://10.20.72.223:12333/WebService1.asmx/GetJson
    结果报错如下图:
    https://imgur.com/a/hqo0JBm
    抓包结果如下图:
    https://imgur.com/a/xJLtDYF
    最后我直接在 vs 中启动内置 IIS ,请求地址变成: https://localhost:44305/WebService1.asmx/GetJson
    结果就请求成功
    https://imgur.com/a/NboyhCc
    IIS 配置
    https://imgur.com/a/Uhpudl6
    挂在 IIS 上问题出在哪呢?

    代码: https://github.com/Xyg12133617/WebService
    6 replies    2022-12-02 21:03:08 +08:00
    quan01994
        1
    quan01994  
       Dec 1, 2022
    你的 github 的示例代码是成功运行的,应该是 iis 配置有问题 。


    我用的是本机的 iis 运行的代码
    Gnnbb
        2
    Gnnbb  
    OP
       Dec 1, 2022
    @quan01994 前几天我在本机 IIS 也正常运行过,结果今天就是不行啦~,我再调整一下 IIS 配置
    idragonet
        3
    idragonet  
       Dec 1, 2022
    现在都是 WebAPI 了,为什么还用 WebService ?
    Gnnbb
        4
    Gnnbb  
    OP
       Dec 2, 2022
    @idragonet 传统制造行业。。。技术还是比较原始的。。。
    idragonet
        5
    idragonet  
       Dec 2, 2022
    @Xyg12133617 技术原始,自己写也没有必要原始。
    aikeike
        6
    aikeike  
       Dec 2, 2022
    id 和 Id 是不一样的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5837 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 03:08 · PVG 11:08 · LAX 20:08 · JFK 23:08
    ♥ Do have faith in what you're doing.