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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:11:29+00:00 2026-05-18T05:11:29+00:00

We have an existing application for which one of our DTO object has a

  • 0

We have an existing application for which one of our DTO object has a property typed as IDictionary<string, object>.

I am now trying to expose this object through a WCF service. This works in some cases, but not in the general case. To demonstrate the problem, consider the following two methods:

[OperationContract]
public IDictionary<string, object> Test1()
{
    return new Dictionary<string, object>
    {
        { "testkey1", "newstringvalue"},
    };
}

[OperationContract]
public IDictionary<string, object> Test2()
{
    return new Dictionary<string, object>
    {
        { "testkey1", "newstringvalue"},
        { "testkey2", new object [] { "one" , "two", "three", } }
    };
}

Method Test1() works as expected, but when I call Test2(), I get a strange runtime error on the client:

The request channel timed out while
waiting for a reply after 00:01:00.
Increase the timeout value passed to
the call to Request or increase the
SendTimeout value on the Binding. The
time allotted to this operation may
have been a portion of a longer
timeout.

Inner exception: The remote server
returned an error: (504) Gateway
Timeout.

This is despite the fact that the exception was thrown instantly, ie. I didn’t actually have to wait a minute for this response. No error is shown on the server.

I suspect this stems from the fact that the serializer can’t serialize object[], but this is not what is indicated by the error.

So my questions are:

  1. What is going on here?
  2. How do I work around this so I can serialize my objects correctly?

Thanks.

  • 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-18T05:11:30+00:00Added an answer on May 18, 2026 at 5:11 am

    As neither myself or any of my colleagues could think of a way to make this serialization work directly, we worked around the issue in the end by wrapping our object in a custom object, which converts the Dictionary<string, object> to a Dictionary<string, string>, which has a special serialization case defined for string arrays. We then changed the application to be aware of this. Not particularly elegant, but simple enough, and seems to work.

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

Sidebar

Related Questions

We have one existing web application which was running in IE browser. But because
I have a couple of pre-existing applications which I need to run in one
I have an existing application which does all of its logging against log4j. We
I have an existing iPhone application which starts from a UIViewController. What I want
I have an existing iPad application to which I've just added core data versioning.
We want to update an existing Application but unfortunately we have a problem. Our
I have an existing application using a DB called EXAMPLE, which uses a kind-of-old
I have existing application which uses Sql server 2005 as a backend. It contains
I have an existing application which uses Sql Server 2005 as a back-end. It
I have an existing application that has the following entities in the database Customer

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.