Now finally we consume the WCF service in our web application, remember here we just need to give the refference of
 | Service sample |
| using ProxyService.Module1;
| | 1:using BusinessEntity;
| | 2:namespace WebClient
| | 3:{
| | 4: public partial class Default : System.Web.UI.Page
| | 5: {
| | 6: protected void Page_Load(object sender, EventArgs e)
| | 7: {
| | 8: if (!IsPostBack)
| | 9: {
| | 10: GetRoomInfo(1);
| | 11: }
| | 12: }
| | 13:
| | 14: void GetRoomInfo(int RoomId)
| | 15: {
| | 16: ServiceProxy _proxy = new ServiceProxy();
| | 17: Room obj = _proxy.GetRoom(RoomId);
| | 18: lblMessage.Text = obj.RoomName;
| | 19:
| | 20: obj = null;
| | 21: _proxy = null;
| | 22: }
| | 23: }
| | 24:}
| | 25: |
|