wcf

In WCF is there a way to set ServiceContract Namespace assembly-wide?

In WCF land, you can specify a Namespace prefix for anything that has a [DataContract] like so: [DataContract(Namespace="MyApp")] public class whatever... However if you wanted to apply a common namespace to ALL data contracts assembly-wide, you can use the ContractNamespaceAttribute: /* in AssemblyInfo.cs */ [assembly: ContractNames...

WCF Communication though named pipes with non .net App

I hear that WCF is the new standard for communication across the network and applications in .net. The idea seems to make sense as well, provide standard interfaces for programs to communicate. Here is my situation, I have a .net app i want to communicate to a ruby application though pipes. On the .net side (server) I would like to use ...

WCF Service Library with NetTcpBinding

Hello, I'm having a tough time with NetTcpBinding. When I run my WCFservice,I get this... ============================================================== System.InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]. ...

WCF Multiple Bindings

I'm getting the following error when I try multiple end points.. System.ServiceModel.AddressAlreadyInUseException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: the service failed to listen. at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register() at S...

Find out the amount of data sent and received by a WCF host?

I have an application hosting a WCF service (net.tcp) that receives and sends data. Is there a way to know how much data has been transferred since the host was started? ...

WCF Encrypting Connection Strings with aspnet_regiis

I have a WCF Service talking to a web application. In the web.config files I want to encrpyt the connetion string section. I'm using aspnet_regiis -pe "connectionStrings" -app "/WebAppFolder" for the web applications web.config and this works fine. But when I do the same for the WCF service I get an internal server error when I try a...

How can I substitute a property during serialization with DataContractSerializer?

I have a working ChangeTrackingList implementation which does its job just fine, but I'd like to "filter" its contents when sending it from the client back to the server so that it only includes the changes. Getting the changes is easy, as my list exposes a GetChanges method for just that purpose. How can I interrupt the DataContractSeri...

WCF Client Dynamic Proxy Pattern

To consume WCF services, we dynamically create channels using the following pattern. Dim subscriptionsService As ISubscriptionsService = ProfileChannelFactory.Create(Of ISubscriptionsService)() Dim result As Subscription() = Nothing Try result = subscriptionsService.GetSubscriptions(New GetSubscriptionsRequest()).Sub...

Uploading files in WCF services approaches

I have WCF service that I can upload files. XElement upload = service.UploadFiles(id, File.ReadAllBytes(filePath)); This works, but I am just wondering if it is the best way to upload each of them one by one when you have many (about a thousand) small files (15~20K). How can we compare "Chunky" versus "Chatty" approaches? 1) Is it be...

Prescriptive advice on minimally invasive conversion from Remoting to WCF

Is the advice given in this oft-cited MSDN article still considered sound for converting a .NET Remoting application to WCF? I notice that the article references the deprecated ServiceBehavior attribute ReturnUnknownExceptionsAsFaults, so I question whether people have found other discrepancies or other approaches better suited to intr...

What is the most efficient way to make multiple (parallel) requests against a web service using WCF?

I have a WCF service client and it was generated using the /async argument with svcutil.exe, so it uses the asynchronous programming model. When I make multiple asynchronous requests with a single client though it serializes the execution of those requests. Here is an example that shows how I am executing the parellel requests. [TestM...

Hosting a WCF(mex endpoint) service inside a windows service on windows 2008

I'm hosting a WCF service inside a windows hosted service. When I start the WHS, I get the following error: The ChannelDispatcher at 'net.tcp://mysecreturl/' with contract(s) '"IClass"' is unable to open its IChannelListener. System.InvalidOperationException: A registration already exists for URI 'net.tcp://mysecreturl/Indexer/'. ...

Using generic Dictionary over wcf: what do I need to look for?

Suppose I have a WCF service and a method in the contract <ServiceContract()> _ Interface IThingService '... <OperationContract()> _ Function GetThing(thingId As Guid) As Thing End Interface where Thing is an ordinary class with ordinary properties, except for one member: Public Class Thing ' ... Public Property Photos() As ...

WCF client config: centralized endpoint address

Hi, i've a WCF client wicht refers to multiple services hosted in the same machine. like this example <client> <endpoint address="net.tcp://localhost:8731/TrackingService" binding="netTcpBinding" ... </endpoint> <endpoint address="net.tcp://localhost:8731/CommonService" binding="netTcpBinding"... </endpoint> </client> is ...

SQL-Server access with WCF: Timeout

I have a server with a SQL2008 Database and IIS7. I created a WCF service, that access the SQL-Server and returns the resultset in form of a List<T>. My problem is, that I get timeouts when accessing the service from my client, although the query should not take too long (about 1 sec in SQL-manager) it fetches 17.256 lines. When I con...

WCF using Enterprise Library Validation Application Block - how to get hold of invalid messages?

I've got some WCF services (hosted in IIS 6) which use the Enterprise Library (4.0) Validation Application Block. If a client submits a message which fails validation (i.e. gets thrown back in a ValidationFault exception), I'd quite like to be able to log the message XML somewhere (using code, no IIS logs). All the validation happens bef...

Insert all Internal Server Errors into windows event log

Hello, I have developed a small WCF service which handles HTTP request. I want to be aware of every fault that happens: everything that causes 500 Internal Server Error from the contracts view everything that causes a CommunicationException from the bindings view (I've written a custom one but am using standard ones also) The err...

Can I preserve object references duing manual serialization?

Using the DataContractSerializer, I can serialize an object graph, while maintaining object references by setting "PreserveObjectReferences". This works great for most of my object graph, but there is one spot where I have to do the serialization myself. Is there any way for me to hook into the reference preservation system myself? How c...

Getting started with client -> server communication between two windows application. WCF?

I've written an application that uses some serial port hardware directly, and abstracted the serial commands out into a object. I'd like to use that object remotely from another application on another machine on the network, but I'm not sure where to start. I previous used TCP and made up some commands to send over the network to cont...

WCF can no longer step into a service that's localy hosted -- why not?

I have a WCF test service and a test client in the same solution. The service is configured to run on localhost (Ie, "http://localhost:8731/Design_Time_Addresses/MyService/Service") I run the client app and it correctly invokes the service and gets back the correct answer. I've verified via logs that it's definitely running the service t...