You must Sign In to post a response.

Endpoint error while connecting to WCF

Hello all,

I have an issue with my WCF service. I can connect to it remotely via IE but when I try to connect via my application I get that there was no endpoint listening at http://<serveraddress>/IARDataReaderQA/SecurityReader.svc ...

With error details below:

ee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://<serveraddress>//IARDataReaderQA/SecurityReader.svc 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: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond <serveraddress> at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, 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 IARMotorcare.SecurityReader.ISecurityReader.Users_Read_ByName(String& ErrorStr, String UserName)
at IARMotorcare.SecurityReader.SecurityReaderClient.Users_Read_ByName(String& ErrorStr, String UserName)
at IARMotorcare.Login.cmdLogin_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


The binding snippet on the client's config is as follows:


<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISecurityReader" closeTimeout="02.05:30:15"
openTimeout="02.05:30:15" receiveTimeout="02.05:30:15" sendTimeout="02.05:30:15"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://<serveraddress>//IARDataReaderQA/SecurityReader.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISecurityReader"
contract="SecurityReader.ISecurityReader" name="BasicHttpBinding_ISecurityReader" />
</client>



And the service's config file snippet looks as follows:


<system.serviceModel>
<services>
<service name="IARDataReader.SecurityReader">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISecurityReader" name="BasicHttpBinding_ISecurityReader"
contract="IARDataReader.ISecurityReader" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISecurityReader" closeTimeout="02.05:30:15"
openTimeout="02.05:30:15" receiveTimeout="02.05:30:15" sendTimeout="02.05:30:15"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

Is there something I am maybe doing wrong in the above configs?


Comments

Author: venkat27 Mar 2012 Member Level: Bronze   Points : 2

Dear
once check the service and still its not getting then u can host/publish it on IIS then see ,,and give the proper address

Author: tshidi27 Mar 2012 Member Level: Bronze   Points : 1

Hi,

I did publish it on IIS and I can browse the svc file without any errors. It is only when I login to the application calling the service that I get the above mentioned error.

Author: Asheej T K27 Mar 2012 Member Level: Gold   Points : 2

Hi,

It seems you haven't created service.cs file to publish the service. Could you please check MSDN article and make sure you have followed the same steps they mentioned there: msdn.microsoft.com/en-us/library/ms733766.aspx

Author: NareshReddy29 Mar 2012 Member Level: Silver   Points : 2

Hi,

Endpoint address is empty value in the above code snippet of webconfig file,can you add the address and try.

Author: Sudhakar30 Mar 2012 Member Level: Silver   Points : 2

Use the service reference option to browse the hosted service and refer itinto the client application. Then the endpoint will be generated automatically.