none
Getting binary data in REST GET Requests RRS feed

  • Question

  • I'm doing GET request for all resources (Authority, Container, and Entity) and getting binary data in the response body:
    HTTP/1.1 200 OK
    Transfer-Encoding: chunked
    Content-Type: application/x-ssds+xml
    ETag: 6959
    Vary: Accept
    x-msft-request-id: b1dc784d-dd0d-413c-9eaf-f61764b3254c
    $MsftRequestUri: http://dctest.data.beta.mssds.com/v1/
    Date: Wed, 30 Jul 2008 18:02:47 GMT

    E7
    <s:Authority xmlns:s="http://schemas.microsoft.com/sitka/2008/03/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="http://www.w3.org/2001/XMLSchema">
      <s:Id>dctest</s:Id>
      <s:Version>6959</s:Version>
    </s:Authority>
    0

    Is this expected behavior?

    Thanks

    http://www.masteringbiztalk.com/blogs/jon/default.aspx
    Wednesday, July 30, 2008 6:16 PM

Answers

  • In this sprint when we made the move to blobs we also moved to streamed transfers for the service.  Along with this move came a to using the, "chunked" transfer encoding mechanism of Http.  This means that for larger messages these will sent over in multiple chunks.

    The binary data that you see through http sniffers (such as fiddler, http analyzer, etc) is the size of the chunk (notice in your headers that Content-Length is no longer present).  The 0 at the end of the message indiciates that this was also the last chunk in the sequence.

    Hope this helps to clear this up a bit.  You should be able to read more about this if you review the Transfer-Encoding header definition in the Http spec.  NOTE: If you use the message, as Mike was ealier, you will not see this in the response.  It's a protocol level thing only and will surface through HttpWebResponse.

    --Jeff--
    Wednesday, July 30, 2008 9:59 PM

All replies

  • I'm not seeing anything unusual when I make requests.  Maybe this is something from the code/tool you are using to interpret the response?

    I use WFETCH.EXE to make 'raw' calls to SSDS. That gives me full control of my request data and very high fidelity responses.


    Mike Amundsen [http://amundsen.com/blog/]
    Wednesday, July 30, 2008 7:19 PM
  • Certainly possible, but I don't think so.  I am making requests using WCF, but I get this even when I make raw requests with HttpWebRequest. .NET is having trouble parsing this body into XML.

     I'm using Fiddler for spying, and I've never had this problem with Fiddler before.


    http://www.masteringbiztalk.com/blogs/jon/default.aspx
    Wednesday, July 30, 2008 8:01 PM
  • and this with all entities, containers, authorities? even from different code and machines?

    i don't use fiddler so i'm not able to help on that front. does using WFETCH give you any different results?



    Mike Amundsen [http://amundsen.com/blog/]
    Wednesday, July 30, 2008 8:20 PM
  •  It may be a WCF problem,  I am still investigating but I think those characters in Fiddler are being ignore by IE, and the WebFetch tool.  Thanks for talking me through it Mike.
    http://www.masteringbiztalk.com/blogs/jon/default.aspx
    Wednesday, July 30, 2008 9:58 PM
  • In this sprint when we made the move to blobs we also moved to streamed transfers for the service.  Along with this move came a to using the, "chunked" transfer encoding mechanism of Http.  This means that for larger messages these will sent over in multiple chunks.

    The binary data that you see through http sniffers (such as fiddler, http analyzer, etc) is the size of the chunk (notice in your headers that Content-Length is no longer present).  The 0 at the end of the message indiciates that this was also the last chunk in the sequence.

    Hope this helps to clear this up a bit.  You should be able to read more about this if you review the Transfer-Encoding header definition in the Http spec.  NOTE: If you use the message, as Mike was ealier, you will not see this in the response.  It's a protocol level thing only and will surface through HttpWebResponse.

    --Jeff--
    Wednesday, July 30, 2008 9:59 PM
  • thanks - I just tracked it down to Transfer-Encoding right before I came back to the forum!  Thanks for the confirmation
    http://www.masteringbiztalk.com/blogs/jon/default.aspx
    Wednesday, July 30, 2008 10:04 PM
  • !Doh! Transfer-Encoding.



    Mike Amundsen [http://amundsen.com/blog/]
    Wednesday, July 30, 2008 11:20 PM