簡體   English   中英

將WebService屬性添加到使用CodeDom生成的類

[英]Add WebService attributes to a class generated with CodeDom

我正在使用CodeDom為ASMX Web服務生成c-sharp類,但是在將Web服務屬性添加到該類時遇到了問題。 我正在嘗試獲得以下最終結果:

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

CodeTypeDeclaration具有屬性CustomAttributes 如果在此添加CodeAttributeDeclaration ,則應該沒問題。 有關更多信息,請參見http://msdn.microsoft.com/zh-cn/library/system.codedom.codeattributedeclaration.aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM