c#调用web服务的问题

hanhui1211 2016-11-22 10:10:00
本地web网站和web服务都在本机IIS上部署成功,用局域网IP打开网站调用web服务 提示无法加载或初始化请求的服务提供程序
但是用localhost调用就可以,PS:连接数据库串都是本机sql
[SocketException (0x277a): 无法加载或初始化请求的服务提供程序。]
System.Net.SafeCloseSocketAndEvent.CreateWSASocketWithEvent(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, Boolean autoReset, Boolean signaled) +6601928
System.Net.NetworkAddressChangePolled..ctor() +74
System.Net.AutoDetector.Initialize() +186
System.Net.AutoDetector.get_CurrentAutoDetector() +27
System.Net.AutoWebProxyScriptEngine..ctor(WebProxy proxy, Boolean useRegistry) +53
System.Net.WebProxy.UnsafeUpdateFromRegistry() +33
System.Net.WebProxy..ctor(Boolean enableAutoproxy) +12
System.Net.Configuration.DefaultProxySectionInternal..ctor(DefaultProxySection section) +1319
System.Net.Configuration.DefaultProxySectionInternal.GetSection() +143

[ConfigurationErrorsException: 创建在“system.net/defaultProxy”配置节中指定的 Web 代理时出错。]
System.Net.Configuration.DefaultProxySectionInternal.GetSection() +236
System.Net.WebRequest.get_InternalDefaultWebProxy() +136
System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint) +180
System.Net.HttpRequestCreator.Create(Uri Uri) +29
System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) +212
System.Net.WebRequest.Create(Uri requestUri) +32
System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri) +32
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri) +17
System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri) +9
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +48
qiuniuProject.getNews.getAllNews.getPlaceTopList(Int32 top, Int32 istop) in E:\qiuniu\qiuniuProject\qiuniuProject\Web References\getNews\Reference.cs:489
qiuniuProject.Controllers.IndexController.Index() in E:\qiuniu\qiuniuProject\qiuniuProject\Controllers\IndexController.cs:201
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +56
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +256
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +22
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +190
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
System.Web.Mvc.Controller.ExecuteCore() +105
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +88
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +16
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +44
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +23
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +59
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9711525
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
...全文
372 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
蝶恋花雨 2016-11-24
  • 打赏
  • 举报
回复
引用 4 楼 u011067793 的回复:
引用 3 楼 kongwei521 的回复:
你IIS 部署的IP是什么?localhost 还是你的电脑IP? 设置下电脑IP 然后再试
请问如何查看我电脑上IIS的IP呢?
cmd 命令=》ipconfig 里面 ipv4就是 或者看右下角 小电脑图标 属性
蜗蜗蜗蜗蜗牛 2016-11-24
  • 打赏
  • 举报
回复
引用 3 楼 kongwei521 的回复:
你IIS 部署的IP是什么?localhost 还是你的电脑IP? 设置下电脑IP 然后再试
请问如何查看我电脑上IIS的IP呢?
hanhui1211 2016-11-22
  • 打赏
  • 举报
回复
引用 1 楼 sp1234 的回复:
你可以随便在网站里放一个图片,例如 a.jpg,看看你的客户端机器能在浏览器上看到图片吗?


可以的,在别的机器上,用局域网IP打开,出现这个的界面

参数都没有了
  • 打赏
  • 举报
回复
你可以随便在网站里放一个图片,例如 a.jpg,看看你的客户端机器能在浏览器上看到图片吗?
蝶恋花雨 2016-11-22
  • 打赏
  • 举报
回复
你IIS 部署的IP是什么?localhost 还是你的电脑IP? 设置下电脑IP 然后再试

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧