这可能很容易,但我在这里要做的是,我试图将客户对象传递给Web服务方法。 Customer类位于Entity名称空间中,并且它是可序列化的,我将添加对ASP.NET应用程序的引用,该应用程序调用Web服务并传递Entity.Customer对象,并且还在接受Enity.Customer对象的WebService中传递。在ASP.NET Web服务上传递实体
Web服务方法
[WebMethod]
public void AddCustomer(Entity.Customer c)
{}
ASP.NET的applcation
Entity.Customer c = new Entity.Customer;
webservice.AddCustomer(c);
错误
为“TestApplication.localhost.Service1.AddCustomer的最佳重载的方法匹配(TestApplication.localhost.Customer )'有一些无效参数
I tri编辑将Web服务更改为接受Object并稍后将该对象投射到Customer.Entity,应用程序编译但我收到了XML生成错误。
你可以按F12去定义生成的AddCustomer方法并在这里粘贴声明吗? – popester 2009-10-24 19:19:18