【问题标题】:.NET 4.0 WebServices and IPv6.NET 4.0 Web 服务和 IPv6
【发布时间】:2012-08-30 13:29:00
【问题描述】:

我在 IIS 7.0 中部署了一个 WebService。 如果我使用 IPv4 绑定访问该 WebService,它可以工作并且我可以看到 WSDL。但是,使用 IPv6 绑定访问它会返回 System.UriFormatException: Invalid URI: The hostname could not be parses.

[UriFormatException: Invalid URI: The hostname could not be parsed.]
   System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) +7955439
   System.Web.Services.Protocols.DocumentationServerType..ctor(Type type, String uri) +75
   System.Web.Services.Protocols.DocumentationServerProtocol.Initialize() +322
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +160

[InvalidOperationException: Unable to handle request.]
   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) +800924
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +302

[InvalidOperationException: Failed to handle request.]
   System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response) +731240
   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +308
   System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +89
   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +608
   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +193
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371

如果我访问正常的 ASP 页面,它可以工作。

有什么建议吗?

谢谢

【问题讨论】:

    标签: .net web-services iis iis-7


    【解决方案1】:

    尝试将 .Net Framework 升级到 4.6

    https://www.microsoft.com/en-us/download/details.aspx?id=46854


    我们遇到了同样的问题,我们可以使用“IPv6 url”访问到 Web 服务目录级别,但在访问 .asmx 时抛出异常

    http://[fe11::b111:327b:28ef:ee9e]/WebServicePath //Works

    http:// [fe11::b111:327b:28ef:ee9e]/WebServicePath/MyService.asmx //抛出异常

    现在将 .net 框架 4.5.1 升级到 4.6(RC) 后已修复此问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-24
      • 2021-06-07
      • 2011-02-07
      • 1970-01-01
      • 2012-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多