tags:

views:

14

answers:

1

I see WCF response types (i.e. the types of objects returned from WCF handlers) containing DTO types which in-turn contain the fields the client is interested in. Is this standard practise? Why not put the fields directly on the response type?

+1  A: 

What WCF returns depends upon the binding details (TCP, HTTP etc) and the proxy. Transferring DTO is a standard practice.

Kangkan
Is it acceptable to place the fields directly on the object sent as a response though? I can't see the need for the additional indirection....
Ben Aston
Yes, there is no harm in sending the return with the same object that the client is interested in. I wonder what your binding is. You may please update your question with the details (the config section). We are using TCP and the returns are clean without any redirection. But using clients like gSoap with WCF adds such redirection.
Kangkan