开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜