访问web服务


下面是访问web的一个程序 大概样子
其中ReportingService2005 rs = new ReportingService2005();这个创建的实例是怎么回事
“未能找到类型或命名空间名称 reportingService2005 是什么??????”
人太浅薄
 
using System;
using GetPropertiesSample.ReportService2005;

static void Main(string[] args)
{   
   ReportingService2005 rs = new ReportingService2005(); 
     rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  
   rs.Url = http://<Server Name>/reportserver/reportservice2005.asmx;
   Property name = new Property();   name.Name = "Name";  
   Property description = new Property();   
   description.Name = "Description";  
   Property[] properties = new Property[2]; 
   properties[0] = name;   properties[1] = description;  
 try   {    
             Property[] returnProperties = rs.GetProperties(  "/AdventureWorks 2008 Sample Reports/Company Sales 2008",properties);    
     foreach (Property p in returnProperties)     
 {         
Console.WriteLine(p.Name + ": " + p.Value);   
   }   
}   catch (Exception e)   
  {    
  Console.WriteLine(e.Message);  
 }
}
千巷猫影
浏览 311回答 1
1回答

四季花海

如果你建立的ReportService2005是个项目GetPropertiesSample里的类,不能用using GetPropertiesSample.ReportService2005;应该为using GetPropertiesSample; 如果你确定GetPropertiesSample.ReportService2005是个命名空间的话,要保证空间里有ReportService2005这个类, 不知道项目里是否添加了引用GetPropertiesSample.ReportService2005  
打开App,查看更多内容
随时随地看视频慕课网APP