我正在使用CodeDom为ASMX Web服务生成c-sharp类,但是我在向类添加Web服务属性时遇到了麻烦。我想得到以下最终结果:
[WebService(Namespace = "http://schemas.me.com/mywebservice/", Name = "MyWebService")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MyWebService : WebService
{
}
答案 0 :(得分:0)
CodeTypeDeclaration
有一个属性CustomAttributes
。如果您为此添加CodeAttributeDeclaration
,那么您应该没问题。有关详细信息,请参阅http://msdn.microsoft.com/en-us/library/system.codedom.codeattributedeclaration.aspx。