Click here to Skip to main content
11,575,925 members (58,587 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WCF
Hi, I am developing a WCF service, running IIS6 on Window server 2003. I have built a test client to talk to the WCF service and I am getting the error below. I have been looking at this error for days and went through people's suggestions on forums, but with no luck. Any help would be appreciated, many thanks

There was no endpoint listening at 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.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
Server stack trace: 
   at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request)
   at Ota2010AClient.IOta2010A.ReservationSynch_SubmitRequest(ReservationSynchRequest request) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57589
   at Ota2010AClient.ReservationSynch_SubmitRequest(Security Security, DateTime& TimeStamp, String CorrelationID, String RelatesToCorrelationID, ReplyTo ReplyTo, OTA_HotelResNotifRQ OTA_HotelResNotifRQ) in c:\Development\WorkingFolder\Webservices\SynxisNew\App_Code\OTA2010A.cs:line 57601
   at Update.Page_Load(Object sender, EventArgs e) in c:\Development\WorkingFolder\Webservices\SynxisNew\Update.aspx.cs:line 72
Client config
<?xml version="1.0" encoding="utf-8"?>
    <compilation debug="true"/>
                <binding name="ota2010AEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Transport">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            establishSecurityContext="true" />
            <endpoint address=""
                binding="wsHttpBinding" bindingConfiguration="ota2010AEndpoint"
                contract="IOta2010A" name="ota2010AEndpoint" />
Service config
<?xml version="1.0"?>
    <compilation debug="true" targetFramework="4.0">
        <add assembly="Pervasive.Data.SqlClient, Version=, Culture=neutral, PublicKeyToken=C84CD5C63851E072"/>
	<authentication mode="Windows"/>
	<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
      <service name="Synxis" behaviorConfiguration="SynxisWCF">
        <endpoint address="" name="wsHttpEndpoint"  binding="wsHttpBinding" contract="Synxis" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
         logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"
         maxMessagesToLog="300" />
        <behavior name="SynxisWCF" >
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" externalMetadataLocation="" />
          <serviceDebug includeExceptionDetailInFaults="true" />
Posted 10-Jul-13 3:25am
Mohammed Hameed at 11-Jul-13 3:21am
Have you tried running this URL in browser. Whether is it generating xml??
Mohammed Hameed at 11-Jul-13 3:27am
I think you should try once with http but not https.
Neil Hung at 11-Jul-13 11:58am
Thanks for your reply. I can see the service running in the browser. Anyhow, I have found my problem, look below for my answer. Kind regards

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I have found the problem. The service config is missing security mode, which by default is "message". I copied the binding configuration from the client config into the service config and it worked!

So copy this part of the client config into service config
    <binding name="ota2010AEndpoint">
      <readerquotas maxdepth="32" ...="" />
        <reliablesession ordered="true" ....="" />
          <security mode="Transport">
            <transport clientcredentialtype="None" proxycredentialtype="None">
                       realm="" />
            <message clientcredentialtype="Windows" negotiateservicecredential="true">
                     establishSecurityContext="true" />
Then bind to the endpoint (bindingConfiguration)
<service name="Synxis" behaviorconfiguration="SynxisWCF">
    <endpoint address="" name="wsHttpEndpoint">
              contract="Synxis" /></endpoint></service>
Mishra Laxmikant at 8-Nov-13 9:00am
I have same problem...

Would you guys check this link out for me please...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 370
1 Dave Kreskowiak 204
2 F-ES Sitecore 145
3 OriginalGriff 125
4 Abhinav S 98
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 600
2 Abhinav S 438
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 11 Jul 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100