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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:18:34+00:00 2026-05-23T01:18:34+00:00

I created WCF service that returns a custom object called XmlElementTreeNode. This is what

  • 0

I created WCF service that returns a custom object called XmlElementTreeNode. This is what the object looks like:

[DataContract]
public class XmlElementTreeNode
{
    [DataMember]
    public string Name { get; set; }

    [DataMember]
    public List<string> Attributes { get; set; }

    [DataMember]
    public List<XmlElementTreeNode> Children { get; set; }

    public XmlElementTreeNode() { }
}

I am able to successfully create a heirarchy of these nodes with this method:

[OperationContract]
public XmlElementTreeNode GetTreeView(string initialSchemaUri)
{
    Uri uri = new Uri(initialSchemaUri, UriKind.Absolute);
    XPathSorter sorter = new XPathSorter(uri);
    XmlElementTreeNode theNode = sorter.rootTreeNode;
    return theNode;
}

But the error I get back is:

CommunicationException was unhandled by user code
The remote server returned an error: NotFound.

at this method in Reference.cs:

public SilverlightApplication.SchemaServiceReference.XmlElementTreeNode EndGetTreeView(System.IAsyncResult result)
{
    object[] _args = new object[0];
    SilverlightApplication.SchemaServiceReference.XmlElementTreeNode _result = ((SilverlightApplication.SchemaServiceReference.XmlElementTreeNode)(base.EndInvoke("GetTreeView", _args, result)));
    return _result;
}

I rewrote the service to return theNode.Name and theNode.Attributes instead. Both of those worked. I also rewrote the service to return theNode.Children and I get the same exact error.

So, when I get this error, I never reach this code in Silverlight, because the service did not “finish.”

void service_GetTreeViewCompleted(object sender, GetTreeViewCompletedEventArgs e)
{
    XmlElementTreeNode rootNode = e.Result;
}

However, I found this interesting. I changed return theNode to return theNode.Children[0]. So, I still am returning an XmlElementTreeNode object to Silverlight. When I did this, I was able to reach the service_GetTreeViewCompleted method and access my tree of nodes (although only starting from the first child of the root node). I think it’s strange that this worked, but not the “root” node (the original theNode variable).

Anyone have any ideas how I can return my theNode variable? I’m completely new to WCF, so maybe there is some other way to go about returning my complex custom object properly that I am not aware of.

Update 1

My XmlElementTreeNode object represents an xml element as defined by an xsd document. The generated heiarchy of XmlElementTreeNodes represent all the possible elements that could be created in an XML file thati validated against the XSD uri being passed into my service. It just so happens that the first element of theNode.Children represents only a small tree of nodes. However, I tried to return theNode.Children[1], which has thousands of sub-nodes, and I get the same error. So, I think the problem is that the size of the entire theNode object is simply too big.

I tried editing my binding as follows in Web.config:

    <binding name="SilverlightApplication.Web.SchemaService.customBinding0">
      <textMessageEncoding>
        <readerQuotas maxDepth="2147483647"
          maxStringContentLength="2147483647"
          maxArrayLength="2147483647"
          maxBytesPerRead="2147483647"
          maxNameTableCharCount="2147483647" />
      </textMessageEncoding>
      <httpTransport maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" />
      <binaryMessageEncoding maxReadPoolSize="2147483647" maxSessionSize="2147483647" maxWritePoolSize="2147483647" />
    </binding>

But, even with those huge values, I get the same error.

  • 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-23T01:18:35+00:00Added an answer on May 23, 2026 at 1:18 am

    The “NotFound” error is a big issue in Silverlight because it essentially means that “something went wrong” – by default all non-200 responses from the service are translated into a 404 (Not Found) by the SL networking layer, and no further information is given to the program. A few things you can do:

    • Look at a network capture tool (such as Fiddler) to see the exact response that the server is returning to the client.
    • If the response is something like 500 (Internal Server Error), enable tracing on the server side and the trace should contain an exception which explains the error.

    There are some documentations about debugging WCF services in SL. There’s a good video (25 minutes long) at http://blogs.msdn.com/b/silverlightws/archive/2010/09/23/debugging-wcf-services-in-silverlight.aspx, and there’s a MSDN page at http://msdn.microsoft.com/en-us/library/cc197938(v=VS.95).aspx with some good information as well.

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

Sidebar

Related Questions

I have created a basic WCF service in IIS. I am aware that this
I have a WCF service that returns JSON to the clients. This is the
I've created a .NET WCF service that is intended to always be over HTTPS.
I'm creating a WCF service that transfers entity objects created via entity framework. I
Created a simple WCF service that basically logs to a db. the build is
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I have a WCF service that uses a System.ServiceModel.Syndication.SyndicationFeed to create an RSS feed.
Is it possible to create a single .svc file (WCF Service) that I can
I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.
I've created a WCF service and when I browse to the endpoint I get

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.