Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
There was no endpoint listening at http://localhost:999/DE.Web/WCFServices/DE_Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

OK

public string getData(string Args, string Table)// Friendly_Name, string Where, string User_Name, string Password)
        {
            //return Args;
            Dictionary<string,> _dt;
            Json json = new Json();
            _dt = (Dictionary<string,>)json.Deserialize(Args, typeof(Dictionary<string,>));
            try
            {
                if (_dt.ContainsKey("Request_For"))
                {
                    string Request_For = _dt["Request_For"];
                    #region Request_For == "Authentication"
                    if (Request_For == "Authentication")
                    {
                        string _User_Name_DE = _dt["User_Name"];
                        string Password_DE = _dt["Password"];
                        DataTable _dtUsers_DE = new DataTable();
                        _dtUsers_DE.Fill_DataTable_DE(@"SELECT * FROM [DivineCampus].[dbo].[" + Words_DE.Users_DE + @"] 
                    WHERE " + Words_DE.User_Name_DE + " = '" + _User_Name_DE + "'", Words_DE.CMS_DE);

                        if (_dtUsers_DE.Rows.Count > 0 && Password_DE == Basic_Functions_DE.Decrypt_Data_DE(_dtUsers_DE.Rows[0][Words_DE.Password_DE].ToString()))
                            return _dtUsers_DE.Rows[0][Words_DE.Contact_ID_DE].ToString();

                        else
                            return "Error : Invalid UserName Password";
                    }
                    #endregion

                    #region Request_For == "Data"
                    else if (Request_For == "Data")
                    {
                        string _Friendly_Name_DE = _dt["Friendly_Name"];
                        string _Where_DE = _dt["Where"];
                        DataSet _DS_DE = new DataSet();
                        DataTable _dt_DE;//= _DS_DE.Tables.Add();

                        Assembly _Assembly = Assembly.GetAssembly(typeof(AbsBC_DE));
                        string _DLL = Words_DE.DE_Divine_Campus + ".bc" + _Friendly_Name_DE;
                        Type _Type = _Assembly.GetType(_DLL);
                        AbsBC_DE _AbsBC_DE = Activator.CreateInstance(_Type, new object[] { new DataSet() }) as AbsBC_DE;
                        _dt_DE = _AbsBC_DE.getData_DE(Where_Clause_DE: _Where_DE, Select_Child_DE: true);
                        return json.Serialize(_AbsBC_DE.DS_DE);
                    }
                    #endregion

                    #region Request_For == "Structure"
                    else if (Request_For == "Structure")
                    {
                        string _Friendly_Name_DE = _dt["Friendly_Name"];

                        DataTable _dt_DE;

                        Assembly _Assembly = Assembly.GetAssembly(typeof(AbsBC_DE));
                        string _DLL = Words_DE.DE_Divine_Campus + ".bc" + _Friendly_Name_DE;
                        Type _Type = _Assembly.GetType(_DLL);
                        AbsBC_DE _AbsBC_DE = Activator.CreateInstance(_Type, new object[] { new DataSet() }) as AbsBC_DE;
                        _dt_DE = clsConnection.getModel_Data_DE(BusinessObj_DE: _AbsBC_DE, Where_Clause_DE: "1=2");
                        _dt_DE.Clear();
                        _AbsBC_DE.Add_New_Row_DE(null);
                        return json.Serialize(_AbsBC_DE.DS_DE);
                    }
                    #endregion

                    #region Request_For == "Transaction"
                    else if (Request_For == "Transaction")
                    {
                        string _Friendly_Name_DE = _dt["Friendly_Name"];
                        // string Table = _dt["Table"];
                        try
                        {
                            Json json1 = new Json();
                            DataSet _ds = new DataSet();
                            _ds = (DataSet)json.Deserialize(Table, typeof(DataSet));

                            DataTable _dt_DE;
                            Assembly _Assembly = Assembly.GetAssem


Inner Exception

---------------------------
Error
---------------------------
The remote server returned an error: (404) Not Found.

   at System.Net.HttpWebRequest.GetResponse()

   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
---------------------------
OK   
---------------------------
Posted
Updated 11-Mar-14 20:52pm
v3
Comments
Sampath Lokuge 12-Mar-14 2:38am    
Please put your Inner Exception also ?
[no name] 12-Mar-14 2:40am    
public string getData(string Args, string Table)// Friendly_Name, string Where, string User_Name, string Password)
{
//return Args;
Dictionary<string, string=""> _dt;
Json json = new Json();
_dt = (Dictionary<string, string="">)json.Deserialize(Args, typeof(Dictionary<string, string="">));
try
{
if (_dt.ContainsKey("Request_For"))
{
string Request_For = _dt["Request_For"];
#region Request_For == "Authentication"
if (Request_For == "Authentication")
{
string _User_Name_DE = _dt["User_Name"];
string Password_DE = _dt["Password"];
DataTable _dtUsers_DE = new DataTable();
_dtUsers_DE.Fill_DataTable_DE(@"SELECT * FROM [DivineCampus].[dbo].[" + Words_DE.Users_DE + @"]
WHERE " + Words_DE.User_Name_DE + " = '" + _User_Name_DE + "'", Words_DE.CMS_DE);

if (_dtUsers_DE.Rows.Count > 0 && Password_DE == Basic_Functions_DE.Decrypt_Data_DE(_dtUsers_DE.Rows[0][Words_DE.Password_DE].ToString()))
return _dtUsers_DE.Rows[0][Words_DE.Contact_ID_DE].ToString();

else
return "Error : Invalid UserName Password";
}
#endregion

#region Request_For == "Data"
else if (Request_For == "Data")
{
string _Friendly_Name_DE = _dt["Friendly_Name"];
string _Where_DE = _dt["Where"];
DataSet _DS_DE = new DataSet();
DataTable _dt_DE;//= _DS_DE.Tables.Add();

Assembly _Assembly = Assembly.GetAssembly(typeof(AbsBC_DE));
string _DLL = Words_DE.DE_Divine_Campus + ".bc" + _Friendly_Name_DE;
Type _Type = _Assembly.GetType(_DLL);
AbsBC_DE _AbsBC_DE = Activator.CreateInstance(_Type, new object[] { new DataSet() }) as AbsBC_DE;
_dt_DE = _AbsBC_DE.getData_DE(Where_Clause_DE: _Where_DE, Select_Child_DE: true);
return json.Serialize(_AbsBC_DE.DS_DE);
}
#endregion

#region Request_For == "Structure"
else if (Request_For == "Structure")
{
string _Friendly_Name_DE = _dt["Friendly_Name"];

DataTable _dt_DE;

Assembly _Assembly = Assembly.GetAssembly(typeof(AbsBC_DE));
string _DLL = Words_DE.DE_Divine_Campus + ".bc" + _Friendly_Name_DE;
Type _Type = _Assembly.GetType(_DLL);
AbsBC_DE _AbsBC_DE = Activator.CreateInstance(_Type, new object[] { new DataSet() }) as AbsBC_DE;
_dt_DE = clsConnection.getModel_Data_DE(BusinessObj_DE: _AbsBC_DE, Where_Clause_DE: "1=2");
_dt_DE.Clear();
_AbsBC_DE.Add_New_Row_DE(null);
return json.Serialize(_AbsBC_DE.DS_DE);
}
#endregion

#region Request_For == "Transaction"
else if (Request_For == "Transaction")
{
string _Friendly_Name_DE = _dt["Friendly_Name"];
// string Table = _dt["Table"];
try
{
Json json1 = new Json();
DataSet _ds = new DataSet();
_ds = (DataSet)json.Deserialize(Table, typeof(DataSet));

DataTable _dt_DE;
Assembly _Assembly = Assembly.GetAssem
Sampath Lokuge 12-Mar-14 2:45am    
What's your Inner exception error message ?
[no name] 12-Mar-14 2:47am    
---------------------------
Error
---------------------------
The remote server returned an error: (404) Not Found.

at System.Net.HttpWebRequest.GetResponse()

at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
---------------------------
OK
---------------------------
ZurdoDev 12-Mar-14 7:30am    
404 means it isn't there.

1 solution

The Error Message itself depicts that there is some problem in web service communication(configuration problem or connection problem).

-->By seeing your url first confirms that you are accessing service from the same machine where your service is located. as localhost is present in URL if that is not the case then please change localhost with the ip address or machine name where exactly your service is deployed. (silly suggestion but might be a problem).

-->Second thing please verify that URL is correct and there is no problem with the URL u had configured in your browser.

--> Third thing try to access the http://localhost:999/DE.Web/WCFServices/DE_Service.svc[^] service from where u are runnning your code by pasting above url in your browser.

if it fails then your service is not in running mode.

Please check above steps and if it still not running then there might be some connection issue between service and consumer application


Hope it helps.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900