简体   繁体   English

在IIS上托管WCF-EndpointNotFoundException

[英]Hosting WCF on IIS - EndpointNotFoundException

After implemeting a WCF service, hosting it on the IIS Server, it returned with the below error. 实现WCF服务并将其托管在IIS服务器上后,它返回并显示以下错误。

EndpointNotFoundException was unhandled by user code There was no endpoint listening at XXXXX that could accept the message. 用户代码未处理EndpointNotFoundException。没有在XXXXX上侦听的终结点可以接受该消息。 This is often caused by an incorrect address or SOAP action. 这通常是由不正确的地址或SOAP操作引起的。 See InnerException, if present, for more details. 有关更多详细信息,请参见InnerException(如果存在)。

That service is identically has the same implementation and configuration of 5 running services with no errors. 该服务具有5个正在运行的服务的相同实现和配置,没有错误。

when I tried to figure out what is going on the IIS server, the below screenshot. 当我试图弄清楚IIS服务器上发生了什么时,下面的屏幕截图。 在此处输入图片说明

So it seems that this specific service has no detected Contract. 因此,似乎该特定服务没有检测到合同。 although I'm using the same configuration as below. 尽管我使用的是以下相同的配置。

      <service name="XX.XX.Provisioning.EldaftarManagementService">
        <endpoint address="" binding="customBinding" bindingConfiguration="ProvisioningServiceBinding" bindingNamespace="http://XX.XX.com/XX/" contract="XX.XX.Provisioning.Eldaftar.IEldaftarManagementService" />
        <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="ProvisioningBasicBinding" bindingNamespace="http://XX.XX.com/provisioning/" contract="XX.XX.Provisioning.Eldaftar.IEldaftarManagementService" />
      </service>
<service name="XX.XX.Provisioning.Common.UserManagement.UserManagementService">
        <endpoint address="" binding="customBinding" bindingConfiguration="ProvisioningServiceBinding" bindingNamespace="http://XX.XX.com/XX/" contract="XX.XX.Provisioning.Common.UserManagement.IUserManagementService" />
        <endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="ProvisioningBasicBinding" bindingNamespace="http://XX.XX.com/provisioning/" contract="XX.XX.Provisioning.Common.UserManagement.IUserManagementService" />
      </service>

Kindly noted that when accessing the service.svc url it replies normally and the wsdl is shown. 请注意,当访问service.svc url时,它会正常回复并显示wsdl。 So that means it's hosted fine on the IIS. 因此,这意味着它可以很好地托管在IIS上。

Do I miss something? 我想念什么吗?

Update: 更新:

Client config. 客户端配置。

 <endpoint address="https://XXX/EldaftarManagementService.svc" behaviorConfiguration="ProvisioningClientBehaviour" binding="customBinding" bindingConfiguration="ProvisioningServiceBinding" contract="EldaftarManagementService.IEldaftarManagementService" />
 <endpoint address="https://XXX/UserManagement.svc" behaviorConfiguration="ProvisioningClientBehaviour" binding="customBinding" bindingConfiguration="ProvisioningServiceBinding" contract="UserManagementService.IUserManagementService" />

i notice sometime after reconfigure my service reference, the client config getting wsdl with server name. 在重新配置我的服务引用后的某个时间,我注意到客户端配置使用服务器名称获取wsdl。 then i get EndpointNotFoundException exception. 然后我得到EndpointNotFoundException异常。

example : 例如:

service reference is : http://192.168.61.2:1111/Service1.svc 服务参考是: http://192.168.61.2:1111/Service1.svc : http://192.168.61.2:1111/Service1.svc : http://192.168.61.2:1111/Service1.svc

but in the config endpoint address it show : http://serverName:1111/Service1.svc 但在配置端点地址中却显示: http://serverName:1111/Service1.svc

After i change the config endpoint address with the service reference address , then it resolved. 在我用服务引用地址更改config端点地址之后,它就解决了。 Not sure why but now every time when i reconfigure the endpoint address, i will manually change the config endpoint address to make sure it get the same address. 不知道为什么,但是现在每次我重新配置端点地址时,我都会手动更改配置端点地址以确保它获得相同的地址。

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

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