locked
Controlling type names on client RRS feed

  • Question

  • I have a service (WCF) that returns MultipleResult<R1, R2> for an operation. When the code is generated for the client application the name of the type is MultipleResultOfR1ofR2. How can I control the name that is generated for the client when wsdl is retrieved?

     

    R1 = Result1

    R2 = Result2

     

    I have a situation where more than one result can be returned and I did not want to create a type for all the combination of results that can be returned so I provided this custom class that will allow the implementor to specify the return types.

     

    Thanks.

    Wednesday, September 19, 2007 6:51 PM

Answers

  • This may not be a naming issue. It appears from the generated class name that WCF cannot handle generics as generics. Certainly WSDL cannot describe a generic operation.

     

    I think you'll have to create the separate types like:

     

    public class MultipleResultIntInt : MultipleResult<int,int>

    {

    }

     

    Thursday, September 20, 2007 1:04 AM
    Moderator

All replies

  • This may not be a naming issue. It appears from the generated class name that WCF cannot handle generics as generics. Certainly WSDL cannot describe a generic operation.

     

    I think you'll have to create the separate types like:

     

    public class MultipleResultIntInt : MultipleResult<int,int>

    {

    }

     

    Thursday, September 20, 2007 1:04 AM
    Moderator
  • Thanks for your reply, WCF can handle generics it has to do with when the wsdl is generated for the client that the name is generated as such. I thought there may be a way to intercept the generation of the name before sending off to the client.

     

    Friday, September 21, 2007 1:27 AM