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

  • SEARCH
  • Home
  • 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 8058451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:21:45+00:00 2026-06-05T09:21:45+00:00

I have an issue with WCF streaming. I have two components in my solution

  • 0

I have an issue with WCF streaming.
I have two components in my solution :

  • A WCF service hosted in a Windows Service
  • A client application (console app for now) consuming the service

The WCF service just have one method : RunProcess. This method takes no parameters and is starting a process. It returns a Stream (this is a WCF streaming method) corresponding to the process standard ouptut stream (StandardOutput.BaseStream).

The WCF service exposes a single endpoint with a basicHttpBinding (with transferMode=”streamed”).

The client code is pretty straightforward, it calls the RunProcess methods and passes the Stream result into a StreamReader calling ReadLine() on it until end of stream (ReadLine() returning null). Each ReadLine() result is sent to the console (Console.WriteLine())

So this is pretty simple … HOWEVER when I launch the client, the Console is not refreshed immediately as expected. It is waiting for some reason for the process that was launched to end because nothing is displayed in the console for a long time, and once the process is completed it is displaying the output all at once.

I have another console project, not relying on the WCF service, where I launch the process directly, get the standard ouptput stream, and using the exact same algorithm, write the stream to the console, and the issue is not present, the output stream is displayed directly after the process is launched, in real time.

I don’t understand this behavior. Any help would be greatly appreciated !

Thanks.

EDIT : Some code / config might help indeed.

— Config of the binding

<basicHttpBinding>
    <binding name="BasicHttpBindingStreamed" maxReceivedMessageSize="67108864" transferMode="Streamed"/>        
</basicHttpBinding>

— WCF method

public Stream RunProcess()
    {
        Process p = new Process();
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.FileName = "XXXXXX";          
        p.Start();            

        return p.StandardOutput.BaseStream;            
    }

— Client consummer

Stream cmdOutputStream = serviceClient.RunProcess();
string currentLine = null;
using (TextReader reader = new StreamReader(cmdOutputStream))
{                                
   currentLine = reader.ReadLine();
   while (currentLine != null)
   {
      Console.WriteLine(currentLine);
      currentLine = reader.ReadLine();
    }
 }
  • 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-06-05T09:21:46+00:00Added an answer on June 5, 2026 at 9:21 am

    Solved … Stupid issue, I specified the transferMode=”Streamed” on the WCF server side config but forgot client side .

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

Sidebar

Related Questions

I have a WCF service hosted in a Windows service which publishes errors to
I have a versioning issue with a WCF service contract in which one of
I have a strange little issue with a WCF RIA service I'm using in
Lets say I have a WCF service that a client can use to receive
I need your help on one practical issue. I have created a WCF service
I experience this issue: I have a WCF service, that exposes this operation contract:
I have WCF RESTful service and Android client. Server replies with 400 when I
I have created a WCF service which does not use the app.config to configure
please help me solve this issue. I have a client using WCF. I don't
I have a WCF service and I am creating the client using the Add

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.