0
我收到錯誤 「最佳重載的方法匹配具有一些無效參數」最佳重載方法匹配有一些無效參數Asp.net Wcf?
我的代碼,
System.Collections.Generic.List<ConsultantShares> consultantShareList = (Session["ProjectShare"] as List<ConsultantShares>);
CIService.CIServiceClient client = new CIService.CIServiceClient();
client.GetConsultantScoreAsync(consultantShareList,this.txtProjectId.Text,this.ddlWorkClass.SelectedValue);
client.GetConsultantScoreCompleted += new EventHandler<CIService.GetConsultantScoreCompletedEventArgs>(client_GetConsultantScoreCompleted);
錯誤列表作爲,
Error 196 The best overloaded method match for
'CIService.CIServiceClient.GetConsultantScoreAsync(InspectionServices.ConsultantShares[], string, string)'
has some invalid arguments G:\Design Scoring\InspectionEvaluation\Summary.aspx.cs 32
9 G:\Design Scoring\InspectionEvaluation\
Error 197 Argument 1: cannot convert from 'System.Collections.Generic.List<InspectionServices.ConsultantShares>'
to 'InspectionServices.ConsultantShares[]' G:\Design Scoring\InspectionEvaluation\Summary.aspx.cs 32
40 G:\Design Scoring\InspectionEvaluation\
,而我有以下的,
in
namespace CIService
{
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
[DebuggerStepThrough]
public class CIServiceClient : ClientBase<ICIService>, ICIService
{
public void GetConsultantScoreAsync(ConsultantShares[] cs, string targetProjectId, string workclass);
public void GetConsultantScoreAsync(ConsultantShares[] cs, string targetProjectId, string workclass, object userState);
}
}
分
的希望您的建議
感謝
編輯:
得到錯誤的
Error 30 The type or namespace name 'InventoryProject' does not exist in the namespace 'CIService' (are you missing an assembly reference?) G:\Design Scoring\InspectionEvaluation\ProjectDetails.aspx.cs 108 23 G:\Design Scoring\InspectionEvaluation\
CIService.InventoryProject invProject =新CIService.InventoryProject();
而CIService
public InventoryProject GetInventoryProjectDetail(string consultantId, string projectId)
{
ProjectService prjService = new ProjectService();
return prjService.GetInventoryProjectDetail(consultantId, projectId);
}
public List<InventoryProject> GetProjectsByConsultant(string consultantId, int currentPageNumber, int pageSize)
{
ProjectService prjService = new ProjectService();
return prjService.GetProjectsByConsultant(consultantId, currentPageNumber, pageSize);
}
而CIService是我的WCF服務和InventoryProject.datasource是其的DatabaseManager dll是使用這個WCF項目,但其他一些項目,爲什麼它不recognizsing 「inventoryproject」
希望你的幫助
非常感謝你的建議幫助我很多! – 2013-04-25 06:51:18
還有一件事我想問,我得到的錯誤就像它一樣 – 2013-04-25 06:52:22
@testerJoe,請確保您的Web方法正在接受相同類型的參數,無論是列表還是數組。這將是更簡單的你通過代理 – Habib 2013-04-25 06:53:36