//htp://localhost:56012/json/oneway/UserRequestDTO/1 //htp://localhost:56012/xml/oneway/UserRequestDTO/1 public object Get(UserRequestDTO req) { UserResponseDTO _resp; switch (req.Id) { case 1: _resp = new UserResponseDTO { Name = "Asif", Age = 22, City = "Sydney" }; break; case 2: _resp = new UserResponseDTO { Name = "Peter", Age = 44, City = "USA" }; break; case 3: _resp = new UserResponseDTO { Name = "Tom", Age = 32, City = "Delhi" }; break; default: _resp = new UserResponseDTO { Name = "Ram", Age = 12, City = "Mumbai" }; break; } return(_resp); }
//htp://localhost:56012/json/oneway/UserRequestDTO/1 //htp://localhost:56012/xml/oneway/UserRequestDTO/1 public object Get(UserRequestDTO req) { UserResponseDTO _resp; switch (req.Id) { case 1: _resp=new UserResponseDTO{Name="Asif",Age=22, City="Sydney"}; break; case 2: _resp=new UserResponseDTO{Name="Peter",Age=44, City="USA"}; break; case 3: _resp=new UserResponseDTO{Name="Tom",Age=32, City="Delhi"}; break; default: _resp=new UserResponseDTO{Name="Ram",Age=12, City="Mumbai"}; break; } return _resp; }