0

I followed the example from here but I cannot get this to work!

I can't see anything wrong with the update query and I can't think of what to change because it seems fine. I'm only testing with one request because I wanted to make sure it works first.

Here's the request's body:

--batch_hJUuHcmH7ADWhYbtkF0o9JWlq
Content-Type: multipart/mixed; boundary=changeset_oYIVi6ByvAtKBlI7hqFWoOwX7

--changeset(oYIVi6ByvAtKBlI7hqFWoOwX7)
Content-Type: application/http
Content-Transfer-Encoding: binary

MERGE PrescriptionService.svc/Prescriptions(1L) HTTP/1.1
Host: 192.168.10.179
Content-Type: application/json;odata=verbose

{"PrescriptionType":"RegularMedicationPrescriptionType","Page":"0","Comment":"whoaaaaaa"}

--changeset(oYIVi6ByvAtKBlI7hqFWoOwX7)--
--batch(hJUuHcmH7ADWhYbtkF0o9JWlq)--

I get a 202 Accepted so the "overall" batch request is not malformed. This is the response from the server:

--batchresponse_d8e813eb-0327-4518-9312-9b7a55d0da0c

Content-Type: multipart/mixed; boundary=changesetresponse_fc085e3b-68a8-46dd-86c6-334b1070607d



--changesetresponse_fc085e3b-68a8-46dd-86c6-334b1070607d--

--batchresponse_d8e813eb-0327-4518-9312-9b7a55d0da0c--

I tried POSTing to that same URL in the batch body to create an entity and it doesn't work either, so it has to be something with the request body.

What's wrong with the request's body?

4

1 回答 1

1

标题中指定的变更集边界:

边界=changeset_oYIVi6ByvAtKBlI7hqFWoOwX7

必须与稍后使用的完全匹配:

--changeset(oYIVi6ByvAtKBlI7hqFWoOwX7)

它没有。我不知道你为什么添加括号,但它们不应该在那里。批次边界本身也是如此。

于 2012-11-09T17:06:02.793 回答