Note that there are some explanatory texts on larger screens.

plurals
  1. POComplex data types in WCF?
    primarykey
    data
    text
    <p>I've run into a problem trying to return an object that holds a collection of childobjects that again can hold a collection of grandchild objects. I get an error, 'connection forcibly closed by host'.</p> <p>Is there any way to make this work? I currently have a structure resembling this:</p> <p>pseudo code:</p> <pre><code>Person: IEnumerable&lt;Order&gt; Order: IEnumerable&lt;OrderLine&gt; </code></pre> <p>All three objects have the DataContract attribute and all public properties i want exposed (including the IEnumerable's) have the DataMember attribute.</p> <p>I have multiple OperationContract's on my service and all the methods returning a single object OR an IEnumerable of an object works perfectly. It's only when i try to nest IEnumerable that it turns bad. Also in my client service reference i picked the generic list as my collection type. I just want to emphasize, <strong>only one of my operations/methods fail with this error - the rest of them work perfectly</strong>.</p> <p>EDIT (more detailed error description):</p> <pre><code>[SocketException (0x2746): An existing connection was forcibly closed by the remote host] [IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.] [WebException: The underlying connection was closed: An unexpected error occurred on a receive.] [CommunicationException: An error occurred while receiving the HTTP response to http://myservice.mydomain.dk/MyService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.] </code></pre> <p>I tried looking for logs but i can't find any... also i'm using a WSHttpBinding and an http endpoint.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload