wcf

How to implement a .net 3-tier architecture using Winforms

I have for some time build n-tier Applications using a database server as the data tier, Winforms as the presentation tier and an ASP.NET asmx webservice in the middle to send back and forth untyped Datasets. While this approach has worked for me so far, it certainly does feel outdated today. What technologies should I use if I were to ...

NetTcpBinding() with TransferMode.Streamed

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 Secu...

What's the primary use of Windows Event Viewer?

Hi all, Just wondering what everybody's opinion is on the Windows Admin tool Event Viewer? I'm writing a WCF application at the moment and have started logging errors to the windows event viewer when I handle them. I then started thinking, should I be logging more than just errors, such as when a user has logged in or out or would you ...

Restful WCF Service - how to send data with illegal XML characters?

I have a RESTful WCF web service. One of my methods has an input parameter that is a string. Some times the data I am passing to this parameter will include content that has one or more "illegal characters" - i.e. "&". So, I replace this with & before passing it to the web service - but it still throws an exception. The exception...

WCF Callback Faulted - what happens to the session?

Just trying to get my head around what can happen when things go wrong with WCF. I have an implementation of my service contract declared with an InstanceContextMode of PerSession... [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)] The calls happen as follows: My cli...

Silverlight - WCF Enable Binary Encoding

Hello, I have a WCF service that is returning a lot of data. I want to compress that information so I thought that using BinaryEncoding would be appropriate. Currently, I have a binding setup in my web.config as follows: <binding name="myCustomBinding" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:05:00" sendTime...

How do I restrict the WCF service called by an ASP.NET AJAX page to only allow calls for that page?

I have an AjaxControlToolkit DynamicPopulate control that is updated by calls to a WCF service. I know I can check the HttpContext in the service request to see if a user of the page (and thus, the control) is authenticated. However, I don't want anyone clever to be able to call the service directly, even if they're logged in. I want acc...

How to add multiple cookies to Response in WCF / REST service

I have access to WebOperationContext and can add one cookie by doing this: WebOperationContext.Current.OutgoingResponse.Headers.Add("Set-Cookie: foo_a=bar_a"); However if I call that several times, e.g.: WebOperationContext.Current.OutgoingResponse.Headers.Add("Set-Cookie: foo_a=bar_a"); WebOperationContext.Current.OutgoingRespons...

WCF Reliable Session Timeout

Hi, when do reliable sessions time out? My session class is defined as follows: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)] and in my app.config... <bindings> <netTcpBinding> <binding name="FTS_netTcpBinding"> <reliableSession enabled="tr...

How to I get the value of a custom soap header in WCF

I have created a custom soap header, and added it into my message via IClientMessageInspector public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel) { var header = new MessageHeader<AuthHeader>(); header.Content = new AuthHeader(Key); head...

How can I determine the quality of service in WCF?

I want to determine the following QoS Attribute of my service: Response Time Reliability Availability I will be creating an application that will select a service based on the mentioned attribute. ...

Linq2Sql relationships and WCF serialization problem

hi, here is my scenario i got Table1 id name Table2 id family fid with one to many relationship set between Table1. id and Table2.fid now here is my WCF service Code [OperationContract] public List<Table1> GetCustomers(string numberToFetch) { using (DataClassesDataContext context = new DataClassesDataContext()) { ...

How can I avoid huge communication classes in WCF?

My understanding is that all contract-implementing code has to be in a single class, that can become very large, obviously. How do I avoid this? I really prefer to have a few small classes doing one part of the communication with clients than a single behemoth class. The only idea I could think of is using multiple interfaces implemente...

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

A WCF service is based on NetTcpBinding. It may happen that a client silently vanishes, leaving the server without knowledge that it is not connected anymore. 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 issu...

Why does this call to jQuery's $.ajax() fire an empty request in Chrome and Firefox?

Hello, I am trying to call a WCF RESTful service from jQuery. I am using JSON to encode both request and response. The following code functions correctly in IE8: url = 'http://ipv4.fiddler:5683/WeatherWCF/NewBinding/MyService/GetValueFloat'; $.ajax({ url: url, data: '{"alias": "Udetemperatur"}', type: "POST", ...

How to configure log4net for WCF

On my asp webforms app I would do the log4net initialization; log4net.Config.XmlConfigurator.Configure(); on global.asax on Application_Start so that it is done once when the application starts. What is the right way of configuring log4net for IIS hosted WCF apps(asking specifically about where to place this line which event to use e...

WAS Non-HTTP activation - hooking application startup

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 tha...

How to precompile WCF code and then host it on IIS ?

How do you precompile WCF code so that the WCF code can't be seen by anyone who has access to the WCF code. it's possible to this with ASP.NET code by using the "precompilation" feature. basically, what the precompilation feature does is enable the developper to deploy "binaries" to IIS instead of a folder containing source code. can th...

WCF WebService. Does not allow sending more than 8kb of data...

I have developed a WCF WebService. On client side they are unable to send more than 8kb of file bytes[]. How can I increase the number of bytes the client and upload and also the time out. <system.serviceModel> <!-- Test File Size --> <binding maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStrin...

WCF vs ASMX web service

I am totally confused between WCF and ASMX web service. I have used lot of web service in earlier stage and now there is new thing introduced WCF. I can still create WCF that function as a web service. I think there will be more stuff in WCF. Can any one provide me any article or difference between WCF and Web service? Which one to ...