views:

40

answers:

1

Aloha

I'm referencing an external webservice in my .NET 2.0 application. Adding a service reference generated a nice proxy class for me. I'd like to add ///<summary> style documentation to this. If the service reference is updated, all my shiny comments are gone.

Is there any solution to this?

-Edoode

+1  A: 

You could create a wrapper class around the generated proxy class, and document the methods there. Then instead of using the generated proxy directly, you always use your wrapper class. E.g:

public class MyWebServiceWrapper
{
  private MyWebService _service = null;

  public MyWebServiceWrapper()
  {
    _service = new MyWebService();
  }

  ///<summary>
  /// doc goes here
  ///<summary>
  public int MethodOne()
  {
    return _service.MethodOne();
  }
}

This approach allows you to re-generate the proxy class whenever required.

Of course this means, that you will have to (manually) update the wrapper class whenever the interface of the web service changes. On the other hand, the wrapper class also allows you to add some centralized error handling, etc.

M4N
Nice.. I think I'll try that. It would mean rewriting the calling code though
edosoft