I created a WCF service to communicate with database, first I created a sample Helloworld!
method it's working fine
but when I try to call the actual methods it's giving following exception
An error occurred while receiving the HTTP response to http://10.11.32.211:87/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol.
In the browser
An existing connection was forcibly closed by the remote host
My web.config file
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<!--<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>-->
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ServiceBehavior" name="Service">
<endpoint address="" binding="basicHttpBinding" contract="IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<serviceThrottling maxConcurrentCalls="3000" maxConcurrentSessions="3000" maxConcurrentInstances="3000"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
I go through these links but it didn't worked MSDN LINK1
Edit
Actually what I am doing with this service is to execute a stored procedure on the server
using (con = new SqlConnection(connectionString))
{
using (cmd = new SqlCommand(selectStatement, con) { CommandType = CommandType.StoredProcedure })
{
adapter = new SqlDataAdapter(cmd);
table = new DataTable();
adapter.Fill(table);
return table;
}
}
I am able to call the same stored procedure from different website manually but not using this service....
What is it? and why this is coming?