Nicholas said:
Bill,
I would worry more about the design of the service. If the service
creates the object and returns it but the object doesn't need any specific
values set by the service, then this is a bad idea.
If the service doesn't require the values of the object you are passing
to it for the operation you are calling, then that's a bad idea.
Also, you might want to make sure it makes sense to mix your inputs and
outputs like that. It might not make sense from a design standpoint to have
the inputs and outputs mixed on the same object.
Take for example, if you had a method to get the name of the computer
the service is running on. If there is a string parameter that you pass to
it by reference, then that doesn't make sense, since there is no special
initialization of the string that you need to pass to the service.
Yes, the design is what I'm focusing on at this point (sorry if I didn't
make that clear.) At the risk of appearing slow, I'd like to just follow
up with a sort of confirmation just to make sure that I understand; I
don't want to fly off in the wrong direction.

Let me provide a little
more background:
A host application will have a number of different WCF services.
ServiceContacts will provide a pair of OperationContracts: one for
sending a collection objects (defined by a CollectionDataContract of
DataContract of class X) and another for retrieving a collection objects
(again, CDC of DC of class X).
So, the design in a nutshell: Both client and host applications will
reference a Service.dll which provides definitions for contracts. When
sending, the client app will create a collection of X, connect to the
service and call OperationContract "A" passing the collection as a
parameter. When receiving, the client app will connect and call an
OperationContract "B" that will return a collection of X.
So, am I starting off in the right direction? Am I missing anything
small or large? Would it be better to split the the Service.dll into
DataContracts.dll and ServiceContracts.dll, where the client app only
uses the DataContracts.dll and the host app uses both?
Thanks,
Bill