using System; namespace kloudServices { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IUserService" in both code and config file together. [ServiceContract] public interface IUserService { [OperationContract] [WebInvoke(UriTemplate = "GetXml", Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml)] GetUserResponse Get(GetUserRequest Getuserrequest); } }
<pre lang="xml">using System; namespace KloudServices { [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class UserService { public GetUserResponse Get(GetUserRequest Getuserrequest) { GetUserResponse Getuserresponse = new GetUserResponse(); try { Getuserresponse = UserBLL.Get(Getuserrequest); } catch (BaseException ex) { throw new FaultException(ex.Summary); } return Getuserresponse; } } }
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"> <serviceActivations> <add service="Service.UserService" relativeAddress="UserService.svc"/> </serviceActivations> </serviceHostingEnvironment>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)