Welcome to HostingForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

A deployed web aspx page does not display response over th..

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  Httperr.log: xxx_Connections_Refused  
Author Message
chike_oji

External


Since: Feb 22, 2008
Posts: 2



(Msg. 1) Posted: Fri Feb 22, 2008 5:18 am
Post subject: A deployed web aspx page does not display response over the internet
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hello all,

please I need help with an a web app that I
am developing.
The application was deployed our server in my country
and it was accessible over the internet from our clients.

Later due to QOS issues, we decided to host the app
on our dedicated server in the UK.

I re-deployed the app on the server via remote access means and
tested it out on the local machine using the hostname "localhost".
It worked but anytime I try to access it from over the internet from
another machine in
a different geographical location, the default.aspx page works,
displaying its content but the
main page (waspprovider.aspx) that sends data from the database as a
HttpResponse object,
doesn't display anything but the page gets hit.

The contents of the working Default.aspx page is as follows:

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome to Visafone web content provision web application.</
div>
</form>
</body>
</html>


The content of the waspprovider.aspx.cs page is as follows:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System .Collections.Generic ;
using System.Data.SqlClient;



using A3MessageProcessing;
using A3MessageTransaction;

//using Guinnesspromo;

public partial class Rawurl : System.Web.UI.Page
{
private string _shortcode =
System.Configuration.ConfigurationManager.AppSettings["shortcode"],
_username =
System.Configuration.ConfigurationManager.AppSettings["username"] ,
_password =
System.Configuration.ConfigurationManager.AppSettings["password"],
_port =
System.Configuration.ConfigurationManager.AppSettings["port"],

servicename = null ;

public string shortcode
{
get { return _shortcode; }

}

public string username
{
get { return _username; }

}

public string password
{
get { return _password; }

}

public string port
{
get { return _port; }

}

string responseString = null ;




protected void Page_Load(object sender, EventArgs e)
{

try
{
Page.Title = "";
TransactionInfo tif = new TransactionInfo();
responseString = "Thank you... [Iconcepts TECH.]";

//if (Page.Request.RawUrl.Contains("sms_src_addr=") &&
Page.Request.RawUrl.Contains("sms_dest_addr=") &&
Page.Request.RawUrl.Contains("sms_text="))
if (Page.Request.RawUrl.Contains("sms_src_addr=") &&
Page.Request.RawUrl.Contains("sms_text="))
{
NameValueCollection queryString =
Page.Request.QueryString;


// from here ...
if (Page.Request.RawUrl.Contains("username="+username ) &&
Page.Request.RawUrl.Contains("password="+password))
{
//string gsm = getQueryStringValue("sms_dest_addr",
queryString).Trim();
string gsm = "xxxxx;//Hard code the sms_dest_addr
specifically for visafone/UCIas they requested not to see that
querystring.



if (gsm == shortcode)
{

// Correct format analysis
tif.m_shortCode = gsm;
tif.m_msisdn = getQueryStringValue("sms_src_addr",
queryString);
//tif.m_destAddressIn =
getQueryStringValue("sms_dest_addr", queryString);
tif.m_destAddressIn = gsm;
tif.m_bodyIn = getQueryStringValue("sms_text",
queryString);
string mid = getQueryStringValue("sms_id",
queryString);
tif.m_dateIn = DateTime.Now.ToString("dd-MM-yyyy
HH:mm:ss");
//tif.m_destAddressIn = gsm; This line is a
repetition and duplication of effort. Consider deleting this line.
//bool toGlo = SendGLOMessage(tif, mid, out
responseString);
tif.m_operatorID = OperatorID.Globacom;//This was
left till the creation of a Visafone element in the Enum. Doesn't
cause any problems.

try
{
TransactionInfoProcessor smsobject = null;
smsobject = new Iconceptservices();
if (smsobject != null)
smsobject.processTransactionInfo(tif);
// tif.m_bodyOut = "Thank you for
playing ...";

bool bl = LogToDatabase(tif);

}
catch (Exception er)
{


}

responseString = tif.m_bodyOut;

}

else
{
responseString = "Invalid Login Credentials! [" +
DateTime.Now.ToString() + "Iconcepts";

}
}
else
{
responseString = "Wrong msg format. Port is still
alive! [" + DateTime.Now.ToString() + "Iconcepts";

}
}



//Make sure the response string length is not greater than
160.
if (responseString.Length > 160)
{
responseString = responseString.Substring(0,
160);
}
//Trying to implement


// Obtain a response object
HttpResponse httpresponse = Page.Response;
byte[] buffer = Encoding.UTF8.GetBytes(responseString);

// Get a response stream and write the response to it
// httpresponse.ContentLength64 = buffer.Length;
httpresponse.ContentType = "text/plain";
//Trying to implement returning error 404 if there is no
content
if (responseString.StartsWith("no content for the day"))
{
httpresponse.StatusCode = 404; httpresponse.Status =
"404 Not Found";
httpresponse.OutputStream.Write(buffer, 0,
buffer.Length);
httpresponse.Flush(); httpresponse.Close();
}
else//everything is ok here.i.e content is returned and
client billed.
{
httpresponse.OutputStream.Write(buffer, 0,
buffer.Length);
httpresponse.Flush(); httpresponse.Close();
}

}
catch (Exception exception)
{
//Console.WriteLine(exception.Message);
//Console.WriteLine(exception.StackTrace);
}

finally
{
// do neccessary task here ...
}

return;


}

private static String getQueryStringValue(String keyName,
NameValueCollection queryString)

{

String keyValue = null;

// Get each header and display each value
foreach (String key in queryString.AllKeys)
{
if (keyName.ToLower().CompareTo(key.ToLower()) == 0)
{
keyValue = queryString[key];
}
}

return keyValue;
}


// logging sms messages to mg_transaction_log for persistent
reference ...
private static bool LogToDatabase(TransactionInfo tif)
{
Dictionary<string, Procedure_Values> dictionary = new
Dictionary<string, Procedure_Values>();
Procedure_Values procedure = null;
procedure = new Procedure_Values();

SqlParameter operatorID = null;
procedure.pname = "operatorID";
procedure.sqlparameter = operatorID;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = "VISAFONE";

procedure.size = 25;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

procedure = new Procedure_Values();
SqlParameter msisdn = null;
procedure.pname = "msisdn";
procedure.sqlparameter = msisdn;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = tif.m_msisdn;
procedure.size = 15;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

procedure = new Procedure_Values();
SqlParameter shortcode = null;
procedure.pname = "shortcode";
procedure.sqlparameter = shortcode;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = tif.m_shortCode;
procedure.size = 50;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);


procedure = new Procedure_Values();
SqlParameter servicename = null;
procedure.pname = "servicename";
procedure.sqlparameter = servicename;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = tif.m_idOut;
procedure.size = 15;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

procedure = new Procedure_Values();
SqlParameter log_date = null;
procedure.pname = "log_date";
procedure.sqlparameter = log_date;
procedure.sqldbtype = SqlDbType.DateTime;
procedure.dvalue = DateTime.Now;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);


procedure = new Procedure_Values();
SqlParameter message_body_in = null;
procedure.pname = "message_body_in";
procedure.sqlparameter = message_body_in;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = tif.m_bodyIn;
procedure.size = 160;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

procedure = new Procedure_Values();
SqlParameter message_body_out = null;
procedure.pname = "message_body_out";
procedure.sqlparameter = message_body_out;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = tif.m_bodyOut;
procedure.size = 160;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

procedure = new Procedure_Values();
SqlParameter guid = null;
procedure.pname = "guid";
procedure.sqlparameter = guid;
procedure.sqldbtype = SqlDbType.VarChar;
procedure.svalue = "visafonehttp" + DateTime .Now .ToString
("yyyy-MM-dd-hh:mm:ssss");
procedure.size = 75;
procedure.direction = ParameterDirection.Input;
dictionary.Add(procedure.pname, procedure);

ProcedureHandler prchandler = new ProcedureHandler();
string sconnect =
System.Configuration.ConfigurationManager.AppSettings["localConn"];
// prchandler.connectionstring = sconnect;
if (!(prchandler.proceduredetails("prctransactionlog",
dictionary)))
return false;

else if (tif.m_bodyOut.Trim() == "message unprocessed")
return false;
else
return true;
}
}


Thanks in advance for any help.

Regards,

Chike.

 >> Stay informed about: A deployed web aspx page does not display response over th.. 
Back to top
Login to vote
chike_oji

External


Since: Feb 22, 2008
Posts: 2



(Msg. 2) Posted: Fri Feb 22, 2008 8:17 am
Post subject: Re: A deployed web aspx page does not display response over the [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I wanted to add that the OS on the UK server is
Microsoft Server 2003 Standard edition Service Pack 2
and it has IIS 6.0 webserver running on it.

Thanks.

Regards,

Chike

On Feb 22, 2:18 pm, wrote:
> Hello all,
>
> please I need help with an a web app that I
> am developing.
> The application was deployed our server in my country
> and it was accessible over the internet from our clients.
>
> Later due to QOS issues, we decided to host the app
> on our dedicated server in the UK.
>
> I re-deployed the app on the server via remote access means and
> tested it out on the local machine using the hostname "localhost".
> It worked but anytime I try to access it from over the internet from
> another machine in
> a different geographical location, the default.aspx page works,
> displaying its content but the
> main page (waspprovider.aspx) that sends data from the database as a
> HttpResponse object,
> doesn't display anything but the page gets hit.
>
> The contents of the working Default.aspx page is as follows:
>
> <%@ Page Language="C#" AutoEventWireup="true"
> CodeFile="Default.aspx.cs" Inherits="_Default" %>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
> <html xmlns="http://www.w3.org/1999/xhtml" >
> <head runat="server">
> <title>Untitled Page</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> Welcome to Visafone web content provision web application.</
> div>
> </form>
> </body>
> </html>
>
> The content of the waspprovider.aspx.cs page is as follows:
>
> using System;
> using System.Data;
> using System.Configuration;
> using System.Collections;
> using System.Collections.Specialized;
> using System.Web;
> using System.Web.Security;
> using System.Web.UI;
> using System.Text;
> using System.Web.UI.WebControls;
> using System.Web.UI.WebControls.WebParts;
> using System.Web.UI.HtmlControls;
> using System .Collections.Generic ;
> using System.Data.SqlClient;
>
> using A3MessageProcessing;
> using A3MessageTransaction;
>
> //using Guinnesspromo;
>
> public partial class Rawurl : System.Web.UI.Page
> {
> private string _shortcode =
> System.Configuration.ConfigurationManager.AppSettings["shortcode"],
> _username =
> System.Configuration.ConfigurationManager.AppSettings["username"] ,
> _password =
> System.Configuration.ConfigurationManager.AppSettings["password"],
> _port =
> System.Configuration.ConfigurationManager.AppSettings["port"],
>
> servicename = null ;
>
> public string shortcode
> {
> get { return _shortcode; }
>
> }
>
> public string username
> {
> get { return _username; }
>
> }
>
> public string password
> {
> get { return _password; }
>
> }
>
> public string port
> {
> get { return _port; }
>
> }
>
> string responseString = null ;
>
> protected void Page_Load(object sender, EventArgs e)
> {
>
> try
> {
> Page.Title = "";
> TransactionInfo tif = new TransactionInfo();
> responseString = "Thank you... [Iconcepts TECH.]";
>
> //if (Page.Request.RawUrl.Contains("sms_src_addr=") &&
> Page.Request.RawUrl.Contains("sms_dest_addr=") &&
> Page.Request.RawUrl.Contains("sms_text="))
> if (Page.Request.RawUrl.Contains("sms_src_addr=") &&
> Page.Request.RawUrl.Contains("sms_text="))
> {
> NameValueCollection queryString =
> Page.Request.QueryString;
>
> // from here ...
> if (Page.Request.RawUrl.Contains("username="+username ) &&
> Page.Request.RawUrl.Contains("password="+password))
> {
> //string gsm = getQueryStringValue("sms_dest_addr",
> queryString).Trim();
> string gsm = "xxxxx;//Hard code the sms_dest_addr
> specifically for visafone/UCIas they requested not to see that
> querystring.
>
> if (gsm == shortcode)
> {
>
> // Correct format analysis
> tif.m_shortCode = gsm;
> tif.m_msisdn = getQueryStringValue("sms_src_addr",
> queryString);
> //tif.m_destAddressIn =
> getQueryStringValue("sms_dest_addr", queryString);
> tif.m_destAddressIn = gsm;
> tif.m_bodyIn = getQueryStringValue("sms_text",
> queryString);
> string mid = getQueryStringValue("sms_id",
> queryString);
> tif.m_dateIn = DateTime.Now.ToString("dd-MM-yyyy
> HH:mm:ss");
> //tif.m_destAddressIn = gsm; This line is a
> repetition and duplication of effort. Consider deleting this line.
> //bool toGlo = SendGLOMessage(tif, mid, out
> responseString);
> tif.m_operatorID = OperatorID.Globacom;//This was
> left till the creation of a Visafone element in the Enum. Doesn't
> cause any problems.
>
> try
> {
> TransactionInfoProcessor smsobject = null;
> smsobject = new Iconceptservices();
> if (smsobject != null)
> smsobject.processTransactionInfo(tif);
> // tif.m_bodyOut = "Thank you for
> playing ...";
>
> bool bl = LogToDatabase(tif);
>
> }
> catch (Exception er)
> {
>
> }
>
> responseString = tif.m_bodyOut;
>
> }
>
> else
> {
> responseString = "Invalid Login Credentials! [" +
> DateTime.Now.ToString() + "Iconcepts";
>
> }
> }
> else
> {
> responseString = "Wrong msg format. Port is still
> alive! [" + DateTime.Now.ToString() + "Iconcepts";
>
> }
> }
>
> //Make sure the response string length is not greater than
> 160.
> if (responseString.Length > 160)
> {
> responseString = responseString.Substring(0,
> 160);
> }
> //Trying to implement
>
> // Obtain a response object
> HttpResponse httpresponse = Page.Response;
> byte[] buffer = Encoding.UTF8.GetBytes(responseString);
>
> // Get a response stream and write the response to it
> // httpresponse.ContentLength64 = buffer.Length;
> httpresponse.ContentType = "text/plain";
> //Trying to implement returning error 404 if there is no
> content
> if (responseString.StartsWith("no content for the day"))
> {
> httpresponse.StatusCode = 404; httpresponse.Status =
> "404 Not Found";
> httpresponse.OutputStream.Write(buffer, 0,
> buffer.Length);
> httpresponse.Flush(); httpresponse.Close();
> }
> else//everything is ok here.i.e content is returned and
> client billed.
> {
> httpresponse.OutputStream.Write(buffer, 0,
> buffer.Length);
> httpresponse.Flush(); httpresponse.Close();
> }
>
> }
> catch (Exception exception)
> {
> //Console.WriteLine(exception.Message);
> //Console.WriteLine(exception.StackTrace);
> }
>
> finally
> {
> // do neccessary task here ...
> }
>
> return;
>
> }
>
> private static String getQueryStringValue(String keyName,
> NameValueCollection queryString)
>
> {
>
> String keyValue = null;
>
> // Get each header and display each value
> foreach (String key in queryString.AllKeys)
> {
> if (keyName.ToLower().CompareTo(key.ToLower()) == 0)
> {
> keyValue = queryString[key];
> }
> }
>
> return keyValue;
> }
>
> // logging sms messages to mg_transaction_log for persistent
> reference ...
> private static bool LogToDatabase(TransactionInfo tif)
> {
> Dictionary<string, Procedure_Values> dictionary = new
> Dictionary<string, Procedure_Values>();
> Procedure_Values procedure = null;
> procedure = new Procedure_Values();
>
> SqlParameter operatorID = null;
> procedure.pname = "operatorID";
> procedure.sqlparameter = operatorID;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = "VISAFONE";
>
> procedure.size = 25;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter msisdn = null;
> procedure.pname = "msisdn";
> procedure.sqlparameter = msisdn;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = tif.m_msisdn;
> procedure.size = 15;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter shortcode = null;
> procedure.pname = "shortcode";
> procedure.sqlparameter = shortcode;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = tif.m_shortCode;
> procedure.size = 50;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter servicename = null;
> procedure.pname = "servicename";
> procedure.sqlparameter = servicename;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = tif.m_idOut;
> procedure.size = 15;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter log_date = null;
> procedure.pname = "log_date";
> procedure.sqlparameter = log_date;
> procedure.sqldbtype = SqlDbType.DateTime;
> procedure.dvalue = DateTime.Now;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter message_body_in = null;
> procedure.pname = "message_body_in";
> procedure.sqlparameter = message_body_in;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = tif.m_bodyIn;
> procedure.size = 160;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter message_body_out = null;
> procedure.pname = "message_body_out";
> procedure.sqlparameter = message_body_out;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = tif.m_bodyOut;
> procedure.size = 160;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> procedure = new Procedure_Values();
> SqlParameter guid = null;
> procedure.pname = "guid";
> procedure.sqlparameter = guid;
> procedure.sqldbtype = SqlDbType.VarChar;
> procedure.svalue = "visafonehttp" + DateTime .Now .ToString
> ("yyyy-MM-dd-hh:mm:ssss");
> procedure.size = 75;
> procedure.direction = ParameterDirection.Input;
> dictionary.Add(procedure.pname, procedure);
>
> ProcedureHandler prchandler = new ProcedureHandler();
> string sconnect =
> System.Configuration.ConfigurationManager.AppSettings["localConn"];
> // prchandler.connectionstring = sconnect;
> if (!(prchandler.proceduredetails("prctransactionlog",
> dictionary)))
> return false;
>
> else if (tif.m_bodyOut.Trim() == "message unprocessed")
> return false;
> else
> return true;
> }
> }
>
> Thanks in advance for any help.
>
> Regards,
>
> Chike.

 >> Stay informed about: A deployed web aspx page does not display response over th.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]