首页 新闻 会员 周边

asp.net调用web service不通过添加web引用的方式怎么调用

0
[已关闭问题] 关闭于 2011-05-28 14:47

在网上看到通过这样的方式怎么调用呢

System.Net.WebClient wc = new System.Net.WebClient(); 

  System.IO.Stream stream = wc.OpenRead(url+"?WSDL"); 
 
System.Web.Services.Description.ServiceDescription sd =
System.Web.Services.Description.ServiceDescription.Read(stream); 
 
System.Web.Services.Description.ServiceDescriptionImporter sdi = new
System.Web.Services.Description.ServiceDescriptionImporter(); 
 
sdi.AddServiceDescription(sd,"",""); 
  System.CodeDom.CodeNamespace cn =
new System.CodeDom.CodeNamespace(@namespace); 
 
System.CodeDom.CodeCompileUnit ccu = new System.CodeDom.CodeCompileUnit(); 

  ccu.Namespaces.Add(cn); 
  sdi.Import(cn,ccu); 


请详细说说这种方式是怎么调用的

999999999999999的主页 999999999999999 | 初学一级 | 园豆:3
提问于:2011-05-18 22:55
< >
分享
所有回答(1)
0

其实就是动态的调用啊,用codedom去动态编译而已嘛。你有啥不明白的

Vincent Yang | 园豆:573 (小虾三级) | 2011-05-19 06:37
请问详细怎么实现呢
支持(0) 反对(0) 999999999999999 | 园豆:3 (初学一级) | 2011-05-19 19:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册