views:

10

answers:

1

I am using CodeDom to generate the c-sharp class for an ASMX webservice, but I'm having trouble adding the web service attributes to the class. I am trying to get the following end-result:

[WebService(Namespace = "http://schemas.me.com/mywebservice/", Name = "MyWebService")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyWebService : WebService
{
}
A: 

The CodeTypeDeclaration has a property CustomAttributes. If you add a CodeAttributeDeclaration to this, you should be fine. See http://msdn.microsoft.com/en-us/library/system.codedom.codeattributedeclaration.aspx for more information.

Pieter