Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-256

Incorrect Content-Length for ChangeSet in $batch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • V2 1.2.0
    • V2 2.0.0
    • odata2-core
    • None

    Description

      When using the EntityProvider.writeBatchRequest(batchParts, boundar); method to create a $batch request which contains BatchChangeSetParts the calculated Content-Length of the changeset body part is not correct (regarding to "http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html").

      This results in exception when using strict multipart parsers (like sample service at "http://services.odata.org/V2/OData/OData.svc/$batch") which response with:

      --batchresponse_bbd3caec-0224-49c9-8bf0-75a1365853fb
      Content-Type: multipart/mixed; boundary=changesetresponse_054f8f41-e12f-46bb-922b-3dc234e2f27b
      
      <?xml version="1.0" encoding="utf-8" standalone="yes"?>
      <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <code></code>
        <message xml:lang="en-US">Error processing batch request. The request is not a valid batch request.</message>
      </error>
      --batchresponse_bbd3caec-0224-49c9-8bf0-75a1365853fb--
      

      For sample request and code snippet see attached files.

      Attachments

        1. sample.java
          3 kB
          mibo
        2. sample.batch
          2 kB
          mibo

        Activity

          People

            mirbo mibo
            mirbo mibo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: