2

I have a Windows forms app which uses WCF services. Our application sends messages using one of our WCF services to specific users running our client, so our callback “http:” string is dynamically constructed each time a message is sent to a user. It includes the server IP address and port (126.221.97.105:701) onto which the current user is logged, the user’s id (56281), and the client GUID (7392d27a-e4a0-42e2-89a3-adc332e28934). So, a typical callback “http:” string looks like this:

http://xxx.xxx.xx.xxx:701/CmesCns/CALLBACK/56281/7392d27a-e4a0-42e2-89a3-adc332e28934

We have an http namespace (http://+:701/) on our client and the group “Everyone” is tied to this namespace with all of the access permissions checked (GenericAll, GenericExecute, GenericRead, and GenericWrite). We use “http namespace” to create our namespaces.

Our application has been in production (on Windows Server 2003) for a few years and everything is working fine.

We have recently converted our application to run in the Windows 2008 server environment. The “Target Framework” in each of our projects is set to the “.NET Framework 4.0”. Our application works fine on my Windows 7 developer workstation. That is, I am able to receive messages from our WCF service, but when I place our application onto our Windows 2008 server and I attempt to run the application, I receive the following error message:

"There was no endpoint listening at http://xxx.xxx.xx.xxx:701/CmesCns/CALLBACK/56281/7392d27a-e4a0-42e2-89a3-adc332e28934 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.”

The http namespace (http://+:701/) exists on my developer workstation and on my Windows 2008 server. The group “Everyone” is tied the namespace on my Windows 7 box and on my Windows 2008 server, and all of the access permissions are checked (GenericAll, GenericExecute, GenericRead, and GenericWrite).

We have been searching the web for an answer but have not discovered anything. Would anybody have any ideas on why this would work on our Windows 7 workstations, but not on our Windows 2008 servers?

Any help is greatly appreciated! Kevin

Kevin
  • 21
  • 1
  • 2

2 Answers2

1

When you host a WCF service in IIS you don't specify an absolute url in the address. You should use a relative url to the .svc file. The base url will be determined by the web site where it is hosted.

    <service name="WebService.Receptor">
<endpoint
    address="/WS.svc"
    binding="wsHttpBinding"
    contract="IMyContract"
 />

and on the client, depending on how your IIS is configured you should obviously specify the full address:

<client>
<endpoint 
    name="Receptor"
    address="http://MyServer:8000/WS.svc"
    binding="wsHttpBinding"
    contract="IMyContract"
/>

This assumes that you have configured a site in IIS that listens on the 8000 port and that you have hosted your WCF application inside this site.

if it does not help please follow these links, hope it would be useful.

Stack overflow link

Multiple Endpoint

Community
  • 1
  • 1
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • Resolved. Thank-you for your response. We discovered that our Windows 2008 server firewall was blocking all requests to port 701. We opened a port on our server and our problem was solved. – Kevin Oct 18 '12 at 15:51
  • Staring at config files for 2 hours trying to figure out why one service wouldn't work localhost and my brain was about to fry. But your answer was the clue I needed! Service side address property is relative! +1 – dblood Jan 02 '13 at 21:08
1

Typically, this error is because there is no endpoint on the server that matches what the client is requesting (the address, the service, or the authentication is different). However, in my case, I had the exact same error, and it was not due to any of these things.

When I enabled the tracing on IIS and reviewed the svclog trace with SvcTraceViewer.exe (included in Visual Studio), the actual internal error was "Maximum request length exceeded."

My client was uploading an image via the service. And I guess the image was too big.

To enable tracing I added this to the configuration section:

<system.diagnostics>
  <sources>
        <source name="System.ServiceModel" 
                switchValue="All"
                propagateActivity="true">
        <listeners>
           <add name="traceListener" 
               type="System.Diagnostics.XmlWriterTraceListener" 
               initializeData= "c:\log\Traces.svclog" />
        </listeners>
     </source>
  </sources>

To solve the error, I increased the message request length in the web config and the error went away.

To do this, in the system.websection in the web.config I added the line:

<httpRuntime maxRequestLength="32768" />

Then I added this section inside the configuration section

<system.webServer>
 <security>
  <requestFiltering>
   <requestLimits maxAllowedContentLength="32000000" />
  </requestFiltering>
 </security>
</system.webServer>

So I recommend you enable tracing and then review the trace for the exact error.