Hi Carlo!
> the proxy type is dinamically created, so the variable is of type
> object. To access the method on it I have to cast it to the
> appropriate type.
(_MyTypeClient)myInstance.ClientCredentials... is not possible?
If no: When static typing is not possible, you need to get the System.Type
Objects. Without them it is not possible.
e.g.
Type tClientBase = typeof(ClientBase<>);
Type tType = Type.GetType("Namespace._MyType, Assembly", true);
Type tMyClient = tClientBase.MakeGenericType(tType);
// now you can reflect on tMyClient to invoke Methods late-bound (e.g.
GetProperty on "ClientCredentials").
When you have an underlying and non-generic interface you can use this for
early-bound access.
BTW: Maybe there is a WCF specific solution for you problem.
G
Steven Cheng[MSFT] - 11 Apr 2007 03:41 GMT
Thanks for G?ter's informative input.
Hi Carlo,
Do you mean the "_MyType" type is dynamically compiled and
generated(through .NET compiler api)? If so, I'm afraid you can not
statically use type name in your application code, but have to use
Type.GetType to get the type instance of that dynamic generated
type(through full typename).
G?ter has posted some code snippt on this, after you get the type object of
your dynamic generated proxy/interface, you can use standard reflection API
to invoke method/property against the actual proxy instance.
I think this is a typical dynamic code generation and late-binding case and
WCF hasn't particular solution for it except using reflection.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] - 13 Apr 2007 02:36 GMT
Hi Carlo,
Have you got any further ideas on this issue? If you have any further
questions, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Carlo Folini - 18 Apr 2007 08:50 GMT
Hi Steve,
I want to use windows authentication, I'm having trouble also with the
'normal' generated proxy.
When I solved those problem I will try Gunter and yours suggestions.
Thanks.

Signature
Carlo Folini
> Hi Carlo,
>
[quoted text clipped - 9 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] - 23 Apr 2007 03:14 GMT
Thanks for your followup Carlo,
Sure, please feel free to post here if you get any progress.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.