| | |
Call to WCF timeout on the second call
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 56
Reputation:
Solved Threads: 1
Hi,
I a real newbie on WCF, and I want to implement a service that reads from a DB some data and returns generic lists of custom objects to the client.
So I implement the service like this:
Interface:
Implementation:
and on the client (a ASP.NET website, added the ServiceReference on the project),
So, my problem is that when I first call the ListarAlmacen method it works ok, but when I tried to call it a second time, it gave me a timeout exception, I tried to step into to debug it, the first time it works, the debug steps into it; but the second time, it didn't.
I just have no idea what's happening, I tried some tips, but no luck (service log, web.config hacks, etc.).
Please some can tell me where's is the problem or how can I know for sure where to look for the problem...
Thanks!
I a real newbie on WCF, and I want to implement a service that reads from a DB some data and returns generic lists of custom objects to the client.
So I implement the service like this:
Interface:
vb Syntax (Toggle Plain Text)
<ServiceContract()> _ Public Interface IRepositorio <OperationContract(Name:="ListarAlmacen")> _ Function ListarAlmacen() As List(Of BE.Almacen) End Interface
Implementation:
vb Syntax (Toggle Plain Text)
<AspNetCompatibilityRequirementsAttribute(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _ <ServiceBehavior(UseSynchronizationContext:=True, InstanceContextMode:=InstanceContextMode.PerSession, ConcurrencyMode:=ConcurrencyMode.Multiple)> _ Public Class Repositorio Implements IRepositorio Public Function ListarAlmacen() As List(Of BE.Almacen) Implements IRepositorio.ListarAlmacen Dim result As List(Of BE.Almacen) result = BL.Repositorio.Almacen.listar() Return result End Function End Class
and on the client (a ASP.NET website, added the ServiceReference on the project),
vb Syntax (Toggle Plain Text)
'some code ... Dim oAlmacenWCF As New repositorio.RepositorioClient Dim oListaAlmacenBE As List(Of BE.Almacen) oListaItemAlmacenBE = oAlmacenWCF.ListarAlmacen(item_id) 'some code
So, my problem is that when I first call the ListarAlmacen method it works ok, but when I tried to call it a second time, it gave me a timeout exception, I tried to step into to debug it, the first time it works, the debug steps into it; but the second time, it didn't.
I just have no idea what's happening, I tried some tips, but no luck (service log, web.config hacks, etc.).
Please some can tell me where's is the problem or how can I know for sure where to look for the problem...
Thanks!
•
•
Join Date: Jun 2009
Posts: 442
Reputation:
Solved Threads: 82
Set the timeout properties of WCF application to increase the default timeout. This can be done on the client side programmically or with a client side App.Config or a Web.config.
You can configure the OperationTimeout property for Proxy in the WCF client code.
For example
Refer: http://www.codeproject.com/KB/WCF/WC..._Timeout_.aspx
You can configure the OperationTimeout property for Proxy in the WCF client code.
For example
ASP.NET Syntax (Toggle Plain Text)
DirectCast(service, IContextChannel).OperationTimeout = New TimeSpan(0, 0, 240)
Refer: http://www.codeproject.com/KB/WCF/WC..._Timeout_.aspx
•
•
Join Date: Aug 2007
Posts: 56
Reputation:
Solved Threads: 1
Hi Ramesh,
Thank you very much for the answer, I've been looking how to do it in the web.config (i have a website client, and I want to do it in the web.config), but have no luck...
This is my first try ... and I'm not quit sure if I have the concepts right.
My proxy is generated with the vs2008 with the option "Add Service Reference..."
My client web.config has:
And I'm not sure where to put the OperationTimeout property.
Thanks.
Omar
Thank you very much for the answer, I've been looking how to do it in the web.config (i have a website client, and I want to do it in the web.config), but have no luck...
This is my first try ... and I'm not quit sure if I have the concepts right.
My proxy is generated with the vs2008 with the option "Add Service Reference..."
My client web.config has:
xml Syntax (Toggle Plain Text)
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IRepositorio" 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" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://localhost:7604/Repositorio.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IRepositorio" contract="repositorio.IRepositorio" name="WSHttpBinding_IRepositorio"> <identity> <dns value="localhost" /> </identity> </endpoint> </client> </system.serviceModel>
And I'm not sure where to put the OperationTimeout property.
Thanks.
Omar
•
•
•
•
Set the timeout properties of WCF application to increase the default timeout. This can be done on the client side programmically or with a client side App.Config or a Web.config.
You can configure the OperationTimeout property for Proxy in the WCF client code.
For example
ASP.NET Syntax (Toggle Plain Text)
DirectCast(service, IContextChannel).OperationTimeout = New TimeSpan(0, 0, 240)
Refer: http://www.codeproject.com/KB/WCF/WC..._Timeout_.aspx
•
•
Join Date: Aug 2007
Posts: 56
Reputation:
Solved Threads: 1
Well, Someone might wanna know this...
I solved the problem putting the close method at the end of the call.
I hope this helps someone...
I solved the problem putting the close method at the end of the call.
•
•
•
•
vb Syntax (Toggle Plain Text)
'some code ... Dim oAlmacenWCF As New repositorio.RepositorioClient Dim oListaAlmacenBE As List(Of BE.Almacen) oListaItemAlmacenBE = oAlmacenWCF.ListarAlmacen(item_id) [COLOR="Red"]oAlmacenWCF.Close()[/COLOR] 'some code
![]() |
Similar Threads
- How to call Client.java from HTML? (Java)
- Call a function at RUNTIME (C++)
- call the constructor of java class from script (Shell Scripting)
- Can two software which both write in Visual C++ call each other functions..?? (C++)
- call centers!!! (Geeks' Lounge)
- How to create a Form application to make phone call on pocket pc (VB.NET)
- Help: How To Call A Domain Name From Another Domain Name In Asp.net (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: ASP.NET AJAX Slider "ontextchanged"
- Next Thread: Populate textfields from a dropdown list box using datasource
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form gridview gudi iis image javascript list listbox menu mouse mssql nameisnotdeclared news novell numerical opera order parent problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview typeof validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





