views:

99

answers:

3

In my WCF solution, the server doesn't need to know the data type. The client will send a type and receive the same type.

For performance reasons I think I could implement serialization manually in the client proxy, avoiding WCF builtin serialization on the server side, but there is any way to achieve the same goal just configuring WCF properly?

+1  A: 

The whole basic architecture of WCF is based on the client calling a server, sending a serialized message.

That's the very foundation of WCF - message passing. You cannot turn that off. You can tweak it - but you can't remove it.

As for custom serialization - Check out Aaron Skonnard's excellent Serialization in WCF article in MSDN Magazine.

You can go as far as creating your own custom serializer for WCF - if you really want to - but why??

Why do you as a single developer or small shop want to "compete" with a pretty sizeable team at Microsoft and re-invent the wheel of serialization yet again? I would much rather concentrate on my real business issues which Microsoft cannot solve for me, but let the "infrastructure glue" be their game - they're good at it, and they have much more manpower and resources for that stuff!

marc_s
But you *can* specify the data type being passed in a relatively agnostic fashion, passing an Object instance, byte[] array, or similar.
David Lively
Yes - but even then, this **will be serialized** into a message at some point. You cannot pass an object from client to server without going through some form of serialization.
marc_s
I don't think I could build anything near as good as the built-in serialization in the available time. But I wonder if the built-in serialization should be configurable as I am asking to be.
Jader Dias
A: 

Just make the type that you pass back and forth to the server have something like a byte[] property. Then you can serialize your known type on the client. The server would only have to know the opaque bytes

Joel Martinez
A: 

I think that protobuf-net customizes the serialization. If I look into its source code, I could understand how to achieve my goals

Jader Dias