Add WebService attributes to a class generated with CodeDom
I am using CodeDom to generate the c-sharp class for an ASMX webservice, but I'm having trouble adding the web service attributes 开发者_C百科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
{
}
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.
精彩评论