Reputation: 4124
I see there are several similar topics on the web and SO regarding this, but none of them have been helpful in solving this issue for me.
I have a wcf service, which is hosted and consumed by the same web application (don't ask why) in IIS. So my web.config looks like this
<system.serviceModel>
<services>
<service name="Management.Service.ManagementService" behaviorConfiguration="Management.Service.ManagementServiceBehavior">
<endpoint name="default" binding="basicHttpBinding" bindingConfiguration="default" contract="Management.Service.IManagementService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Management.Service.ManagementServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<bindings>
<basicHttpBinding>
<binding name="default" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.example.com/Service.svc"
binding="basicHttpBinding" bindingConfiguration="default"
contract="Management.Client.IManagementService" name="default" />
</client>
</system.serviceModel>
This works absolutely fine in my local environment, and I can even browse to the service (production) in any browser. But when for some reason, I get the There was no endpoint listening
error on my production server.
I also tried adding the following block after the <system.serviceModel>
tag to enable tracing, but I don't see any trace file being generated.
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" >
<listeners>
<add name="xml"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="xml"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\inetpub\WcfClient.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="xml"/>
</sharedListeners>
</system.diagnostics>
EDIT: Forgot to mention, if I try to consume the production service from local environment, it works fine!
Upvotes: 0
Views: 4515
Reputation: 3500
I also had the same issue . In my case the server which I was making a call had firewall issue. They didnot open firewall. After they opened it problem is fixed.
Upvotes: 0
Reputation: 4124
Well, turned out to be a totally different issue. Turned out that the web application (and in effect the service) was in-accessible from the server itself, i.e. if I try to browse the site from the server itself, I would get a "Page not found" message.
Upvotes: 2