简体   繁体   English

调用外部Web服务ASP.NET时出现403错误

[英]403 error when calling an external web service ASP.NET

I'm unable to access a web service at webservicex When trying to add the service reference, I got the following error message. 我无法在webservicex上访问Web服务尝试添加服务引用时,出现以下错误消息。

"There was an error downloading ' http://www.webservicex.net/uszip.asmx/_vti_bin/ListData.svc/ $metadata'. “下载' http://www.webservicex.net/uszip.asmx/_vti_bin/ListData.svc/ $ metadata时出错。

The request failed with the error message: 请求失败,并显示错误消息:

System.InvalidOperationException: _vti_bin/ListData.svc/$metadata Web Service method name is not valid. System.InvalidOperationException:_vti_bin / ListData.svc / $ metadata Web服务方法名称无效。 at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) 在System.Web.Services.Protocols.HttpServerProtocol.Initialize()处,在System.Web.Services.Protocols.ServerProtocolFactory.Create处(类型类型,HttpContext上下文,HttpRequest请求,HttpResponse响应,布尔值和abortProcessing)

--. -。 Metadata contains a reference that cannot be resolved: ' http://www.webservicex.net/uszip.asmx '. 元数据包含无法解析的引用:“ http://www.webservicex.net/uszip.asmx ”。 The HTTP request was forbidden with client authentication scheme 'Anonymous'. 客户端身份验证方案“匿名”禁止HTTP请求。 The remote server returned an error: (403) Forbidden. 远程服务器返回错误:(403)禁止。 If the service is defined in the current solution, try building the solution and adding the service reference again." 如果服务是在当前解决方案中定义的,请尝试构建解决方案并再次添加服务引用。”

What is the cause of this? 这是什么原因? How can I get around it? 我该如何解决? It seems to happen with all external web services I attempt to add (not just from webservicex.net). 我尝试添加的所有外部Web服务似乎都发生了这种情况(不仅仅来自webservicex.net)。

使您在外部Web服务托管服务器上列入白名单的公共IP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM