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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:44:06+00:00 2026-05-30T22:44:06+00:00

I have a self hosting WCF application with a java client. I have a

  • 0

I have a self hosting WCF application with a java client. I have a WPF application which imlements the class

namespace WcfServiceLibrary6
{
    class Products
    {
        public string ProductID { get; set; }
        public string SerialNumber { get; set; }
        public string RangeOfProducts { get; set; }
        public string ProductDesc { get; set; }
        public string UnitPrice { get; set; }
        public string Discontinued { get; set; }
        public string Image { get; set; }
        //  public Bitmap Bimage = new Bitmap(50, 50);

        public System.Collections.IDictionary AttributeDictionary = new Dictionary<string, string>();
    }

}

The data is stored as a list(the wpf application(C#) accesses a database)

Now I would like to bind this list to a data contract in wcf so it can send the information to the java client. How do I go about it. The rest of the application works perfectly. I just need to assign the list values(wpf: List productList = new List();) to the members of the data contract.

  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Runtime.Serialization;
  using System.ServiceModel;
  using System.Text;
  using WpfApplication24;

 namespace WcfServiceLibrary6
 {
// NOTE: If you change the interface name "IService1" here, you must also update the      reference to "IService1" in App.config.
[ServiceContract]
public interface IService1
{
    [OperationContract]
    Product getChars(int barid);

}

// Use a data contract as illustrated in the sample below to add composite types to service operations

[DataContract]
public class Product
{
    private string m_ProductID;
    private string m_SerialNumber;
    private string m_RangeOfProducts;
    private string m_ProductDesc;
    private int m_UnitPrice;
    private string m_Discontinued;

    [DataMember]
    public string ProductID
    {
        get { return m_ProductID; }
        set { m_ProductID = value; }
    }

    [DataMember]
    public string SerialNumber
    {
        get { return m_SerialNumber; }
        set { m_SerialNumber = value; }
    }

    [DataMember]
    public string RangeOfProducts
    {
        get { return m_RangeOfProducts; }
        set { m_RangeOfProducts = value; }
    }

    [DataMember]
    public string ProductDesc
    {
        get { return m_ProductDesc; }
        set { m_ProductDesc = value; }
    }

    [DataMember]
    public int UnitPrice
    {
        get { return m_UnitPrice; }
        set { m_UnitPrice = value; }
    }

    [DataMember]
    public string Discontinued
    {
        get { return m_Discontinued; }
        set { m_Discontinued = value; }
    }
}

}      
  • 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-30T22:44:07+00:00Added an answer on May 30, 2026 at 10:44 pm

    For anyone who needs help with hosting a wcf service, I found this website very useful :
    wcfguidanceforwpf.codeplex.com

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

Sidebar

Related Questions

Reading up on WCF we have self hosting option available , one limitation here
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
I have a WCF client/server app which is communicating over HTTP using the WSHttpBinding.
I have a WCF Web application that uses a WCF Class Library. My project
I have seen examples, sample codes etc for self hosting WCF services within a
I have a Windows Service that is self hosting a Wcf service, this Wcf
We have self hosted a group of WCF services in a WCf web application.
I have a self hosted TCP based WCF service. I am now building a
I have a self-hosted WCF service with the InstanceContextMode set to PerSession. How can
If I have a self-referential Topic class and I want to recursively loop through

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.