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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:51:33+00:00 2026-06-02T11:51:33+00:00

I’m still working on a WCF solution that should be able to query the

  • 0

I’m still working on a WCF solution that should be able to query the backend of the program and return the results.

The backend stores a dictionary of objects called Groups and they can be queried with functions like:

  • GetGroup to get a single group by ID
  • GetGroups to get a list of groups by tags.

The GetGroup works fine with the WCF Test Client and the application I have built.
And it works with the following code form the application:

        List<string> values = new List<string>();
        GroupServiceClient client = new GroupServiceClient("WSHttpBinding_IGroupService");
        www.test.co.uk.programme.programme Group = new www.test.co.uk.programme.programme();
        DateTime time = DateTime.Now;
        values.Clear();
        client.Open();

        Group.number = textBox1.Text;
        client.GetGroup(ref time, ref Group);

        GroupStorageMessage toReturn = new GroupStorageMessage();
        toReturn.group = Group;

        selectedGroupId = Convert.ToString(toReturn.group.number);

        values.Add(Convert.ToString(toReturn.group.number));
        values.Add(Convert.ToString(toReturn.group.name));

        listBox1.ItemsSource=values;

        client.Close();

The GetGroups works perfectly with WCF Test Client but not with my application.

It sends the query as it should but it does return Null (please note that this code is form another app and I’m using a reference instead of a proxy file)

        ServiceReference1.programme Group = new ServiceReference1.programme();
        ServiceReference1.GroupServiceClient Client = new ServiceReference1.GroupServiceClient();
        DateTime Time = DateTime.Now;

        Client.Open();

        string[] aa = new string[1];

        aa[0] = textBox1.Text;
        Group.tags = aa;
        Client.GetGroups(ref Time, Group);

        ServiceReference1.GroupArrayMessage toReturn = new ServiceReference1.GroupArrayMessage();

        ServiceReference1.programme[] Groups = new ServiceReference1.programme[1];

        toReturn.groups = Groups;   = returns null

in new ServiceReference1.programme[1]; I am actually guessing what to put there.

Interface:

[ServiceContract(Namespace = "http://www.Test.co.uk/groupstorage")]
public interface IGroupStorageService
{
    /**
     * Get a group from the collection of groups
     */
    [OperationContract]
    GroupStorageMessage GetGroup(GroupStorageMessage message);
    /**
     * Add a group to the collection of groups
     */
    [OperationContract]
    void AddGroup(GroupStorageMessage message);
    /**
     * Remove a group from the collection of groups
     */
    [OperationContract]
    void RemoveGroup(GroupStorageMessage message);
    /**
     * Update a group in the collection of groups
     */
    [OperationContract]
    void UpdateGroup(GroupStorageMessage message);

    [OperationContract]
    GroupArrayMessage GetGroups(GroupStorageMessage message);
}

Message Contract:

[MessageContract]
public class GroupArrayMessage
{
    /**
     * Message header is the timestamp when the message was created
     */
    [MessageHeader(Name = "time")]
    public DateTime Time;
    /**
     * Message body is a collection of Users
     */
    [MessageBodyMember(Name = "groups")]
    public Group[] Groups;
}

Group contact (sometimes referred as programme)

[DataContract(Namespace = "http://www.test.co.uk/programme", Name = "programme")]
public class Group
{
    /**
     * The number representing the Programme (Programme ID)
     */
    [DataMember(Name = "number")]
    public string Number;
    /**
     * The name of the Programme
     */
    [DataMember(Name = "name")]
    public string Name;
    /// <summary>
    /// Add Tags
    /// </summary>
    [DataMember(Name = "tags")]
    public string[] Tags;
  • 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-02T11:51:37+00:00Added an answer on June 2, 2026 at 11:51 am

    I finally found the solution:

            GroupService.GroupArrayMessage toReturn = new GroupService.GroupArrayMessage();
    
    
            GroupService.programme[] Groups = Client.GetGroups(ref Time, Group);
    
            toReturn.groups = Groups;
    
            listBox1.ItemsSource = toReturn.groups;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still working my way through this program. Next task on my to-do list is
I've got a WCF service that is working for basic queries. I started with
Update: We are still using XP at work and I got my solution working,
I'm currently working on a solution to upload and download files to a WCF
Still working through JQuery to get data and repopulate portions of a page. Right
Still working on lisp recipes and idioms. I have a list like this: ((a
I'm still working with this huge list of URLs, all the help I have
I'm still working on groking the F# thing - trying to work out how
I'm still working on my leaks problem and I don't know how to solve
I'm still working my way through some pretty basic Actionscript programming (in Flex), 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.