Note that there are some explanatory texts on larger screens.

plurals
  1. PONot able to invoke the WCF function
    text
    copied!<p>I've an asp .net application, my Data Access Layer is a WCF service. I use VWD Express 2010. The whole structure in a bird's eye view is something like this</p> <pre><code> [ServiceContract] public interface IExcelReader { [OperationContract] [FaultContract(typeof(StaffAllocationFault))] void ReadExcel(); } </code></pre> <p><br></p> <pre><code> public void ReadExcel() { DataSet dataCollection = new DataSet(); table = new DataTable("Capacity"); //gets the connection string for the excelsheet with the employee details //string strCon = ConfigurationManager.ConnectionStrings["capacityDB"].ConnectionString; string strCon = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\CapacityDB.xlsx;Extended Properties=Excel 12.0"; //gets the predefined filters in the application string[] filter = GetDefinedFilters(); //creates the connection object oledbCon = new OleDbConnection(strCon); try { //opens the connection object openConnection(); string strCmd = "Select * from [Capacity Report Data$]"; //creates the command object oledbCmd = new OleDbCommand(strCmd, oledbCon); //fills the datatable using the data adapter oledbAdapter = new OleDbDataAdapter(); oledbAdapter.SelectCommand = oledbCmd; oledbAdapter.Fill(table); dataCollection.Tables.Add(table); //to trim off the trailing/preceding whitespaces foreach (DataRow row in table.Rows) { int count = 0; while (count &lt; filter.Count()) { try { row[filter[count]] = row[filter[count]].ToString().Trim(); //if the field is blank if (row[filter[count]].ToString() == "") row[filter[count]] = "***"; count++; } catch (Exception ex) { throw new FaultException&lt;StaffAllocationFault&gt;(new StaffAllocationFault { FaultMessage = "Error while reading through the employee information" }, ex.Message); } } } } catch (Exception ex) { throw new FaultException&lt;StaffAllocationFault&gt;(new StaffAllocationFault { FaultMessage = "Error while retreiving employee information" }, ex.Message); } finally { //closes the oledb connection closeConnection(); } } </code></pre> <p><br> </p> <pre><code> public void ReadFromExcel() { try { new ExcelReaderClient().ReadExcel(); } //service specific exceptions catch (FaultException&lt;StaffAllocationFault&gt; ex) { throw new ExceptionLayer.StaffAllocationException("Error while reading from excel", ex); } //generic exceptions catch (Exception genEx) { throw genEx; } } </code></pre> <p>My <code>web.config</code> in UI: </p> <pre><code>&lt;client&gt; &lt;endpoint address="http://localhost:49171/ExcelReader.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IExcelReader" contract="ExcelService.IExcelReader" name="BasicHttpBinding_IExcelReader" /&gt; &lt;/client&gt; </code></pre> <p>when I run the application the function in the wcf is not getting invoked. Pls help.</p>
 

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