Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:12:51+00:00 2026-05-31T03:12:51+00:00

I have a client program that is getting an httpresponsemessage from a WCF rest

  • 0

I have a client program that is getting an httpresponsemessage from a WCF rest service. I cannot for the life of me read the content in that response. It says in the content simply “streamed data content” and the content length is 0 and the content type is “”.

I have tried ReadAsStream() and tried to turn the stream into an xml document but I got an error saying the root node is missing.

I have tried using WebClient but I didn’t know what to put in the headers.

Does anyone know what to do with the “streamed data content” in the content of my response message?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:12:52+00:00Added an answer on May 31, 2026 at 3:12 am

    There are a couple of issues that might be cropping up.

    Reading XML

    I don’t know if ReadAsStream will work for XmlDocument, but if you can use XDocument it becomes must easier. Regardless, if the WCF rest service returns additional content aside from XML, you will need to deal with that. For example

    var stream = response.Content.ReadAsStream();
    using (var reader = XmlReader.Create(stream))
    {
        XDocument.Load(reader);
    }
    

    Headers vs Body

    The second issue might be with the way that the response is generated. When the query is made, you can specify if only the headers should read, or if the entire body should be read. Given that the content length is zero, it means that you are getting back a stream of an unknown size. You need handle the stream in that way – loading it into something that can consume the stream properly.

    You shouldn’t need to use the WebClient, as the HTTP library is made for this stuff.

    Erick

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client program that consumes a web service. It works quite well
I have a java client program that uses mdns with service discovery to find
I have written an ActionScript client program that tries to connect to a local
I have a client program written in .NET 2.0, that connects to the web
Ok. I have an MVC2 application that accesses a WCF program, and uses that
I have a client/server program in TCP written in C, and I would like
I have a client and server program (both in Obj-C) and I am transferring
I have a classic client/server (fat client and database) program written in Delphi 2006.
all. I'm having a bit of weird problem with client server program. I have
I have used JSON::Any in my program to transfer the hash between client and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.