Click here to Skip to main content
12,760,678 members (33,088 online)
Rate this:
Please Sign up or sign in to vote.
See more: WCF
1.Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proy, restoring to default configuration, or refreshing the service.
Error is : The underlying connection was closed: The connection was closed unexpectedly.

this is my 3 file...

        List<Vehicle_Master> GetVehicle();

public List<Vehicle_Master> GetVehicle()
            //Configuration.ProxyCreationEnabled = false;
            var result = (from var in dcdc.Vehicle_Masters select var).ToList();
            return result.ToList();

    <add name="Database1ConnectionString1" connectionstring="Data Source=najar-pc\sqlexpress;Initial Catalog=Database1;Integrated Security=True">
      providerName="System.Data.SqlClient" />
    <compilation debug="true" targetframework="4.0" />
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <servicemetadata httpgetenabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <servicedebug includeexceptiondetailinfaults="false" />
    <servicehostingenvironment multiplesitebindingsenabled="true" />
    <modules runallmanagedmodulesforallrequests="true" />

I have spend so much time but i have not solve it. please help me..
Posted 5-Oct-12 20:03pm
Updated 5-Oct-12 20:08pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Its always a good idea to return your collection as an Array rather a lit from WCF .

Please check the following in your applicaiton

--> Your object has some some uninitialised object internally and its not getting serialized.
--> Convert signature from List to Array (always a good idea to avoid dirty serialization issues )

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100