WCF sevice doesn't load in published application
I have problem with Silverlight-enabled WCF service, so this is my service:
[ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class WhatsNewService { string connectonString = ConfigurationManager.ConnectionStrings["sqlConnectionString"].ConnectionString; [OperationContract] public List<WhatsNewDataClass> GetData() { SqlConnection sqlCon = new SqlConnection(connectonString); DataSet objectSet = new DataSet(); SqlCommand sqlCom = new SqlCommand(); sqlCom.Connection = sqlCon; sqlCom.CommandText = "SELECT * FROM [dbo].[WhatsNew] WHERE [rowStatus]='Unseen' ORDER BY [changeDate] ASC ;"; SqlDataAdapter dataAdapter = new SqlDataAdapter(); dataAdapter.SelectCommand = sqlCom; dataAdapter.Fill(objectSet); List<WhatsNewDataClass> result = new List<WhatsNewDataClass>(); WhatsNewDataClass dataObject; if (objectSet.Tables.Count > 0) { foreach (DataRow dr in objectSet.Tables[0].Rows) { dataObject = new WhatsNewDataClass(); dataObject.changeType = dr["changeType"].ToString(); dataObject.objectType = dr["objectType"].ToString(); dataObject.objectName = dr["objectName"].ToString(); dataObject.changeDescription = dr["changeDescription"].ToString(); dataObject.changeDate = dr["changeDate"].ToString(); dataObject.changedBy = dr["changedBy"].ToString(); dataObject.rowStatus = dr["rowStatus"].ToString(); dataObject.ProjectID = dr["ProjectID"].ToString(); dataObject.UserName = dr["UserName"].ToString(); dataObject.itemID = dr["ID"].ToString(); dataObject.refType = dr["refType"].ToString(); dataObject.parentID = dr["parentID"].ToString(); result.Add(dataObject); } } return result; } }
So I call this service in my client part, everything is working fine, but when I publish it and put in my website, service don't return values. Any suggestions?
Answers & Comments...
No comments:
Post a Comment
Send us your comment related to the topic mentioned on the blog