protected void btnSave_Click(object sender, EventArgs e) { if (txturl.Text != null) { Random r = new Random(DateTime.Now.Millisecond);// We generate the reference id for the user. With web service you will pass this yourself int refid = r.Next(); //ServiceReference1.ScreenNailerServiceClient svc = new ServiceReference1.ScreenNailerServiceClient(); //svc.CreateScreenCompleted += new EventHandler<ServiceReference1.CreateScreenCompletedEventArgs>(GetCallback); //svc.CreateScreenAsync(new CreateScreenRequest() { Url = txturl.Text, ReferenceId = refid }); Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse> ws = new Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse>(); CreateScreenResponse response = ws.MakeRequest(ConfigurationManager.AppSettings["url"] + "/" + "CreateScreen", new CreateScreenRequest() { ReferenceId = refid, Url = txturl.Text }); string error = ""; if (response.Success) { error = response.Success.ToString(); } else { error = response.ErrorCode + response.Success.ToString(); } //lblresponse.Text = " Reference ID: " + refid + " Status: " + error; //Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse> ws = new Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse>(); //ws.MakeRequestAsync( // ConfigurationManager.AppSettings["url"] + "/" + "CreateScreen", // new CreateScreenRequest() { ReferenceId = refid, Url = txturl.Text }, // (response) => { // string error = ""; // if (response.Success) // { // error = response.Success.ToString(); // } // else // { // error = response.ErrorCode + response.Success.ToString(); // } // lblresponse.Text = " Reference ID: " + refid + " Status: " + error; // }); } }
protected void btnSave_Click(object sender, EventArgs e) { if (txturl.Text != null) { Random r = new Random(DateTime.Now.Millisecond);// We generate the reference id for the user. With web service you will pass this yourself int refid = r.Next(); //ServiceReference1.ScreenNailerServiceClient svc = new ServiceReference1.ScreenNailerServiceClient(); //svc.CreateScreenCompleted += new EventHandler<ServiceReference1.CreateScreenCompletedEventArgs>(GetCallback); //svc.CreateScreenAsync(new CreateScreenRequest() { Url = txturl.Text, ReferenceId = refid }); Booky.WebServices.Common.WebServices <CreateScreenRequest, CreateScreenResponse> ws = new Booky.WebServices.Common.WebServices <CreateScreenRequest, CreateScreenResponse>(); CreateScreenResponse response = ws.MakeRequest(ConfigurationManager.AppSettings["url"] + "/" + "CreateScreen", new CreateScreenRequest() { ReferenceId = refid, Url = txturl.Text }); string error = ""; if (response.Success) { error = response.Success.ToString(); } else { error = response.ErrorCode + response.Success.ToString(); } //lblresponse.Text = " Reference ID: " + refid + " Status: " + error; //Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse> ws = new Booky.WebServices.Common.WebServices<CreateScreenRequest, CreateScreenResponse>(); //ws.MakeRequestAsync( // ConfigurationManager.AppSettings["url"] + "/" + "CreateScreen", // new CreateScreenRequest() { ReferenceId = refid, Url = txturl.Text }, // (response) => { // string error = ""; // if (response.Success) // { // error = response.Success.ToString(); // } // else // { // error = response.ErrorCode + response.Success.ToString(); // } // lblresponse.Text = " Reference ID: " + refid + " Status: " + error; // }); } }