.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

OpenTimeout does not seem to affect NetTcp binding to remote service

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WCF
I have a WCF service that implements a NetTcp endpoint.  I have a client that connects to this service which resides on a remote computer.  This all works fine.  My question is; if the remote computer is not there and I attempt to connect to the remote service the "open()" on the connection will throw an exception after approximately 20 sec regardless of the "OpenTimeout" value I have set.  In my case I would like to shorten the timeout period to 5 sec,  however, when I change the "OpenTimeout" to 5 and attempt the open() it still throws the exception ~20 sec later.  I've also changed the send and recieve timeout values to see if this would affect the open timeout and it made no difference.  Is there a way to shorten the open timeout period to 5 seconds?

View Complete Post

More Related Resource Links

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

calling a web service on a remote server from an ASPX page

hi, I want to call a web service on a remote server. I've done "add web reference" in my project, and VS2005 has created the .discomap and .WSDL in the App_Web_Reference folder. When I try add the namespace representing the web server (the name I created when I added the web reference) by "using XXXXX;" the code does not compile because XXXXX is not defined. Have I missed any steps? thanks, -me

calling a web service on a remote server from a ASPX page (web site project VS2005)

HI,I am maintaining a web site project in VS2005 and have to call a new web service on a remote server. I've done add web reference, and created the .wsdl and .discomap files in the app_webReference folder.  When I try to create a object representing the web service in the code ( wsnamespace.serviceName ws = new wsnamespce.serviceName(); ) the code wouldn't compile.The web site project is already calling other web services. When I right click on the type representing the web service and "go to definition" it takes me to a proxy class (derived from of course SoapHttpClientProtocol) in the metadata. I think this is what's missing for  the new web service i'm trying to call. Have I missed any steps?Thanks in advance.-me

How to set and map a Method in the Service file with endpoint elements and binding elements

Hi all, I have created a service file like OSService.svc in that i have two methods like one is FileUpload and FileDownload for e.g :- [WebInvoke(UriTemplate = "/fileupload/{fileName}" , Method = "POST" )]         [OperationContract]         void FileUpload(string fileName, Stream fileContents); same as Filedownload also. People you may know these methods are inside the interface of service file what you are using i'e i have created a interface as IOSService.cs. So, what i need now is i want to write separate endpoint for FileUpload and Filedownload.Because i want to set separate value for receiveTimeout  and openTimeout for the Fileupload and FileDownload process in binding section in the web.config file itself. The below code was i'm using right now but still i'm not able to the set separate value of endpoint elements in the bindings. EndPoint Section:- <endpoint name = "endPoint1"  address  = "localhost:8000/OSService.svc/" bindingConfiguration = "TransactionalTCP"   binding  = "netTcpBinding"          contract = "IOSService"/> Binding Section:-  <binding name = "TransactionalTCP"  transactionFlow = "true"   /&

Client and service binding mismatch?

I have a WCF web service that when I call I get an exception: Content Type text/xml; charset=utf-8 was sent to a service expecting application/soap+xml; charset=utf-8.  The client and service bindings may be mismatched. It seems that only difference is text/xml needs to be changed to 'application/soap+xml'. Any ideas on how to fix this? The service is self-hosted (console host). The service reference was generated from this service without a problem. Thank you. Kevin

Binding Web Service Result in asp:gridview and enable sorting(paiging)

Hello everyoneI have web service and gridviewI'm binding it without problemcode: protected void Page_Load(object sender, EventArgs e) { GetCallsService wservice = new GetCallsService(); List<Call> list = wservice.getCalls(2); GridView1.DataSource = list; //GridView1.AllowSorting = true; GridView1.DataBind(); } But I want to enable sorting and(or) paging.   GridView1.AllowSorting = true; this doen't solves problem.everything worls fine if I'm usign sqlDatasource but when datasource is web service it doesn't wokdoes enyone know solution?

Exposing Web Service interfaces on a per-binding basis

Hi there, supposed I have a dual-homed system (with 2 nic ards) that are connected to 2 separate networks. Suppose one nic is bound to a public address (e.g. 63.xxx.xxx.xxx) and the other to a private network address (10.xxx.xxx.xxx). Is there a way for me to only expose a web services interface (e.g. foobar.asmx) on one of the bindings (e.g. 10.xxx.xxx.xxx), but not the other? I'm assuming this is a pretty typical scenario. Can someone please shed some light on this? Thanks,- K.  

TwoWay Binding Datagrid To WCF Service?

Hello, i tried to bind a DataGrid in TwoWay Mode to a WCF Service. The Data get displayed but changes in DataGrid dont affect the Database, from which the WCF Service is getting the data.   I hope someone can help me... Thank you.     My Szenario: I have a WCF Service which offers exactly one Function which return a custom class. The custom class inherits from INotifyPropertyChanged and has only one DataMember, an ObservableList with my DB Entitys. //Service.svc.cs static testdatenEntities _context = null; private static testdatenEntities Get_context() { if (_context == null) { _context = new testdatenEntities(); } return _context; } public customData GetDataFromADO() { var _context = Get_context(); var result = (from lief in _context.LIEF_INFO.AsQueryable() orderby lief.LNR select lief).Skip(50).Take(50); ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>(result); customData customdata = new customData() { List = _ocol }; return customdata; } //IService.cs [DataContract] public class customData : INotifyPropertyChanged { ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>(); [DataMember] public ObservableCollection<LIEF_INFO> List {

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

No protocol binding matches the given address ''.

I am getting this error whenever I tried to open the svc file in the browser using the Visual Studio 2008. The puzzling part is the localhost address being interpreted as ' '. What are should I look for in order to troubleshoot this problem?Exception Details: System.InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.][ServiceActivationException: No protocol binding matches the given address ''. Protocol bindings are configured at the Site level in IIS or WAS configuration.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +4413209

WCF - Java web service interop - Problem with asymmetric binding

Hi, I try to communicate with a Java web service and run into the following error: Error: System.ServiceModel.Security.MessageSecurityException: The incoming message was signed with a token which was different from what used to encrypt the body.  This was not expected. Server stack trace:    at System.ServiceModel.Security.TokenTracker.RecordToken(SecurityToken token)    at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader reader, Int32 position, Byte[] decryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan timeout)    at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)    at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)    at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)    at System.ServiceModel.Security.MessageSecurityProtocol.ProcessSecurityHeader(ReceiveSecurityHeader securityHeader, Message& message, SecurityToken requiredSigningToken, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)    at System.ServiceModel.Security.AsymmetricSecurity

How to expose app.config or binding properties for web service

I have a project that consumes a web service, which is then bundled into a windows service and a deployment project.  Both the project consuming the web service (I'll call that the vendorcontrol) and the service project have app.config files in the project structure, but when I compile and deploy, the settings for the vendorcontrol are not accessible in the resulting project.exe.config file.  How would I make this happen?

Send/open timeouts on WAS-hosted WCF service with named pipe orTCP binding, per-call instancing

We have a client that sends requests to a per-call WCF service (WAS hosted, NP binding, same machine) in a loop. The WCF service calls an external EXE to process requests. The operations on the service can take a few seconds, or a few hours. To combat this, we have sendTimeout=00:05:00, receiveTimeout=00:05:00 and a built-in circuit-breaker on the service that kills the external process after 00:05:00. Any service-side errors are returned to the client as FaultExceptions.  On the client, FaultExceptions are logged and the client proxy is aborted (proxy.Abort()). The client has configurable multithreading. In this example, it is running 3 threads, each of which creates a proxy, makes a call, and closes the proxy (or aborts it if an exception was received). Since the service is instanced as per-call, and it never receives more than 3 simultaneous calls (each of which being followed by a .Close() or .Abort() on the proxy), I would not expect the client to be getting timeouts during the send, but I am. In fact, the send timeouts I am receiving would seem to imply that the WCF service is hitting the default session limit, even though the class is explicitly marked with [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]. I put some trace logging on the client and I can see that the timeout is occurring when the proxy is being created. sendTimeout seems to

deploy a WCF service, hosting in Windows Service with NamedPipe binding


Hi, I developed a wcf service, hosted in Windows service with Namedpipe binding, and  a client application that were both in .net 4.0

both work well in my development computer, in Win 7
when i deployed both service and client in another computer. the service works, but the client cannot access the service.

with EndpointNot Found exception
when I changed binding to wsHttpBinding, the client failed to call the service with SecurityNegotiationException



Error : Unable to connect to the remote server, When using web service in window service

Hi All,

          I want to consume a web service in windows service but in windows service I am not able to access  web service. I have tried it in windows application and web application it is working fine but in windows service  it is not accessible.


i am getting error:-   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)--->   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Testmachone.MachWebRef.SimCardWS.ProvisionImsiCard(String MsMin, String MsEsn, String CardId, String UserId, String Password, String MscId, String BId, String NewValue, ActionTypes Command, String MDN, String COS, String MIP_KEY, String MEID, String RADIUSPassword, String IMSI, Boolean PrePaid)

 any body can help me what could be issue


Execute process on remote machine from windows service



I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:



processHandle As Integer
Dim connection

Execute process on remote machine from windows service



I am using Windows Management Instrumentation (WMI) to connect to a remote system. I am connecting to a remote system and executing an exe on the remote system. This works if it is a normal exe. I am passing the user name and the password as well.

But when I use the same code in a Windows Service, I get an error which says "Access is Denied." My requirement is to invoke the exe (every 2 hours) on client system from a windows service on the server.

My code looks like this:



processHandle As Integer
Dim connection

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend