OData / odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
https://docs.microsoft.com/odata
Other
685 stars 349 forks source link

DataserviceCollection adding related objects #2077

Open slnetgit opened 3 years ago

slnetgit commented 3 years ago

When adding a related Entity which is already in database to a new unsaved Entity in Dataservicecontext ( WCF Odata V3 and OData WebApi V4 - no difference ) there is a Problem when this entity is set to null again - for example during editing . I found this in our Wcf OData V3 Application and also in latest Client of V4

         Container c1 = new Container(new Uri("http://localhost:63250/"));
        var g1 = c1.Gesellschaftsform.FirstOrDefault();
        DataServiceCollection<Firma> coll = new DataServiceCollection<Firma>(c1);

       // create new entity  and add to collection 
        var neu = new Firma();
        neu.Bezeichnung = "new company";
        neu.Kommentar = "Test";
        coll.Add(neu);

        // assigning related entity , adds a link in status modified ?? to the dataservicecontext 
        neu.Gesellschaftsform = g1;
        neu.GesellschaftsformId = g1.Id; // still needed even in latest version ??

        // the problem : user decides not to assign the related object 
       // if the nex two lines are commented, this will work , uncommented this leads to an exception 
        neu.GesellschaftsformId=null;   
        neu.Gesellschaftsform = null;

        // try to save the changes 
        c1.SaveChanges(SaveChangesOptions.BatchWithSingleChangeset);

Assemblies affected

packages\Microsoft.OData.Client.7.8.3\lib\net45\Microsoft.OData.Client.dll Microsoft.Data.Services.Client.5.8.4

Reproduce steps

See above description

Expected result

Save changes without Exception

Actual result

Exception is thrown in 5.8.4 System.Data.Services.DataServiceException: "Fehler beim Verarbeiten des Anforderungsdatenstroms. Im Batchmodus kann nur bei Bindungs-/Trennvorgängen über Querverweise auf eine Ressource

in Odata V4 also an exception is thron on saving.

System.dll!System.Uri.CreateThis(string uri, bool dontEscape, System.UriKind uriKind) Unbekannt System.dll!System.Uri.Uri(string uriString) Unbekannt Microsoft.AspNet.OData.dll!Microsoft.AspNet.OData.Batch.ODataBatchRequestItem.SendMessageAsync(System.Net.Http.HttpMessageInvoker invoker, System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken, System.Collections.Generic.Dictionary<string, string> contentIdToLocationMapping) Unbekannt Microsoft.Restier.AspNet.dll!Microsoft.Restier.AspNet.Batch.RestierBatchChangeSetRequestItem.SendRequestAsync(System.Net.Http.HttpMessageInvoker invoker, System.Threading.CancellationToken cancellationToken) Unbekannt Microsoft.AspNet.OData.dll!Microsoft.AspNet.OData.Batch.DefaultODataBatchHandler.ExecuteRequestMessagesAsync(System.Collections.Generic.IEnumerable requests, System.Threading.CancellationToken cancellationToken) Unbekannt Microsoft.AspNet.OData.dll!Microsoft.AspNet.OData.Batch.DefaultODataBatchHandler.ProcessBatchAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) Unbekannt [Wiederaufnehmen der asynchronen Methode]
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(object stateMachine) Unbekannt mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unbekannt mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unbekannt mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Unbekannt mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod0() Unbekannt mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unbekannt mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod0() Unbekannt mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke() Unbekannt mscorlib.dll!System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.GetActionLogDelegate.AnonymousMethod0() Unbekannt mscorlib.dll!System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation..cctor.AnonymousMethod80(object state) Unbekannt System.Web.dll!System.Web.AspNetSynchronizationContext.Post.AnonymousMethod0() Unbekannt System.Web.dll!System.Web.Util.SynchronizationHelper.SafeWrapCallback(System.Action action) Unbekannt System.Web.dll!System.Web.Util.SynchronizationHelper.QueueAsynchronous.AnonymousMethod0(System.Threading.Tasks.Task ) Unbekannt mscorlib.dll!System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() Unbekannt mscorlib.dll!System.Threading.Tasks.Task.Execute() Unbekannt mscorlib.dll!System.Threading.Tasks.Task.ExecutionContextCallback(object obj) Unbekannt mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unbekannt mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unbekannt mscorlib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot) Unbekannt mscorlib.dll!System.Threading.Tasks.Task.ExecuteEntry(bool bPreventDoubleExecution) Unbekannt mscorlib.dll!System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unbekannt mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Unbekannt mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unbekannt [Übergang von Nativ zu Verwaltet]
[Asynchrone Aufrufliste]
[Asynchron] System.Web.Http.dll!System.Web.Http.Batch.HttpBatchHandler.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) Unbekannt [Asynchron] System.Web.Http.dll!System.Web.Http.HttpServer.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) Unbekannt [Asynchron] System.Web.Http.WebHost.dll!System.Web.Http.WebHost.HttpControllerHandler.ProcessRequestAsyncCore(System.Web.HttpContextBase contextBase) Unbekannt [Asynchron] System.Web.dll!System.Web.TaskAsyncHelper.BeginTask.AnonymousMethod_0(System.Threading.Tasks.Task ) Unbekannt

Additional detail

In my Opinion the problem seems to be caused by the link - object which is placed in the dataservicecontext by the DataServiceCollection. After Assigning the related object as null ( properties in entitymodel are configured as nullable) the link object stays modified in Dataservicecontext but with target null.

xuzhg commented 3 years ago

“"Fehler beim Verarbeiten des Anforderungsdatenstroms. Im Batchmodus kann nur bei Bindungs-/Trennvorgängen über Querverweise auf eine Ressource”

Error processing request stream. In batch mode, you can only use cross-references to a resource during binding / separating processes

KenitoInc commented 3 years ago

@slnetgit Kindly share a metadata so that we can reproduce the issue.

slnetgit commented 3 years ago

Hallo support team, the attached file ist he Model of the usecase. It is reproducible with any model.

We found this in basedata scenario when the user adds data where the added data e.g. company is added to a DataServiceCollection, and before being saved related single object(s) are assigned to the new entity.

This causes a link from company to related object in modified state. When the related object stays assigned, the added object can be saved ok. When the user decides to un – assign the related object, the link is not removed and stays modified with target null.

the exception occurs.

Mit freundlichen Grüßen / Best Regards

Sascha Link

Von: Christof Sprenger @.> Gesendet: Dienstag, 4. Mai 2021 18:28 An: OData/odata.net @.> Cc: Sascha Link @.>; Mention @.> Betreff: Re: [OData/odata.net] DataserviceCollection adding related objects (#2077)

Reopened #2077https://github.com/OData/odata.net/issues/2077.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/OData/odata.net/issues/2077#event-4684414745, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHHBQL7TSPR6JPMAYY2G2NTTMAOBHANCNFSM44ATJ3NA.

KenitoInc commented 3 years ago

Hey @slnetgit Can you use Fiddler and share the batch request that is created.

KenitoInc commented 3 years ago

I have made some observations when looking into this issue. I have created a sample service and client based on the same logic as your example above.

Using the model classes below in an odata service:

public class Book
{
    public int Id { get; set; }
    public string Isbn { get; set; }
    public string Title { get; set; }
    public Author MainAuthor { get; set; }
    public ICollection<Author> Authors { get; set; }
}

public class Author
{
    public int Id { get; set; }
    public string Name { get; set; }
}

I created an odata client with the sample code below:

Container dsc = new Container(new Uri("http://serviceUri"));
DataServiceCollection<Book> books = new DataServiceCollection<Book>(dsc, "Books", null, null);
Author author = dsc.Authors.First();
Book newBook = new Book()
{
    Title = "12 years a slave",
    Year = 2000
};

books.Add(newBook);
newBook.MainAuthor = author;
newBook.MainAuthor = null;

dsc.SaveChanges(SaveChangesOptions.BatchWithSingleChangeset );

This is the request that is created.

POST http://localhost:6143/odata/$batch HTTP/1.1
Host: localhost:6143
OData-Version: 4.0
OData-MaxVersion: 4.0
Accept: multipart/mixed
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.9.0
Connection: Keep-Alive
Content-Type: multipart/mixed; boundary=batch_93bc3b22-709b-4438-8e8b-942768d89169
Content-Length: 1175

--batch_93bc3b22-709b-4438-8e8b-942768d89169
Content-Type: multipart/mixed; boundary=changeset_c9cd06b5-9df0-4310-a510-8c9d9900c5ae

--changeset_c9cd06b5-9df0-4310-a510-8c9d9900c5ae
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 3

POST http://localhost.fiddler:6143/odata/Books HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json;odata.metadata=minimal
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.9.0

{"@odata.type":"#BookLibService.Models.Book","Id":0,"Isbn":null,"Title":"12 years a slave","Year":2000}
--changeset_c9cd06b5-9df0-4310-a510-8c9d9900c5ae
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 5

DELETE $3/MainAuthor/$ref HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.9.0

--changeset_c9cd06b5-9df0-4310-a510-8c9d9900c5ae--
--batch_93bc3b22-709b-4438-8e8b-942768d89169--

When you call newBook.MainAuthor = null; a DELETE ref request is added to the batch. This will happen even when you don't have a call newBook.MainAuthor = author;.

If you only have newBook.MainAuthor = author; without newBook.MainAuthor = null; The request should have odata.bind

POST http://localhost:6143/odata/$batch HTTP/1.1
Host: localhost:6143
OData-Version: 4.0
OData-MaxVersion: 4.0
Accept: multipart/mixed
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.9.0
Connection: Keep-Alive
Content-Type: multipart/mixed; boundary=batch_2cde0dc6-5358-40bc-9de4-10723f456301
Content-Length: 909

--batch_2cde0dc6-5358-40bc-9de4-10723f456301
Content-Type: multipart/mixed; boundary=changeset_78985de2-7f64-45fa-8af8-a000d35690e8

--changeset_78985de2-7f64-45fa-8af8-a000d35690e8
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 3

POST http://localhost.fiddler:6143/odata/Books HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Type: application/json;odata.metadata=minimal
Accept: application/json;odata.metadata=minimal
Accept-Charset: UTF-8
User-Agent: Microsoft.OData.Client/7.9.0

{"@odata.type":"#BookLibService.Models.Book","Id":0,"Isbn":null,"Title":"12 years a slave","Year":2000,"MainAuthor@odata.bind":"http://localhost:6143/odata/Authors(1)"}
--changeset_78985de2-7f64-45fa-8af8-a000d35690e8--
--batch_2cde0dc6-5358-40bc-9de4-10723f456301--

Conclusion When you creating an entity and it's navigation property is set to null e.g newBook.MainAuthor = null, you create a DELETE ref request. You won't create a DELETE ref when updating or deleting an entity

slnetgit commented 3 years ago
        testEntities c2 = new testEntities(new Uri("http://localhost:53739/WcfDemoService.svc"));

        var g1 = c2.Gesellschaftsform.FirstOrDefault();
        testModel.Gesellschaftsform gesellschaftsform = c2.Gesellschaftsform.Where(p => p.Beschreibung != g1.Beschreibung).FirstOrDefault();

        System.Data.Services.Client.DataServiceCollection<testModel.Firma> coll = new System.Data.Services.Client.DataServiceCollection<testModel.Firma>(c2);

        var neu = new testModel.Firma();
        neu.Bezeichnung = "new company4";
        neu.Kommentar = "Test";
        coll.Add(neu);

        neu.Gesellschaftsform = g1;
        neu.GesellschaftsformId = g1.id;

        neu.GesellschaftsformId = null;
        neu.Gesellschaftsform = null;

        c2.SaveChanges( System.Data.Services.Client.SaveChangesOptions.Batch);

produces in Fiddler:

GET http://localhost:53739/WcfDemoService.svc/Gesellschaftsform()?$top=1 HTTP/1.1 DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 3.0;NetFx Accept: application/atom+xml,application/xml Accept-Charset: UTF-8 User-Agent: Microsoft ADO.NET Data Services Host: localhost:53739 Connection: Keep-Alive

HTTP/1.1 200 OK Cache-Control: no-cache Content-Length: 1148 Content-Type: application/atom+xml;type=feed;charset=utf-8 Server: Microsoft-HTTPAPI/2.0 X-Content-Type-Options: nosniff DataServiceVersion: 1.0; Date: Fri, 16 Jul 2021 06:45:32 GMT

<?xml version="1.0" encoding="utf-8"?>http://localhost:53739/WcfDemoService.svc/GesellschaftsformGesellschaftsform2021-07-16T06:45:32Zhttp://localhost:53739/WcfDemoService.svc/Gesellschaftsform(1)<updated>2021-07-16T06:45:32Z</updated><author><name /></author><content type="application/xml"><m:properties><d:id m:type="Edm.Int32">1</d:id><d:Beschreibung>GmbH</d:Beschreibung></m:properties></content></entry></feed></p> <hr /> <p>GET <a href="http://localhost:53739/WcfDemoService.svc/Gesellschaftsform()?$filter=Beschreibung%20ne%20'GmbH'&$top=1">http://localhost:53739/WcfDemoService.svc/Gesellschaftsform()?$filter=Beschreibung%20ne%20'GmbH'&$top=1</a> HTTP/1.1 DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 3.0;NetFx Accept: application/atom+xml,application/xml Accept-Charset: UTF-8 User-Agent: Microsoft ADO.NET Data Services Host: localhost:53739</p> <p>HTTP/1.1 200 OK Cache-Control: no-cache Content-Length: 1146 Content-Type: application/atom+xml;type=feed;charset=utf-8 Server: Microsoft-HTTPAPI/2.0 X-Content-Type-Options: nosniff DataServiceVersion: 1.0; Date: Fri, 16 Jul 2021 06:45:32 GMT</p> <p><?xml version="1.0" encoding="utf-8"?><feed xml:base="http://localhost:53739/WcfDemoService.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><id><a href="http://localhost:53739/WcfDemoService.svc/Gesellschaftsform">http://localhost:53739/WcfDemoService.svc/Gesellschaftsform</a></id><title type="text">Gesellschaftsform2021-07-16T06:45:33Zhttp://localhost:53739/WcfDemoService.svc/Gesellschaftsform(2)<updated>2021-07-16T06:45:33Z</updated><author><name /></author><content type="application/xml"><m:properties><d:id m:type="Edm.Int32">2</d:id><d:Beschreibung>KG</d:Beschreibung></m:properties></content></entry></feed></p> <hr /> <p>POST <a href="http://localhost:53739/WcfDemoService.svc/$batch">http://localhost:53739/WcfDemoService.svc/$batch</a> HTTP/1.1 DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 3.0;NetFx Content-Type: multipart/mixed; boundary=batch_eb598119-7f36-4bb2-8db7-6b8b0bba76be Accept: multipart/mixed Accept-Charset: UTF-8 User-Agent: Microsoft ADO.NET Data Services Host: localhost:53739 Content-Length: 1636 Expect: 100-continue</p> <p>--batch_eb598119-7f36-4bb2-8db7-6b8b0bba76be Content-Type: multipart/mixed; boundary=changeset_2906d6e6-0abd-4fdc-ad80-dc424bf16b03</p> <p>--changeset_2906d6e6-0abd-4fdc-ad80-dc424bf16b03 Content-Type: application/http Content-Transfer-Encoding: binary</p> <p>POST <a href="http://localhost:53739/WcfDemoService.svc/Firma">http://localhost:53739/WcfDemoService.svc/Firma</a> HTTP/1.1 Content-ID: 3 Content-Type: application/atom+xml DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 3.0;NetFx Accept: application/atom+xml,application/xml Accept-Charset: UTF-8 User-Agent: Microsoft ADO.NET Data Services</p> <p><?xml version="1.0" encoding="utf-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><id /><title /><updated>2021-07-16T06:45:41Z</updated><author><name /></author><content type="application/xml"><m:properties><d:Bezeichnung>new company4</d:Bezeichnung><d:CreationBy m:null="true" /><d:CreationDate m:type="Edm.DateTime" m:null="true" /><d:GesellschaftsformId m:type="Edm.Int32" m:null="true" /><d:id m:type="Edm.Int32">0</d:id><d:Kommentar>Test</d:Kommentar></m:properties></content></entry> --changeset_2906d6e6-0abd-4fdc-ad80-dc424bf16b03 Content-Type: application/http Content-Transfer-Encoding: binary</p> <p>DELETE $3/$links/Gesellschaftsform HTTP/1.1 Content-ID: 5 DataServiceVersion: 1.0;NetFx MaxDataServiceVersion: 3.0;NetFx Accept: application/atom+xml,application/xml Accept-Charset: UTF-8 User-Agent: Microsoft ADO.NET Data Services</p> <p>--changeset_2906d6e6-0abd-4fdc-ad80-dc424bf16b03-- --batch_eb598119-7f36-4bb2-8db7-6b8b0bba76be--</p> <p>HTTP/1.1 202 Accepted Cache-Control: no-cache Content-Length: 885 Content-Type: multipart/mixed; boundary=batchresponse_b5ac8ab7-9aac-42eb-9dc5-c8990bcb9bf3 Server: Microsoft-HTTPAPI/2.0 X-Content-Type-Options: nosniff DataServiceVersion: 1.0; Date: Fri, 16 Jul 2021 06:45:41 GMT</p> <p>--batchresponse_b5ac8ab7-9aac-42eb-9dc5-c8990bcb9bf3 Content-Type: multipart/mixed; boundary=changesetresponse_51dfaed0-fe34-4ebf-9174-d4ef0a1e03af</p> <p>--changesetresponse_51dfaed0-fe34-4ebf-9174-d4ef0a1e03af Content-Type: application/http Content-Transfer-Encoding: binary</p> <p>HTTP/1.1 400 Bad Request Content-ID: 5 X-Content-Type-Options: nosniff DataServiceVersion: 1.0; Content-Type: application/xml;charset=utf-8</p> <p><?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="de-DE">Fehler beim Verarbeiten des Anforderungsdatenstroms. Im Batchmodus kann nur bei Bindungs-/Trennvorgängen über Querverweise auf eine Ressource verwiesen werden.</m:message></m:error> --changesetresponse_51dfaed0-fe34-4ebf-9174-d4ef0a1e03af-- --batchresponse_b5ac8ab7-9aac-42eb-9dc5-c8990bcb9bf3--</p> <hr /> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/KenitoInc"><img src="https://avatars.githubusercontent.com/u/7702964?v=4" />KenitoInc</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Thanks for the repro @slnetgit Can you share a repro using the v4 OData client?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/slnetgit"><img src="https://avatars.githubusercontent.com/u/30283823?v=4" />slnetgit</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>The V4 repro uses the following code on the client Container c1 = new Container(new Uri("<a href="http://localhost/testrestier/">http://localhost/testrestier/</a>"));</p> <pre><code> var g1 = c1.Gesellschaftsform.FirstOrDefault(); DataServiceCollection<Testrestier.Firma> coll = new DataServiceCollection<Testrestier.Firma>(c1); var neu = new Testrestier.Firma(); neu.Bezeichnung = "new company1"; neu.Kommentar = "Test"; coll.Add(neu); neu.Gesellschaftsform = g1; neu.GesellschaftsformId = g1.Id; neu.GesellschaftsformId=null; neu.Gesellschaftsform = null; c1.SaveChanges(SaveChangesOptions.BatchWithSingleChangeset);</code></pre> <p>In Fiddler this produces the following output :</p> <p>GET <a href="http://localhost/testrestier/Gesellschaftsform?$top=1">http://localhost/testrestier/Gesellschaftsform?$top=1</a> HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 User-Agent: Microsoft.OData.Client/7.9.0 Host: localhost Connection: Keep-Alive</p> <p>HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Type: application/json; odata.metadata=minimal; charset=utf-8 Expires: -1 Server: Microsoft-IIS/10.0 OData-Version: 4.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Mon, 26 Jul 2021 09:39:47 GMT Content-Length: 115</p> <p>{"@odata.context":"<a href="http://localhost/testrestier/$metadata#Gesellschaftsform","value":[{"id":1,"Beschreibung":"GmbH">http://localhost/testrestier/$metadata#Gesellschaftsform","value":[{"id":1,"Beschreibung":"GmbH</a>"}]}</p> <hr /> <p>POST <a href="http://localhost/testrestier/$batch">http://localhost/testrestier/$batch</a> HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: multipart/mixed; boundary=batch_87d9c078-9ec3-4532-8dfb-c332986367d2 Accept: multipart/mixed Accept-Charset: UTF-8 User-Agent: Microsoft.OData.Client/7.9.0 Host: localhost Content-Length: 1127 Expect: 100-continue</p> <p>--batch_87d9c078-9ec3-4532-8dfb-c332986367d2 Content-Type: multipart/mixed; boundary=changeset_959af259-f6c6-4553-9ed5-68e4819700f4</p> <p>--changeset_959af259-f6c6-4553-9ed5-68e4819700f4 Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 2</p> <p>POST <a href="http://localhost/testrestier/Firma">http://localhost/testrestier/Firma</a> HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Type: application/json;odata.metadata=minimal Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 User-Agent: Microsoft.OData.Client/7.9.0</p> <p>{"@odata.type":"#testrestier.Firma","Bezeichnung":"new company1","CreationBy":null,"CreationDate":null,"GesellschaftsformId":null,"id":0,"Kommentar":"Test"} --changeset_959af259-f6c6-4553-9ed5-68e4819700f4 Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 4</p> <p>DELETE $2/Gesellschaftsform/$ref HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Accept: application/json;odata.metadata=minimal Accept-Charset: UTF-8 User-Agent: Microsoft.OData.Client/7.9.0</p> <p>--changeset_959af259-f6c6-4553-9ed5-68e4819700f4-- --batch_87d9c078-9ec3-4532-8dfb-c332986367d2--</p> <p>HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Type: multipart/mixed; boundary=batchresponse_47b3eb72-4f94-4b71-9d0b-8c7dd5c55423 Expires: -1 Server: Microsoft-IIS/10.0 OData-Version: 4.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Mon, 26 Jul 2021 09:39:48 GMT Content-Length: 640</p> <p>--batchresponse_47b3eb72-4f94-4b71-9d0b-8c7dd5c55423 Content-Type: multipart/mixed; boundary=changesetresponse_62b6035b-ad24-4cde-ba9b-ca3a31639667</p> <p>--changesetresponse_62b6035b-ad24-4cde-ba9b-ca3a31639667 Content-Type: application/http Content-Transfer-Encoding: binary Content-ID: 2</p> <p>HTTP/1.1 500 Internal Server Error Content-Type: application/json; odata.metadata=minimal; charset=utf-8 OData-Version: 4.0</p> <p>{"error":{"code":"","message":"Ung\u00fcltiger URI: Das URI-Format konnte nicht bestimmt werden."}} --changesetresponse_62b6035b-ad24-4cde-ba9b-ca3a31639667-- --batchresponse_47b3eb72-4f94-4b71-9d0b-8c7dd5c55423--</p> <hr /> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/slnetgit"><img src="https://avatars.githubusercontent.com/u/30283823?v=4" />slnetgit</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p><img src="https://user-images.githubusercontent.com/30283823/126968975-36fa8990-c1d8-4297-bd3b-b5c088717952.png" alt="image" /></p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>