System.ServiceModel.EndpointNotFoundException:服务'/WCFService/Service.svc'不存在. [英] System.ServiceModel.EndpointNotFoundException: The service '/WCFService/Service.svc' does not exist.

查看:667
本文介绍了System.ServiceModel.EndpointNotFoundException:服务'/WCFService/Service.svc'不存在.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上实现我的svc

I implement my svc on the server

当我访问 http://localhost:8888/ MessageService时,它将返回此图像

when I visit http://localhost:8888/MessageService it return this image

当我访问 http://Ipv4:8888/Service.svc 时,我在客户端上收到了此消息并投放

when I visit the Http://Ipv4:8888/Service.svc, I got this message on client and serve

小提琴显示此消息

当我访问Http://ipv4:8888/MessageService.svc时,服务器事件响应是这样的

when I visit Http://ipv4:8888/MessageService.svc , the server event response like this

WebHost无法处理请求.
发件人信息:System.ServiceModel.Activation.HostedHttpRequestAsyncResult/14777545
异常:System.Web.HttpException:服务"/MessageService.svc"不存在. ---> System.ServiceModel.EndpointNotFoundException:服务'/MessageService.svc'不存在.
  在System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
处   在System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)处
  在System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
  在System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
   ---内部异常堆栈跟踪的结尾---

WebHost failed to process a request.
 Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/14777545
 Exception: System.Web.HttpException: The service '/MessageService.svc' does not exist. ---> System.ServiceModel.EndpointNotFoundException: The service '/MessageService.svc' does not exist.
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
   --- End of inner exception stack trace ---

运行我的应用程序时,出现此异常

when I run my app ,I got this exception

EndpointNotFoundException:
没有终结点在 可以接受该消息的http://........./MessageService.svc .这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException.
System.Net.WebException:远程服务器返回错误:(404)找不到.
  在System.Net.HttpWebRequest.GetResponse()
  在System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)处

EndpointNotFoundException:
There was no endpoint listening at http://........./MessageService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)

如何解决此问题,谢谢.

how to fix this, thank you.

推荐答案

能否与我们分享实现svc的方式?

Could you share us how you implement your svc?

基于第一张图片,您没有发布WCF服务的元数据,我建议您遵循第一张图片中的配置.

Based on the first image, you did not publish the metadata for WCF Service, and I suggest you follow the configuration in the first image.

您对此WCF服务有任何要求吗?如果没有,我建议您按照以下步骤创建一个简单的WCF服务.

Do you have any requirement for this WCF Service? If not, I suggest you follow below steps to create a simple WCF Service.

1.新项目-> WCF服务申请

1. New Project-> WCF Service Application

2.在VS中运行项目

2. Run your project in VS

3.该服务将使用默认设置,您可以通过以下地址访问WCF服务: http://localhost:port in VS/Service1.svc

3. This service will use the default settings and you could access the WCF Service by the address like http://localhost:port in VS/Service1.svc

如果您无法使它起作用,请与我们分享您的详细步骤.

If you failed to make it work, it would be helpful if you could share us your detailed steps.


这篇关于System.ServiceModel.EndpointNotFoundException:服务'/WCFService/Service.svc'不存在.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆