简体   繁体   中英

Hosting WCF on IIS - EndpointNotFoundException

After implemeting a WCF service, hosting it on the IIS Server, it returned with the below error.

EndpointNotFoundException was unhandled by user code There was no endpoint listening at XXXXX that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

That service is identically has the same implementation and configuration of 5 running services with no errors.

when I tried to figure out what is going on the IIS server, the below screenshot. 在此处输入图片说明

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. So that means it's hosted fine on the 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. then i get EndpointNotFoundException exception.

example :

service reference is : http://192.168.61.2:1111/Service1.svc

but in the config endpoint address it show : http://serverName:1111/Service1.svc

After i change the config endpoint address with the service reference address , then it resolved. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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