none
How to specify optional parameter in OperationContract and make it show in WSDL RRS feed

  • Question

  • Is there a way to specify optional parameter in OperationContract and make it show in soap wsdl for wcf service?

    Thanks for any help.

    Tuesday, February 5, 2013 2:47 PM

Answers

  • I don't know wether or not it is possible but if you are unsure about the parameters and the future requirements may vary or there comes a variation in terms of how WCF evolves in future.I would say , make this habit to take Interface type as Parameter input and Interface type as output where the changes in system occur quite frequently.

    e.g

    IMyResult  SomeComplexMethod(IMyParameters parameters);

    Where you can add different parameters to IMyParameters interface.

    Now as long as the operation contract remains unchanged , you don't even need to build your service.Just do changes on service side , keep adding as many parameters as you want on service side.You might need some checks though but still it is a good solution.

    Please mark this as "Answer" if it resolves your problem

    Thanks,

    BR,

    JollyWagoner


    Tuesday, February 5, 2013 4:54 PM