public void WhenDeleteSubscriptionWithUnknownId_ThenThrowsNotFound() { Assert.That(() => client.Delete(new DeleteSubscription { Id = DataFormats.CreateEntityIdentifier() }), ThrowsWebServiceException.WithStatusCode(HttpStatusCode.NotFound)); }
public void TestServiceStackREST() { client = new JsonServiceClient(Environment.ServiceUrl); Environment.Log.Info("TestServiceStackREST"); ProductDTO product1 = new ProductDTO(); product1.RefCode = ProductRef1; product1.Caption = ProductCaption1; ProductRequest prq1 = new ProductRequest(); prq1.ProductDTO = product1; ProductResponse prr1 = client.Post <ProductResponse>("/ProductService", prq1); Assert.IsFalse(prr1.CommitResult.HasError, prr1.CommitResult.Message); product1 = prr1.ProductDTO; Assert.AreNotEqual(0, product1.Id, "Invalid Id"); Environment.Log.InfoFormat("1: product1.Id: {0}", product1.Id); ProductResponse prr2 = client.Delete <ProductResponse>(String.Format("/ProductService/Id/{0}", product1.Id)); Assert.IsFalse(prr2.CommitResult.HasError, prr2.CommitResult.Message); ProductDTO product2 = new ProductDTO(); product2.RefCode = ProductRef2; product2.Caption = ProductCaption2; UnitOfWorkDTO uow = new UnitOfWorkDTO(); uow.Save(product2); Environment.Log.InfoFormat("1: product2.Id: {0}", product2.Id); PersistenceRequest pr2 = new PersistenceRequest(); pr2.UnitOfWork = uow; PersistenceResponse ps2 = client.Post <PersistenceResponse>("/Persistence", pr2); Assert.IsFalse(ps2.CommitResult.HasError, ps2.CommitResult.Message); ps2.UpdatedObjects.Update <ProductDTO>(ref product2); Assert.AreNotEqual(0, product2.Id, "Invalid Id"); ProductResponse prr3 = client.Get <ProductResponse>("/ProductService/Id/" + product2.Id); Assert.IsNotNull(prr3.ProductDTO); ProductListResponse prodList = client.Get <ProductListResponse>("/ProductService"); foreach (ProductDTO prod in prodList.ProductDTOList) { if (prod.RefCode == ProductRef1 || prod.RefCode == ProductRef2) { client.Delete <ProductResponse>(String.Format("/ProductService/Id/{0}", prod.Id)); } } client.Dispose(); }
/// <summary> /// Delete an issue. /// If the issue has subtasks you must set the parameter <see cref="deleteSubtasks"/> to delete the issue. You cannot delete an issue without its subtasks also being deleted. /// </summary> /// <param name="issueKey">The unique key of the issue to delete.</param> /// <param name="deleteSubtasks">Must be set to true if the issue has subtasks.</param> /// <exception cref="WebServiceException">The requested issue is not found, or the user does not have permission to delete it.</exception> public void DeleteIssue(string issueKey, bool deleteSubtasks) { var qb = new UriBuilder(client.BaseUri); qb.Path = qb.Path.AppendPath("issue", issueKey); qb.AppendQuery("deleteSubtasks", deleteSubtasks.ToString().ToLower()); client.Delete <JsonObject>(qb.Uri.ToString()); }
public PostDeletePatientNoteResponse DeletePatientNote(PostDeletePatientNoteRequest request) { PostDeletePatientNoteResponse response = new PostDeletePatientNoteResponse(); try { IRestClient client = new JsonServiceClient(); string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Note/{5}/Delete", DDPatientNoteUrl, "NG", request.Version, request.ContractNumber, request.PatientId, request.Id), request.UserId); //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Note/{Id}/Delete", "DELETE")] DeletePatientNoteDataResponse ddResponse = client.Delete <DeletePatientNoteDataResponse>(url); if (ddResponse != null && ddResponse.Deleted) { response.Version = ddResponse.Version; } return(response); } catch (WebServiceException ex) { throw ex; } }
void Test12(JsonServiceClient client) { Console.WriteLine("~~~~~ DeleteUser (newuser3) ~~~~~~~~~"); UserResponse response = client.Delete<XamarinEvolveSSLibrary.UserResponse>("User/newuser3"); Console.WriteLine("Expected null: " + response.Exception); Console.WriteLine(); }
public DeletePatientUtilizationResponse DeletePatientUtilization(DeletePatientUtilizationRequest request) { try { var result = new DeletePatientUtilizationResponse(); //[Route("/{Context}/{Version}/{ContractNumber}/Patient/{PatientId}/Notes/Utilization/{Id}", "GET")] IRestClient client = new JsonServiceClient(); var url = Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Notes/Utilizations/{5}", DdPatientNoteUrl, "NG", request.Version, request.ContractNumber, request.PatientId, request.Id), request.UserId); DeletePatientUtilizationDataResponse ddResponse = client.Delete <DeletePatientUtilizationDataResponse>(url); if (ddResponse != null) { result.Success = true; } return(result); } catch (WebServiceException ex) { throw ex; } }
public ActionResult CancelAttent(Guid AttentUser) { View_Simple_User vsu = uc.View_Simple_User.SingleOrDefault(u => u.userid == AttentUser); if (vsu != null) { UCHome_Attention attent = uc.UCHome_Attention.FirstOrDefault(u => u.AddUser == userid && u.AttenUser == vsu.userid); if (attent != null) { uc.UCHome_Attention.DeleteObject(attent); uc.SaveChanges(); var client1 = new JsonServiceClient(http + "/SNSApi/"); DeleteAddrBook book = new DeleteAddrBook { GroupID = user.userid.ToString(), UID = vsu.userid.ToString() }; client1.Delete(book); } return(Json(true, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); }
public DeleteCareTeamMemberDataResponse DeleteCareTeamMember(DeleteCareTeamMemberRequest request) { var response = new DeleteCareTeamMemberDataResponse(); try { IRestClient client = new JsonServiceClient(); //[Route("/{Version}/{ContractNumber}/Contacts/{ContactId}/CareTeams/{CareTeamId}/CareTeamMembers/{Id}", "DELETE")] string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Contacts/{4}/CareTeams/{5}/CareTeamMembers/{6}", DDContactServiceUrl, "NG", request.Version, request.ContractNumber, request.ContactId, request.CareTeamId, request.Id), request.UserId); var dataDomainResponse = client.Delete <DeleteCareTeamMemberDataResponse>(url); if (dataDomainResponse != null) { response.Version = dataDomainResponse.Version; response.Status = dataDomainResponse.Status; } } catch (WebServiceException wse) { throw new WebServiceException("AD:DeleteCareTeamMember()::" + wse.Message, wse.InnerException); } return(response); }
public bool DeleteInterventionRequest(PostDeletePatientGoalRequest request, string id) { try { bool result = false; IRestClient client = new JsonServiceClient(); string url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/Patient/{4}/Goal/{5}/Intervention/{6}/Delete/", DDPatientGoalsServiceUrl, "NG", request.Version, request.ContractNumber, request.PatientId, request.PatientGoalId, id), request.UserId); DeleteInterventionDataResponse response = client.Delete <DeleteInterventionDataResponse>( url); if (response != null) { result = true; } return(result); } catch (WebServiceException ex) { throw new WebServiceException("AD:DeleteInterventionRequest()::" + ex.Message, ex.InnerException); } }
public void DeleteOnEachEndpoint <TRes>(string relativePathOrAbsoluteUri, Action <TRes> validate) { using (var xmlClient = new XmlServiceClient(BaseUrl)) using (var jsonClient = new JsonServiceClient(BaseUrl)) using (var jsvClient = new JsvServiceClient(BaseUrl)) { var xmlResponse = xmlClient.Delete <TRes>(relativePathOrAbsoluteUri); if (validate != null) { validate(xmlResponse); } var jsonResponse = jsonClient.Delete <TRes>(relativePathOrAbsoluteUri); if (validate != null) { validate(jsonResponse); } var jsvResponse = jsvClient.Delete <TRes>(relativePathOrAbsoluteUri); if (validate != null) { validate(jsvResponse); } } }
/// <summary> /// 删除评论 /// </summary> /// <param name="cid">评论ID</param> /// <returns></returns> public JsonResult DeleteComments(string fid, string cid) { bool result = false; try { var client1 = new JsonServiceClient(http + "/SNSApi/"); DeleteComment comment = new DeleteComment { FId = new Guid(fid), CID = cid }; client1.Delete(comment); result = true; } catch (Exception) { throw; } return(Json(result, JsonRequestBehavior.AllowGet)); }
public void WhenDeleteSubscription_ThenThrowsForbidden() { Assert.That(() => client.Delete(new DeleteSubscription { Id = DataFormats.CreateEntityIdentifier() }), ThrowsWebServiceException.WithStatusCode(HttpStatusCode.Forbidden)); }
public void Can_view_create_and_delete_TODOs_over_REST() { var restClient = new JsonServiceClient("http://localhost:37022/"); var all = restClient.Get <List <Todo> >("/todos"); Assert.That(all.Count, Is.EqualTo(0)); var todo = restClient.Post <Todo>("/todos", new Todo { Content = "New TODO", Order = 1 }); Assert.That(todo.Id, Is.GreaterThan(0)); Assert.That(todo.Content, Is.EqualTo("New TODO")); all = restClient.Get <List <Todo> >("/todos"); Assert.That(all.Count, Is.EqualTo(1)); todo.Content = "Updated TODO"; todo = restClient.Post <Todo>("/todos", todo); Assert.That(todo.Content, Is.EqualTo("Updated TODO")); restClient.Delete <Todo>("/todos/" + todo.Id); all = restClient.Get <List <Todo> >("/todos"); Assert.That(all.Count, Is.EqualTo(0)); }
static void ExecuteJson() { var client = new JsonServiceClient("http://*****:*****@email.com" }; ClientResponse response = client.Post <ClientResponse>(createRequest); var updateRequest = new UpdateClientRequest { Email = "*****@*****.**", Id = response.Id }; response = client.Put <ClientResponse>(updateRequest); var getClientRequest = new GetClientRequest { Id = response.Id }; response = client.Get <ClientResponse>(getClientRequest); var deleteRequest = new DeleteClientRequest { Id = response.Id }; client.Delete(deleteRequest); }
public JsonResult RemoveMyBook(string removeUserId) { var reUserId = new Guid(removeUserId); UCHomeBasePage ucbBasePage = new UCHomeBasePage(); Guid adduser = user.userid; UCHomeEntities uc = new UCHomeEntities(); View_Simple_User vsu = uc.View_Simple_User.SingleOrDefault(u => u.userid == reUserId); if (vsu != null) { UCHome_Attention attent = uc.UCHome_Attention.FirstOrDefault(u => u.AddUser == adduser && u.AttenUser == vsu.userid); if (attent != null) { uc.UCHome_Attention.DeleteObject(attent); uc.SaveChanges(); var client1 = new JsonServiceClient(http + "/SNSApi/"); DeleteAddrBook book = new DeleteAddrBook { GroupID = user.userid.ToString(), UID = vsu.userid.ToString() }; client1.Delete(book); } return(Json(true, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); }
public void Can_send_ReturnVoid() { var sentMethods = new List <string>(); var client = new JsonServiceClient(Config.BaseUrl) { RequestFilter = req => sentMethods.Add(req.Method) }; var request = new SendReturnVoid { Id = 1 }; client.Send(request); Assert.That(sentMethods[sentMethods.Count - 1], Is.EqualTo(HttpMethods.Post)); request.Id = 2; client.Get(request); Assert.That(sentMethods[sentMethods.Count - 1], Is.EqualTo(HttpMethods.Get)); request.Id = 3; client.Post(request); Assert.That(sentMethods[sentMethods.Count - 1], Is.EqualTo(HttpMethods.Post)); request.Id = 4; client.Put(request); Assert.That(sentMethods[sentMethods.Count - 1], Is.EqualTo(HttpMethods.Put)); request.Id = 5; client.Delete(request); Assert.That(sentMethods[sentMethods.Count - 1], Is.EqualTo(HttpMethods.Delete)); }
public void TryLogin() { using(var tempDb = new TempFile()) { //GlobalProxySelection.Select = new WebProxy("127.0.0.1", 8888); // proxy via Fiddler2. using (var server = new Server() { Port = 8000, SqliteFile = tempDb.Path }) { server.Start(); // log in var restClient = new JsonServiceClient(FakeServer.BaseUri); var response = restClient.Post<AuthResponseEx>( "/api/auth/credentials?format=json", new Auth() { UserName = "******", Password = "******", RememberMe = true }); response.SessionId.ShouldMatch(@"[a-zA-Z0-9=+/]{20,100}"); response.UserName.ShouldBe("tech"); response.UserId.ShouldMatch(@"^[a-zA-Z0-9_-]{8}$"); // log out var logoutResponse = restClient.Delete<AuthResponse>("/api/auth/credentials?format=json&UserName=tech"); logoutResponse.SessionId.ShouldBe(null); // can't come up with a good way to verify that we logged out. } } }
private void RemoveAllContainers() { // Cleanup anything left over in the database var response = _client.Get(new ContainerQuery()); foreach (var container in response.Containers) { _client.Delete(container); } }
private void Delete_Click(object sender, EventArgs e) { if (CurrentId == default(long)) return; var client = new JsonServiceClient(BaseUrl); client.Delete(new Customer {Id = CurrentId}); RefereshCustomerList(); }
public void Can_DELETE_Reqstar() { var response = client.Delete <EmptyResponse>("/reqstars/1/delete"); var reqstarsLeft = db.Select <Reqstar>(); Assert.That(reqstarsLeft.Count, Is.EqualTo(Reqstar.SeedData.Length - 1)); }
public ActionResult Delete(Models.Translation model) { using (var client = new JsonServiceClient()) { var deleteUrl = new Uri(Request.Url, string.Format("/api/translation/{0}/{1}", model.Alpha2, model.Language)); var response = client.Delete<Api.Messages.TranslationResponse>(deleteUrl.ToString()); } return Redirect("Index"); }
public void DeleteProduct_RequiresAuth() { var client = new JsonServiceClient(TestAppHost.BaseUri); var exception = Assert.Throws <WebServiceException>(() => client.Delete(new DeleteProduct { Id = 10000 })); Assert.AreEqual(401, exception.StatusCode); }
public void TestAllBookingMethods() { IRestClient client = new JsonServiceClient(ConfigurationManager.AppSettings["host"]); var startDate = DateTime.Now; var newBooking = client.Post(new CreateBookingRequest { CafeID = 1, StartDate = startDate, EndDate = startDate.AddMinutes(60), PersonID = 58, NoOfPeople = 2 }); List <Booking> bookingOnCustomer = client.Get(new GetAllBookingsOnCustomerIDRequest { ID = 58 }); Assert.IsNotNull(bookingOnCustomer.Count); Booking bookingWithID = new Booking(); foreach (var booking in bookingOnCustomer) { if (booking.StartDate == newBooking.StartDate) { bookingWithID = booking; } } var bookingByID = client.Get(new GetBookingByIDRequest { ID = bookingWithID.ID }); Assert.IsNotNull(bookingByID.StartDate); List <Booking> allBookingsOnCafe = client.Get(new GetAllCafeBookingsRequest { CafeID = 1 }); Assert.IsNotNull(allBookingsOnCafe.Count); newBooking.StartDate = DateTime.Now; client.Put(new UpdateBookingRequest { ID = bookingWithID.ID, StartDate = newBooking.StartDate, EndDate = newBooking.StartDate.AddMinutes(60), }); Assert.AreNotSame(newBooking.StartDate, bookingWithID.StartDate); client.Delete(new DeleteBookingRequest { ID = bookingWithID.ID }); }
public void WhenISendDeleteRequestByIdThruDeleteAction(int id) { var request = new DeleteOrderById { Id = id }; JsonServiceClient client = GetClient(); client.Delete(request); }
public void WhenISendDeleteRequestByIdThruDeleteWithResponseAction(int id) { var request = new DeleteOrderById { Id = id }; JsonServiceClient client = GetClient(); var response = client.Delete <bool>(request); ScenarioContext.Current[ResopnseKey] = response; }
public ActionResult DeleteBookingConfirmation(int id) { JsonServiceClient client = new JsonServiceClient(ConfigurationManager.AppSettings["Client"]); client.Delete(new DeleteBookingRequest { Id = id }); ViewBag.Delete = id; return(View()); }
/// <summary> /// Deletes a project component. /// </summary> /// <param name="componentUri">The URI of the component to delete.</param> /// <param name="moveIssueToComponentUri">Any issues assigned to the component being deleted will be moved to the specified component.</param> /// <exception cref="WebServiceException">The caller is not logged in and does not have permission to delete the component.</exception> public void RemoveComponent(Uri componentUri, Uri moveIssueToComponentUri) { var qb = new UriBuilder(componentUri); if (moveIssueToComponentUri != null) { qb.AppendQuery("moveIssuesTo", moveIssueToComponentUri.ToString()); } client.Delete <JsonObject>(qb.Uri.ToString()); }
private static void Main() { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // PerformanceTest(); var client = new JsonServiceClient(Settings.Default.ServiceAddress); var createRequest = new CreateClientRequest { Email = "*****@*****.**" }; var response = client.Post <ClientResponse>(createRequest); Console.WriteLine("POST Response: {0}\n", response); var updateRequest = new UpdateClientRequest { Email = "*****@*****.**", Id = response.Id }; response = client.Put <ClientResponse>(updateRequest); Console.WriteLine("PUT Response: {0}\n", response); var getClientRequest = new GetClientRequest { Id = response.Id, Date = DateTime.Now.Date }; response = client.Get <ClientResponse>(getClientRequest); Console.WriteLine("GET Response: {0}\n", response); var deleteRequest = new DeleteClientRequest { Id = response.Id }; client.Delete(deleteRequest); var certificate = new MemoryStream(File.ReadAllBytes("Certificate.cer")); var uploadRequest = new UploadRequest { FileContents = certificate.ToArray(), OriginalFileName = "MyFileName.cert", UploaderId = Guid.NewGuid().ToString() }; client.Post(uploadRequest); Console.ReadKey(); }
public void TestAllTableMethods() { IRestClient client = new JsonServiceClient(ConfigurationManager.AppSettings["host"]); List <Table> allTables = client.Get(new GetAllTablesInCafeRequest { ID = 1 }); Assert.IsNotNull(allTables.Count); var newTable = client.Post(new CreateTableRequest { NoOfSeats = 2, TableNumber = 666, CafeID = 1 }); Assert.AreEqual(newTable.TableNumber, 666); allTables = client.Get(new GetAllTablesInCafeRequest { ID = 1 }); var matchedTable = new Table(); foreach (var item in allTables) { if (item.TableNumber == newTable.TableNumber) { matchedTable = item; } } Assert.IsNotNull(matchedTable.ID); matchedTable.NoOfSeats = 22; client.Put(new UpdateTableRequest { ID = matchedTable.ID, NoOfSeats = matchedTable.NoOfSeats, TableNumber = matchedTable.TableNumber }); var tableByID = client.Get(new GetTableByIDRequest { ID = matchedTable.ID }); Assert.AreEqual(tableByID.NoOfSeats, matchedTable.NoOfSeats); client.Delete(new DeleteTableRequest { ID = tableByID.ID }); }
private void Delete_SingleClient(int batchSize) { var timer = new Stopwatch(); timer.Start(); using (var client = new JsonServiceClient(ServiceAddress)) { for (int i = 0; i < batchSize; i++) { client.Delete<DataResponse>(new DataRequest()); } } timer.Stop(); Console.WriteLine("{0} took {1} ms, BatchSize: {2}", "Delete_SingleClient", timer.ElapsedMilliseconds, batchSize); }
/// <summary> /// 删除动态 /// </summary> /// <param name="fid">资源ID</param> /// <returns></returns> public JsonResult DeleteCirle(string fid) { var client1 = new JsonServiceClient(http + "/SNSApi/"); DeleteSNSFeeds like = new DeleteSNSFeeds { FId = new Guid(fid) }; client1.Delete(like); return(Json(like, JsonRequestBehavior.AllowGet)); }
private void Delete_SingleClient(int batchSize) { var timer = new Stopwatch(); timer.Start(); using (var client = new JsonServiceClient(ServiceAddress)) { for (int i = 0; i < batchSize; i++) { client.Delete <DataResponse>(new DataRequest()); } } timer.Stop(); Console.WriteLine("{0} took {1} ms, BatchSize: {2}", "Delete_SingleClient", timer.ElapsedMilliseconds, batchSize); }
public void TestAllAdminMethods() { IRestClient client = new JsonServiceClient(ConfigurationManager.AppSettings["host"]); List <Administrator> allAdmins = client.Get(new GetAllAdminsRequest()); Assert.IsNotNull(allAdmins.Count); var newAdmin = client.Post(new CreateAdminRequest { FName = "CarbTestAdmin", LName = "AdminCarb", PhoneNo = "99887777", Email = "*****@*****.**", }); Assert.AreEqual(newAdmin.FName, "CarbTestAdmin"); var AllOldAdmins = allAdmins; allAdmins = client.Get(new GetAllAdminsRequest()); Assert.AreNotEqual(AllOldAdmins.Count, allAdmins.Count); var admin = client.Get(new GetAdminByPhoneNoRequest { PhoneNo = newAdmin.PhoneNo }); Assert.AreEqual(admin.FName, newAdmin.FName); admin.FName = "TestCarbAdmin"; client.Put(new UpdateAdminRequest { ID = admin.ID, FName = admin.FName, LName = admin.LName, PhoneNo = admin.PhoneNo, Email = admin.Email }); admin = client.Get(new GetAdminByPhoneNoRequest { PhoneNo = admin.PhoneNo }); Assert.AreNotSame(admin.FName, newAdmin.FName); client.Delete(new DeleteAdminRequest { ID = admin.ID }); }
private static void Main() { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // PerformanceTest(); var client = new JsonServiceClient(Settings.Default.ServiceAddress); var createRequest = new CreateClientRequest { Email = "*****@*****.**" }; var response = client.Post<ClientResponse>(createRequest); Console.WriteLine("POST Response: {0}\n", response); var updateRequest = new UpdateClientRequest { Email = "*****@*****.**", Id = response.Id }; response = client.Put<ClientResponse>(updateRequest); Console.WriteLine("PUT Response: {0}\n", response); var getClientRequest = new GetClientRequest { Id = response.Id, Date = DateTime.Now.Date }; response = client.Get<ClientResponse>(getClientRequest); Console.WriteLine("GET Response: {0}\n", response); var deleteRequest = new DeleteClientRequest { Id = response.Id }; client.Delete(deleteRequest); var certificate = new MemoryStream(File.ReadAllBytes("Certificate.cer")); var uploadRequest = new UploadRequest { FileContents = certificate.ToArray(), OriginalFileName = "MyFileName.cert", UploaderId = Guid.NewGuid().ToString() }; client.Post(uploadRequest); Console.ReadKey(); }
public void DeletePatientAllergy(DeletePatientAllergyRequest request) { try { IRestClient client = new JsonServiceClient(); //[Route("/{Context}/{Version}/{ContractNumber}/PatientAllergy/{Id}", "DELETE")] var url = Common.Helper.BuildURL(string.Format("{0}/{1}/{2}/{3}/PatientAllergy/{4}", DDAllergyUrl, "NG", request.Version, request.ContractNumber, request.Id), request.UserId); DeletePatientAllergyDataResponse dataDomainResponse = client.Delete <DeletePatientAllergyDataResponse>(url); } catch (WebServiceException ex) { throw ex; } }
/// <summary> /// Removes selected version, changing the Fix Version(s) and/or Affects Version(s). /// </summary> /// <param name="versionUri">The URI of the version to edit.</param> /// <param name="moveFixIssuesToVersionUri">URI of the version to which issues should have now set their Fix Version(s) field instead of the just removed version.</param> /// <param name="moveAffectedIssuesToVersionUri">The URI of the version to which issues should have now set their Affects Version(s) field instead of the just removed version.</param> /// <exception cref="WebServiceException">If the calling user does not have permission to delete versions in the project.</exception> public void RemoveVersion(Uri versionUri, Uri moveFixIssuesToVersionUri, Uri moveAffectedIssuesToVersionUri) { var qb = new UriBuilder(versionUri); if (moveFixIssuesToVersionUri != null) { qb.AppendQuery("moveFixIssuesTo", moveFixIssuesToVersionUri.ToString()); } if (moveAffectedIssuesToVersionUri != null) { qb.AppendQuery("moveAffectedIssuesTo", moveAffectedIssuesToVersionUri.ToString()); } client.Delete <JsonObject>(qb.Uri.ToString()); }
private static void Main() { var client = new JsonServiceClient("http://localhost:9090/requests"); var presentRequest = new PresentRequest { Id = Guid.NewGuid(), Address = new Address { Country = "sheldonopolis", }, Wish = "Could you please help developers to understand, " + "WCF is awesome only with Nelibur" }; client.Post(presentRequest); var requestQuery = new PresentRequestQuery { Country = "sheldonopolis", Status = PresentRequestStatus.Pending.ToString() }; List<PresentRequest> pendingRequests = client.Get<List<PresentRequest>>(requestQuery); Console.WriteLine("Pending present requests count: {0}", pendingRequests.Count); var updatePresentRequestStatus = new UpdatePresentRequestStatus { Status = PresentRequestStatus.Accepted.ToString() }; client.Post(updatePresentRequestStatus); var deleteByStatus = new DeletePresentRequestsByStatus { Status = PresentRequestStatus.Accepted.ToString() }; client.Delete(deleteByStatus); Console.WriteLine("Press any key for Exit"); Console.ReadKey(); }
private static void Main() { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler; // PerformanceTest(); var client = new JsonServiceClient(Settings.Default.ServiceAddress); var createRequest = new CreateClientRequest { Email = "*****@*****.**" }; var response = client.Post<ClientResponse>(createRequest); Console.WriteLine("POST Response: {0}\n", response); var updateRequest = new UpdateClientRequest { Email = "*****@*****.**", Id = response.Id }; response = client.Put<ClientResponse>(updateRequest); Console.WriteLine("PUT Response: {0}\n", response); var getClientRequest = new GetClientRequest { Id = response.Id, Date = DateTime.Now.Date }; response = client.Get<ClientResponse>(getClientRequest); Console.WriteLine("GET Response: {0}\n", response); var deleteRequest = new DeleteClientRequest { Id = response.Id }; client.Delete(deleteRequest); Console.ReadKey(); }
public void Can_view_create_and_delete_TODOs_over_REST() { var restClient = new JsonServiceClient("http://localhost:37022/"); var all = restClient.Get<List<Todo>>("/todos"); Assert.That(all.Count, Is.EqualTo(0)); var todo = restClient.Post<Todo>("/todos", new Todo { Content = "New TODO", Order = 1 }); Assert.That(todo.Id, Is.GreaterThan(0)); Assert.That(todo.Content, Is.EqualTo("New TODO")); all = restClient.Get<List<Todo>>("/todos"); Assert.That(all.Count, Is.EqualTo(1)); todo.Content = "Updated TODO"; todo = restClient.Post<Todo>("/todos", todo); Assert.That(todo.Content, Is.EqualTo("Updated TODO")); restClient.Delete<Todo>("/todos/" + todo.Id); all = restClient.Get<List<Todo>>("/todos"); Assert.That(all.Count, Is.EqualTo(0)); }
// public static void Удалить(МедицинскиеСтраховыеПолисыЗапрос МедицинскиеСтраховыеПолисыЗапрос) { var Урл = "http://localhost:1337/Справочники/МедицинскиеСтраховыеПолисы?format=json"; var Клиент = new JsonServiceClient(Урл); var МедицинскиеСтраховыеПолисыОтвет = Клиент.Delete(МедицинскиеСтраховыеПолисыЗапрос); }
// public static void Удалить(УсловияПродажЗапрос УсловияПродажЗапрос) { var Урл = "http://localhost:1337/Справочники/УсловияПродаж?format=json"; var Клиент = new JsonServiceClient(Урл); var УсловияПродажОтвет = Клиент.Delete(УсловияПродажЗапрос); }
// public static void Удалить(ТерриториальныеУсловияЗапрос ТерриториальныеУсловияЗапрос) { var Урл = "http://localhost:1337/Справочники/ТерриториальныеУсловия?format=json"; var Клиент = new JsonServiceClient(Урл); var ТерриториальныеУсловияОтвет = Клиент.Delete(ТерриториальныеУсловияЗапрос); }
// public static void Удалить(ПараметрыВыработкиОСЗапрос ПараметрыВыработкиОСЗапрос) { var Урл = "http://localhost:1337/Справочники/ПараметрыВыработкиОС?format=json"; var Клиент = new JsonServiceClient(Урл); var ПараметрыВыработкиОСОтвет = Клиент.Delete(ПараметрыВыработкиОСЗапрос); }
// public static void Удалить(ТСДФорматыДанныхЗапрос ТСДФорматыДанныхЗапрос) { var Урл = "http://localhost:1337/Справочники/ТСДФорматыДанных?format=json"; var Клиент = new JsonServiceClient(Урл); var ТСДФорматыДанныхОтвет = Клиент.Delete(ТСДФорматыДанныхЗапрос); }
// public static void Удалить(СертификатыЭЦПЗапрос СертификатыЭЦПЗапрос) { var Урл = "http://localhost:1337/Справочники/СертификатыЭЦП?format=json"; var Клиент = new JsonServiceClient(Урл); var СертификатыЭЦПОтвет = Клиент.Delete(СертификатыЭЦПЗапрос); }
// public static void Удалить(НоменклатурныеГруппыЗапрос НоменклатурныеГруппыЗапрос) { var Урл = "http://localhost:1337/Справочники/НоменклатурныеГруппы?format=json"; var Клиент = new JsonServiceClient(Урл); var НоменклатурныеГруппыОтвет = Клиент.Delete(НоменклатурныеГруппыЗапрос); }
// public static void Удалить(ДоходыНДФЛЗапрос ДоходыНДФЛЗапрос) { var Урл = "http://localhost:1337/Справочники/ДоходыНДФЛ?format=json"; var Клиент = new JsonServiceClient(Урл); var ДоходыНДФЛОтвет = Клиент.Delete(ДоходыНДФЛЗапрос); }
// public static void Удалить(ВидыНалоговыхОргановЗапрос ВидыНалоговыхОргановЗапрос) { var Урл = "http://localhost:1337/Справочники/ВидыНалоговыхОрганов?format=json"; var Клиент = new JsonServiceClient(Урл); var ВидыНалоговыхОргановОтвет = Клиент.Delete(ВидыНалоговыхОргановЗапрос); }
// public static void Удалить(ЗаявкиКандидатовЗапрос ЗаявкиКандидатовЗапрос) { var Урл = "http://localhost:1337/Справочники/ЗаявкиКандидатов?format=json"; var Клиент = new JsonServiceClient(Урл); var ЗаявкиКандидатовОтвет = Клиент.Delete(ЗаявкиКандидатовЗапрос); }
// public static void Удалить(КлючиАналитикиУчетаПрочихЗатратЗапрос КлючиАналитикиУчетаПрочихЗатратЗапрос) { var Урл = "http://localhost:1337/Справочники/КлючиАналитикиУчетаПрочихЗатрат?format=json"; var Клиент = new JsonServiceClient(Урл); var КлючиАналитикиУчетаПрочихЗатратОтвет = Клиент.Delete(КлючиАналитикиУчетаПрочихЗатратЗапрос); }
// public static void Удалить(ОбщероссийскийКлассификаторПродукцииЗапрос ОбщероссийскийКлассификаторПродукцииЗапрос) { var Урл = "http://localhost:1337/Справочники/ОбщероссийскийКлассификаторПродукции?format=json"; var Клиент = new JsonServiceClient(Урл); var ОбщероссийскийКлассификаторПродукцииОтвет = Клиент.Delete(ОбщероссийскийКлассификаторПродукцииЗапрос); }
// public static void Удалить(СтатьиОборотовПоБюджетамЗапрос СтатьиОборотовПоБюджетамЗапрос) { var Урл = "http://localhost:1337/Справочники/СтатьиОборотовПоБюджетам?format=json"; var Клиент = new JsonServiceClient(Урл); var СтатьиОборотовПоБюджетамОтвет = Клиент.Delete(СтатьиОборотовПоБюджетамЗапрос); }
// public static void Удалить(СпискиПрофессийДолжностейЛьготногоПенсионногоОбеспеченияЗапрос СпискиПрофессийДолжностейЛьготногоПенсионногоОбеспеченияЗапрос) { var Урл = "http://localhost:1337/Справочники/СпискиПрофессийДолжностейЛьготногоПенсионногоОбеспечения?format=json"; var Клиент = new JsonServiceClient(Урл); var СпискиПрофессийДолжностейЛьготногоПенсионногоОбеспеченияОтвет = Клиент.Delete(СпискиПрофессийДолжностейЛьготногоПенсионногоОбеспеченияЗапрос); }
// public static void Удалить(ОбъектыСтроительстваЗапрос ОбъектыСтроительстваЗапрос) { var Урл = "http://localhost:1337/Справочники/ОбъектыСтроительства?format=json"; var Клиент = new JsonServiceClient(Урл); var ОбъектыСтроительстваОтвет = Клиент.Delete(ОбъектыСтроительстваЗапрос); }
// public static void Удалить(СпецификацииНоменклатурыЗапрос СпецификацииНоменклатурыЗапрос) { var Урл = "http://localhost:1337/Справочники/СпецификацииНоменклатуры?format=json"; var Клиент = new JsonServiceClient(Урл); var СпецификацииНоменклатурыОтвет = Клиент.Delete(СпецификацииНоменклатурыЗапрос); }
// public static void Удалить(ТипыСкидокНаценокЗапрос ТипыСкидокНаценокЗапрос) { var Урл = "http://localhost:1337/Справочники/ТипыСкидокНаценок?format=json"; var Клиент = new JsonServiceClient(Урл); var ТипыСкидокНаценокОтвет = Клиент.Delete(ТипыСкидокНаценокЗапрос); }
// public static void Удалить(НастройкиЗаполненияФормЗапрос НастройкиЗаполненияФормЗапрос) { var Урл = "http://localhost:1337/Справочники/НастройкиЗаполненияФорм?format=json"; var Клиент = new JsonServiceClient(Урл); var НастройкиЗаполненияФормОтвет = Клиент.Delete(НастройкиЗаполненияФормЗапрос); }
// public static void Удалить(НастройкиДопроведенияДокументовЗапрос НастройкиДопроведенияДокументовЗапрос) { var Урл = "http://localhost:1337/Справочники/НастройкиДопроведенияДокументов?format=json"; var Клиент = new JsonServiceClient(Урл); var НастройкиДопроведенияДокументовОтвет = Клиент.Delete(НастройкиДопроведенияДокументовЗапрос); }
// public static void Удалить(ПричиныЗакрытияЗаказовЗапрос ПричиныЗакрытияЗаказовЗапрос) { var Урл = "http://localhost:1337/Справочники/ПричиныЗакрытияЗаказов?format=json"; var Клиент = new JsonServiceClient(Урл); var ПричиныЗакрытияЗаказовОтвет = Клиент.Delete(ПричиныЗакрытияЗаказовЗапрос); }
// public static void Удалить(РасходыБудущихПериодовЗапрос РасходыБудущихПериодовЗапрос) { var Урл = "http://localhost:1337/Справочники/РасходыБудущихПериодов?format=json"; var Клиент = new JsonServiceClient(Урл); var РасходыБудущихПериодовОтвет = Клиент.Delete(РасходыБудущихПериодовЗапрос); }