Forums » .NET » WCF »

Endpoint error while connecting to WCF


Posted Date: 27 Mar 2012      Posted By:: tshidi     Member Level: Bronze    Member Rank: 0     Points: 5   Responses: 5



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?




Responses

#663631    Author: venkat      Member Level: Bronze      Member Rank: 3363     Date: 27/Mar/2012   Rating: 2 out of 52 out of 5     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


 
#663640    Author: tshidi      Member Level: Bronze      Member Rank: 0     Date: 27/Mar/2012   Rating: 2 out of 52 out of 5     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.


 
#663649    Author: Asheej T K        Member Level: Diamond      Member Rank: 2     Date: 27/Mar/2012   Rating: 2 out of 52 out of 5     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


Regards,
Asheej T K
Microsoft MVP[ASP.NET/IIS]
DotNetSpider MVM





 
#664109    Author: NareshReddy      Member Level: Silver      Member Rank: 796     Date: 29/Mar/2012   Rating: 2 out of 52 out of 5     Points: 2

Hi,

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

NareshReddy


 
#664269    Author: Sudhakar      Member Level: Silver      Member Rank: 498     Date: 30/Mar/2012   Rating: 2 out of 52 out of 5     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.

 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India