Search Results

Search found 112 results on 5 pages for 'nettcpbinding'.

Page 1/5 | 1 2 3 4 5  | Next Page >

  • Duplex communication using NetTcpBinding - ContractFilter mismatch?

    - by Shaul
    I'm making slow and steady progress towards having a duplex communication channel open between a client and a server, using NetTcpBinding. (FYI, you can observe my newbie progress here and here!) I'm now at the stage where I have successfully connected to my server, through the server's firewall, and the client can make requests of the server. In the other direction, however, things aren't quite so happy. It works fine when testing on my own machine, but when testing over the internet, when I try to initiate a callback from the server side, I get an error: The message with Action 'http://MyWebService/IWebService/HelloWorld' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None). Here are some of the key bits of code. First, the web interface: [ServiceContract(Namespace = "http://MyWebService", SessionMode = SessionMode.Required, CallbackContract = typeof(ISiteServiceExternal))] public interface IWebService { [OperationContract] void Register(long customerID); } public interface ISiteServiceExternal { [OperationContract] string HelloWorld(); } Then, on the client side (I was fiddling with these attributes without really knowing what I'm doing): [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, Namespace="http://MyWebService")] class SiteServer : IWebServiceCallback { string IWebServiceCallback.HelloWorld() { return "Hello World!"; } ... } So what am I doing wrong here? EDIT: Adding app.config code. From server: <system.serviceModel> <diagnostics> <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" logEntireMessage="true" maxMessagesToLog="1000" maxSizeOfMessageToLog="524288" /> </diagnostics> <behaviors> <serviceBehaviors> <behavior name="mex"> <serviceDebug includeExceptionDetailInFaults="true"/> <serviceMetadata/> </behavior> </serviceBehaviors> </behaviors> <services> <service name ="MyWebService.WebService" behaviorConfiguration="mex"> <endpoint address="net.tcp://localhost:8000" binding="netTcpBinding" contract="MyWebService.IWebService" bindingConfiguration="TestBinding" name="MyEndPoint"></endpoint> <endpoint address ="mex" binding="mexTcpBinding" name="MEX" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="net.tcp://localhost:8000"/> </baseAddresses> </host> </service> </services> <bindings> <netTcpBinding> <binding name="TestBinding" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" portSharingEnabled="false"> <readerQuotas maxDepth="32" maxStringContentLength ="8192" maxArrayLength ="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> <security mode="None"/> </binding> </netTcpBinding> </bindings> </system.serviceModel> and on the client side: <system.serviceModel> <bindings> <netTcpBinding> <binding name="MyEndPoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="None"> <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> <message clientCredentialType="Windows" /> </security> </binding> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://mydomain.gotdns.com:8000/" binding="netTcpBinding" bindingConfiguration="MyEndPoint" contract="IWebService" name="MyEndPoint" /> </client> </system.serviceModel>

    Read the article

  • how to create nettcpbinding of this custombinding

    - by evgeni
    I am new at wcf programming model and i want to use nettcpbinding. before i ask my question below is my custom binding : <customBinding> <binding name="basic"> <security authenticationMode="UserNameForCertificate"/> <binaryMessageEncoding/> <httpsTransport/> </binding> </customBinding> when i create a service reference using a simple console application it finds a certificate and ask me to use it.and this way i can use the webservice ... but when i change binding to nettcpbinding with TransportWithMessageCredential the service is looking for certificate and could not find it like this : </binding> </netTcpBinding> ServiceCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindByIssuerName, "Contoso.com"). at this point i use a customnamevalidator and i do it programmatically. so why when i use nettcpbinding with TransportWithMessageCredential why is SetCertificate could not find the installed certificate ? am i missed something ? or do i have to ad something? thanks .

    Read the article

  • CSLA with WCF nettcpbinding

    - by t-kehl
    Hi. I am using CSLA.NET. It works realy nice with the wsHttpBinding. Now, I have my own Windows-Service and search the solution, that I can use this Windows-Service as the CSLA-Server and using nettcpbinding. Can someone give me a tip how to going on? Perhaps someone has a sample how I can do that. Thank you! Best Regards, Thomas

    Read the article

  • WCF - Disabling security in nettcpbinding (c#)

    - by daniel-lacayo
    Hello everyone. I'm trying to make a self hosted WCF app that uses nettcpbinding but works in an environment without a domain. It's just two regular windows pc's, one is the server and the other one will be the client. The problem with this is that when I try to get the client to connect it's rejected because of the security settings. Can you please point me in the right direction as to how I can get this scenario to work? Should I (if possible) disable security? Is there another (hopefully simple) way to accomplish this? Regards, Daniel

    Read the article

  • Silverlight WCF netTcpBinding problem

    - by JontyMC
    Trying to call a WCF with a netTcpBinding via Silverlight, I am getting the error: "TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions.. This could be due to attempting to access a service in a cross-domain way while the service is not configured for cross-domain access. You may need to contact the owner of the service to expose a sockets cross-domain policy over HTTP and host the service in the allowed sockets port range 4502-4534." My WCF service is hosted in IIS7, bound to: http://localhost.myserivce.com on port 80 and net.tcp on port 4502 I can see http://localhost.myserivce.com/myservice.svc if I browse to it (my hosts file is pointing this domain to localhost). I can also see http://localhost.myserivce.com/clientaccesspolicy.xml: <?xml version="1.0" encoding="utf-8"?> <access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="*"> <domain uri="*" /> </allow-from> <grant-to> <socket-resource port="4502-4534" protocol="tcp" /> </grant-to> </policy> </cross-domain-access> </access-policy> What am I doing wrong?

    Read the article

  • WCF NetTcpBinding Security - how does it work?

    - by RemotecUk
    Hi, encountered the following problems trying to work through the quagmire of settings in WCF... I created a WCF client server service using a NetTcp binding. I didn't make any changes to the security settings and when running on one machine it works very nicely. However, when I ran my client from another machine it complained that the server didnt like the security credentials that were sent. I understand now that NetTCP is "secured" by default and that my client would have been passing the wrong security details - namely the windows user name and password (or some form of domain authentication) to my server which as they are not running on the same domain it would not have liked. However, what I don't understand is as follows: I haven't specified any security in my binding - does the standard settings expect a windows user name or password to be sent? I don't have any certificate installed on my server - I understand that NetTCP bindings need some form of public private key to protect the credentials - yet this seemed to work when both client and server were on the same machine - how was the data getting encrypted? Or wants it as WCF knew it was on the same machine and encryption isn't needed? I have had to set my security mode on my client and server to "none" now and they connect nicely. However is there any way to encrypt my data without a certificate? Finally... what is the difference between Transport and Message security? To check my understanding (excuse the scenario!) message security is like if I sent a letter from person A to person B and I encode my hand writing to ensure that if anyone intercepts it they cannot read it? Transport Security is if I decide to have my letter sent by armed transport so that no one can get at it along the way? Is it possible to have any form of encryption in WCF without a certificate? My project is a private project and I dont want to purchase a certificate and the data isnt that sensitive anyway so its just for my own knowledge. Thanks in advance.

    Read the article

  • When creating a WCF Service with NetTcpBinding, use endpoint "localhost" or machine's host name?

    - by Elan
    I have a WCF service that uses the NetTcpBinding and is running within a Windows service. Remote clients connect to this service. So far, I have defined the endpoint to use "localhost". If the host machine has multiple network adapters, will it receive messages on all adapters? Would it be better to assign the machine's host name to the endpoint instead of "localhost"? What are the advantages/disadvantages?

    Read the article

  • wcf 4 netTcpBinding

    - by phil
    I was seting up a wcf 4 service today with netTcpBinding, and I just couldn't get it to work. It was of course no problem getting basdicHttpBinding to work since little config is needed in WCF 4. I started wondering if it is even possible to get netTcpBinding working when debbuging through VS10. I'm hosting my service in a svc-file since I'm planning on hosting it in the IIS (7).

    Read the article

  • Figuring out the required MaxReceivedMessageSize in WCF with NetTcpBinding

    - by Flo
    I'm using NetTcpBinding in WCF and i want to send a Stream which does not exceed the size of 1 MB. I have set the MaxReceivedMessageSize to a really high number and that works fine of course. But I am curious: Does setting the MaxReceivedMessageSize to a very hight number have any (negative) impact or would it be useful to set it just above the size I actually want to send/receive? What kind of overhead can I expect when using the NetTcpBinding to transfer a stream? Meaning: when I send a stream of 1 MB, how large does my MaxReceivedMessageSize has to be?

    Read the article

  • NetTcpBinding() with TransferMode.Streamed

    - by totem
    Hi, I am getting a timeout exception when trying to use a net tcp endpoint through code that has no security and is streamed like so: NetTcpBinding binding = new NetTcpBinding(SecurityMode.None); binding.TransferMode = TransferMode.Streamed; binding.SendTimeout = TimeSpan.MaxValue; the same code would work if i just leave out the SecurityMode.None or choose SecurityMode.Transport, the exception is on a timeout that is too low, i tired adding all the timeouts for recive, send, open, close and set them all to Max and that didnt work. im using sample code from: http://csharp-codesamples.com/2009/02/data-transfer-using-self-hosted-wcf-service/ Any explenation as to how to use no security in this scenario would be appriciated. Thanks, Totem

    Read the article

  • WCF NetTcpBinding Buffered vs Streamed performance problems

    - by DxCK
    I wrote a WCF service that should transform any size of files, using the Streamed TransferMode in NetTcpBinding, and System.IO.Stream object. When running performance test, i found significant performance problem. Then I decided to test it with Buffered TransferMode and saw that performance is two times faster! Because my service should transfer big files, i just can't stay in Buffered TransferMode because of memory management overhead on big files at the server and client side together. Why is Streamed TransferMode slower than the Buffered TransferMode? What can i do to make Stremed performance better?

    Read the article

  • List of objects sent over WCF, but null list received?

    - by GONeale
    Hey there, I have an object containing a list of custom objects which I am returning over a response in WCF, however on the receiving end, the list is null? But it contains 112 objects just prior to stepping out of the service on the server. This wasn't always the case, I have seen it return a list. I've just recently upgraded it to use NET TCP bindings, but I can't confirm when I started losing the data or if it was since the conversion from wsHttpBinding to netTcpBinding as it moved along with about four other services. I have looked on the WCF Service messages and trace file and also the WCF client's messages and trace file, no exceptions reported, and both message logs indicate they are sending the List<T> and for client, receiving the list - very frustrating! It's not a super light array, but not huge either, around 100KB. it has about 12 properties each and as stated 112 items are being sent. I have tried everything I can think of on client and server, note: Client: this.binding = new NetTcpBinding(SecurityMode.None) { MaxReceivedMessageSize = int.MaxValue, ReaderQuotas = { MaxStringContentLength = int.MaxValue, MaxArrayLength = int.MaxValue } }; ... Server app.config (sorry I have no idea if the quota settings have any bearing on net tcp? I only just added it similar to what I use for wsHttpBinding to test, but still list is null): <netTcpBinding> <binding name="SecurityByNetTcpTransportBinding" sendTimeout="00:03:00" maxReceivedMessageSize="2147483647"> <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" /> <security mode="None" /> </binding> </netTcpBinding> and something else I tried in my net tcp binding behavior: <dataContractSerializer maxItemsInObjectGraph="2147483647" /> <serviceTimeouts transactionTimeout="05:05:00" /> <serviceThrottling maxConcurrentSessions="400" maxConcurrentInstances="400" maxConcurrentCalls="400"/> I hope somebody can help, I hate 5 steps forward 3 steps backward which always seems to be the case with WCF :P In the interim until I [hopefully] get a response I will now try reducing this array just to see if it's a sizing issue.. Ok, It seems I have bigger problems. Because the list was the only thing I was sending, I thought it was an array issue. I am even setting an int to "25" and it's coming back as 0 - Anybody? I know I must have done something obviously stupid.

    Read the article

  • TimeoutException when WCF Host and Client are in the same process

    - by Pharao2k
    I've ran into a really weird problem. I am building a heavily distributed application where each app instance can either be a Host and/or Client to a WCF-Service (very p2p-like). Everything works fine, as long as the Client and the targeted Host (By which I mean the app, not the Host, since currently everything runs on a single computer (so no Firewall problems etc.)) are NOT the same. IF they are the same, then the app hangs for exactly 1 Minute and then throws a TimeoutException. WCF-Logging did not produce anything helpful. Here is a small app which demonstrates the Problem: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { var binding = new NetTcpBinding(); var baseAddress = new Uri(@"net.tcp://localhost:4000/Test"); ServiceHost host = new ServiceHost(typeof(TestService), baseAddress); host.AddServiceEndpoint(typeof(ITestService), binding, baseAddress); var debug = host.Description.Behaviors.Find<ServiceDebugBehavior>(); if (debug == null) host.Description.Behaviors.Add(new ServiceDebugBehavior { IncludeExceptionDetailInFaults = true }); else debug.IncludeExceptionDetailInFaults = true; host.Open(); var clientBinding = new NetTcpBinding(); var testProxy = new TestProxy(clientBinding, new EndpointAddress(baseAddress)); testProxy.Test(); } } [ServiceContract] public interface ITestService { [OperationContract] void Test(); } public class TestService : ITestService { public void Test() { MessageBox.Show("foo"); } } public class TestProxy : ClientBase<ITestService>, ITestService { public TestProxy(NetTcpBinding binding, EndpointAddress remoteAddress) : base(binding, remoteAddress) { } public void Test() { Channel.Test(); } } What am I doing wrong? Regards, Pharao2k

    Read the article

  • Mono WCF NetTcp service takes only one client at a time

    - by vene
    While trying to build a client-server WCF application in Mono we ran into some issues. Reducing it to just a bare example we found that the service only accepts one client at a time. If another client attempts to connect, it hangs until the first one disconnects. Simply changing to BasicHttpBinding fixes it but we need NetTcpBinding for duplex communication. Also the problem does not appear if compiled under MS .NET. EDIT: I doubt (and hope not) that Mono doesn't support what I'm trying to do. Mono code usually throws NotImplementedExceptions in such cases as far as I noticed. I am using Mono v2.6.4 This is how the service is opened in our basic scenario: public static void Main (string[] args) { var binding = new NetTcpBinding (); binding.Security.Mode = SecurityMode.None; var address = new Uri ("net.tcp://localhost:8080"); var host = new ServiceHost (typeof(Hello)); host.AddServiceEndpoint (typeof(IHello), binding, address); ServiceThrottlingBehavior behavior = new ServiceThrottlingBehavior () { MaxConcurrentCalls = 100, MaxConcurrentSessions = 100, MaxConcurrentInstances = 100 }; host.Description.Behaviors.Add (behavior); host.Open (); Console.ReadLine (); host.Close (); } The client channel is obtained like this: var binding = new NetTcpBinding (); binding.Security.Mode = SecurityMode.None; var address = new EndpointAddress ("net.tcp://localhost:8080/"); var client = new ChannelFactory<IHello> (binding, address).CreateChannel (); As far as I know this is a Simplex connection, isn't it? The contract is simply: [ServiceContract] public interface IHello { [OperationContract] string Greet (string name); } Service implementation has no ServiceModel tags or attributes. I'll update with details as required.

    Read the article

  • What is the purpose of WCF reliable session?

    - by bsnote
    The documentation around this topic is poor. I use WCF services with NetTcpBinding hosted in Windows service. The problem is that a session is dropped when it is inactive for some time. What I need is the session which is always alive. Is WCF reliable session something that can help? Or I can just play with timeout settings?

    Read the article

  • WCF and Firewalls

    - by Amitd
    Hi guys, As a part of learning WCF, I was trying to use a simple WCF client-server code . http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx but I'm facing strange issues.I was trying out the following. Client(My) IP address is : 192.168.2.5 (internal behind firewall) Server IP address is : 192.168.50.30 port : 9050 (internal behind firewall) Servers LIVE/External IP (on internet ) : 121.225.xx.xx (accessible from internet) When I specify the above I.P address of server(192.168.50.30), the client connects successfully and can call servers methods. Now suppose if I want to give my friend (outside network/on internet) the client with server's live I.P, i get an ENDPOINTNOTFOUND exceptions. Surprisingly if I run the above client specifying LIVE IP(121.225.xx.xx) of server i also get the same exception. I tried to debug the problem but haven't found anything. Is it a problem with the company firewall not forwarding my request? or is it a problem with the server or client . Is something needed to be added to the server/client to overcome the same problem? Or are there any settings on the firewall that need to be changed like port forwarding? (our network admin has configured the port to be accessible from the internet.) is it a authentication issue? Code is available at . http://www.ralfw.de/weblog/wcfsimple.txt http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx i have just separated the client and server part in separate assemblies.rest is same. using System; using System.Collections.Generic; using System.Text; using System.ServiceModel; namespace WCFSimple.Contract { [ServiceContract] public interface IService { [OperationContract] string Ping(string name); } } namespace WCFSimple.Server { [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] class ServiceImplementation : WCFSimple.Contract.IService { #region IService Members public string Ping(string name) { Console.WriteLine("SERVER - Processing Ping('{0}')", name); return "Hello, " + name; } #endregion } public class Program { private static System.Threading.AutoResetEvent stopFlag = new System.Threading.AutoResetEvent(false); public static void Main() { ServiceHost svh = new ServiceHost(typeof(ServiceImplementation)); svh.AddServiceEndpoint( typeof(WCFSimple.Contract.IService), new NetTcpBinding(), "net.tcp://localhost:8000"); svh.Open(); Console.WriteLine("SERVER - Running..."); stopFlag.WaitOne(); Console.WriteLine("SERVER - Shutting down..."); svh.Close(); Console.WriteLine("SERVER - Shut down!"); } public static void Stop() { stopFlag.Set(); } } } namespace WCFSimple { class Program { static void Main(string[] args) { Console.WriteLine("WCF Simple Demo"); // start server System.Threading.Thread thServer = new System.Threading.Thread(WCFSimple.Server.Program.Main); thServer.IsBackground = true; thServer.Start(); System.Threading.Thread.Sleep(1000); // wait for server to start up // run client ChannelFactory<WCFSimple.Contract.IService> scf; scf = new ChannelFactory<WCFSimple.Contract.IService>( new NetTcpBinding(), "net.tcp://localhost:8000"); WCFSimple.Contract.IService s; s = scf.CreateChannel(); while (true) { Console.Write("CLIENT - Name: "); string name = Console.ReadLine(); if (name == "") break; string response = s.Ping(name); Console.WriteLine("CLIENT - Response from service: " + response); } (s as ICommunicationObject).Close(); // shutdown server WCFSimple.Server.Program.Stop(); thServer.Join(); } } } Any help?

    Read the article

  • what is the global.asax Application_Start equivalent when using WAS in IIS7

    - by Mike Tours
    Hi I'd like to use the netTcpBinding for my WCF application which is currently hosted in IIS7, which means configuring it to use WAS instead. This is fairly straight forward however, my application previously made use of the Application_Start event in the global.asax file. I do not require access to the httpContext(which I understand access has been removed in IIS7), however I would still like to hook into the start or init methods? Does an equivalent exist when hosting an application in WAS as apposed to IIS7? Using classic mode is not an option(again I'm not interested in the httpcontext and this only appears to work if using an http binding) - and I've seen an example of putting a static class instide the app_code folder which looks like a horrible hack.

    Read the article

  • WAS Non-HTTP activation - hooking application startup

    - by Mike Tours
    I'm trying to integrate a netTcpBinding based application that is hosted inside WAS with an IoC container (autofac/spring). Unfortunately, when it starts inside WAS and due to the fact that it is not an Http based application, no events are fired inside the Global application class. I need to catch the application domain startup so that I can configure the IoC container. Is there any way to do this when hosting in WAS? I've seen horrible things involving using static classes inside App_Code folders, but I'd like something somewhat more testable and not quite as dirty.

    Read the article

  • How can I tell that a NetTcp-based WCF connection was interrupted?

    - by mafutrct
    A WCF service is based on NetTcpBinding. It may happen that the client silently vanishes, leaving the server thinking that it is still connected. I'm currently using a thread that pings all connected client to see if they are still alive, and removes disconnected clients. Is a ping thread the correct way to solve the issue, or is there a better, possibly event-based way? Do I have to surround every code that communicates with the client by try/catch and remove it from the list of connected clients additionally?

    Read the article

  • Connecting to a WCF Service in PHP that has a a NetTCP Binding and a BasicHttpBinding

    - by Justin Dearing
    I have a WCF service. It has multiple clients and three endpoints. The endpoint bindings are nettcp, wsHttp and basicHttp. If I attempt to connect to it via php'd builtin SoapClient class like so: $service = new SoapClient ("http://service.companyname.local:6666/Service/?wsdl", array( "location" => "http://service.companyname.local:6666/Service/Basic", "trace" => true, 'soap_version' => SOAP_1_1 ) ); I get the following: PHP Fatal error: SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport 'http://schemas.microsoft.com/soap/tcp' in c:\www\client.php on line 666 Right now my workaround is to save the wsdl manually and remove the nettcp binding. Is there a workaround that will allow me to use the automatically generated wsdl? Can I hide a binding from the wsdl in web.config? Can I generate different wsdls on different bindings. I don't want to deploy two service hosts.

    Read the article

  • WCF on Win Server 2008 and IIS7 with only net.tcp binding hide IIS features

    - by Nicola Celiento
    Hi all, I've installed HTTP Activation and Non-HTTP Activation IIS's features for Framework.NET 3.0 under WCF Activation feature. I'm trying to remove http and https bindings (under default Web Site) from IIS Manager and leave others (net.tcp, net.msmq, etc.) but if I close and re-open IIS manager I not found any icons in the right panel (Feature View). The only feature I see is IIS Manager Permissions. It's right I don't see them? I hope you can help me. Thank you in advance!

    Read the article

1 2 3 4 5  | Next Page >