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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:14:27+00:00 2026-06-16T04:14:27+00:00

I am trying to implement REST service in my C# application to communicate with

  • 0

I am trying to implement REST service in my C# application to communicate with Android client. I struggle with C# part.

I followed this article: http://msdn.microsoft.com/en-us/library/bb412178

This is how I run my service:

WebServiceHost host = new WebServiceHost(typeof(RestService), new Uri("http://localhost:8000/"));
ServiceEndpoint ep = host.AddServiceEndpoint(typeof(IRestService), new WebHttpBinding(), "");
host.Open();

Very like in article linked above I have IRestService interface and RestService with methods EchoWithGet(string s) and EchoWithPost which i dont use and I will not talk about it more. I want to return UserClientInfo class which is the cause of problem I will describe later.

[ServiceContract]
interface IRestService
{
    [OperationContract]
    [WebGet]
    UserClientInfo EchoWithGet(string s);
}

Here is implementation of EchoWithGet(…). It connects to another service and calls UserLog which should return UserClientInfo.

public UserClientInfo EchoWithGet(string s)
{
    service = (IService)Activator.GetObject(typeof(IService), "tcp://127.0.0.1:7878/" + "Service");
    service.UserLog("username", "password", out uci);
    return uci;
}

UserClientInfo is quite complex object. I am not sure if I can return it by service. It is struct containing another structures inside which contains another structures.

[Serializable]
public struct UserClientInfo
{
    public ulong ClientId;
    public DatabaseManager DBManager;
    public string DisplayedName;
    public ChISDispositions Dispositions;
    public RegistrationInfo RegistrationInfo;
    public uint Right1;
    public uint Right2;
    public uint Right3;
    public uint Right4;
    public string SessionId;
    public string UserId;
}

When I run my service and point my browser to http://localhost:8000/EchoWithGet?s=teststring I get Connection Interupted error. Firebug is showing status Aborted on network tab. Service somehow crashes. I can debug it and see that UserLog() retunrs uci object well and service returns it but somewhere between browser and service it fails.

I tried to return completly new object:

 UserClientInfo uci = new UserClientInfo();

That works and returns xml with plain object.


Is there something I do wrong?

Are there some limitation of services I should know about?

Is there any log where I could see whats wrong?

Thanks for any answer.

  • 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-16T04:14:29+00:00Added an answer on June 16, 2026 at 4:14 am

    The problem was in complex some parts of that complex object. Solution was to convert it to DTO.

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

Sidebar

Related Questions

We are trying to implement a REST API for an application we have now.
I am trying to implement session management in my REST service. I came to
I am trying to implement a remote REST service which is used to handle
Trying to implement Piwik using REST API over http but need a little help.
I'm trying to implement a REST service using WCF which will take the parameters
I'm trying to implement a REST communication on Android with the Apache HttpAsyncClient (version
I am trying to implement Basecamp API in Android application. I am trying to
I am trying to create a WCF client that operates with an http rest
I'm trying to implement a REST interface under IIS5.1/ASP-classic (XP-Pro development box). So far,
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every

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.