using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.Serialization; namespace Entity { [DataContract] public class User { [DataMember] public string Name { get; set; } [DataMember] public int Age { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using Entity; namespace JQuery.Handler { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class UserService1 : System.Web.Services.WebService { [WebMethod] public string ComplexType(User hero,List users) { return hero.Name " has " users.Count " people!"; } } }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn