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 7714637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:10:52+00:00 2026-06-01T02:10:52+00:00

I’m working on a wcf service to stream a datafile & its relevant information

  • 0

I’m working on a wcf service to stream a datafile & its relevant information to an android client, I’m however sill a new to WCF, there is just a lot of reading and a lot of the time its not clear which is the best method to follow!

Which Format Should i impose on this service considering it will be an android device calling it ? Consider my code and what would be easily implemented, soap , json, rest or other ?

Any Examples would also be welcome esp one with the code I’ve defined below.
thanks!

[MessageContract]
public class DownlaodStreamItem
{

    [MessageHeader]
    public Int64 ItemID { set; get; }

    [MessageHeader]
    public Int64 SizeOfFile { set; get; }

    [MessageHeader]
    public String Name { set; get; }

    [MessageBodyMember]
    public Stream Data { set; get; }
}

[MessageContract]
public class someString
{
    [MessageBodyMember]
    public string SomeString{ set; get; }
}

Service

    [OperationContract]
    DownlaodStreamItem DownloadMessagecontact(someString SomeString);

Service :IService

 public DownlaodStreamItem DownloadMessagecontact(someString SomeString)
 {
    DownlaodStreamItem DLITEM = new DownlaodStreamItem();
    // Populate & return DownlaodStreamItem ....
    return DLITEM;
 }
  • 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-01T02:10:53+00:00Added an answer on June 1, 2026 at 2:10 am

    For android as client and .NET as service, best way is to write WCF REST Service. Because in this case you do not need to create any proxy class at android end and you can consume it just by making Http request.

    You can easily write REST WCF Service using the WCF REST Service Template 40 (CS).
    Please refer this on how to write it.

    Then you may simply use following code at android to consume this REST service. Hope this will help you.

    try {
                String URL;
                URL = "http://localhost/MyRESTSvc/DownloadStreamItem";       
    
                HttpClient httpclient = new DefaultHttpClient();
                HttpPost httppost = new HttpPost(URL);
                InputStream inputStream = getResources().openRawResource(R.raw.task);
                // Here task is any raw file you want to keep as input.. you may ignore it.
                InputStreamEntity reqEntity = new InputStreamEntity(inputStream, -1);
                reqEntity.setContentType("binary/octet-stream");
                reqEntity.setChunked(true); // Send in multiple parts if needed
                httppost.setEntity(reqEntity);
    
                HttpResponse response = httpclient.execute(httppost);  
                displayAlert("Success !!");
            }
            catch (ClientProtocolException e) {                
                displayAlert(e.getMessage());
            }
            catch (IOException e) {                
                displayAlert(e.getMessage());
            }
            catch (Exception e) {                
                displayAlert(e.getMessage());
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.