Question : Cisco IP Services - XML Application - Error (Resource Cannot be found)

Hi Experts

I am new to Cisco IP Service application development. I am trying to run one of the sample services (Stock Ticker and Stock Chart) but I am getting errors that I have tried to debug but with no luck at all. Your help is much needed please.

Stock Ticker:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
<%@ Language=JavaScript%>
<%
var serverIP;
serverIP = Request.ServerVariables("LOCAL_ADDR");

Response.AddHeader("Refresh", "60; url=http://" + serverIP + "/StockTicker/ecn.asp");

Response.ContentType = "text/xml";

Response.Write("<CiscoIPPhoneText>\r\n");
Response.Write("<Title>JPM Stock Ticker</Title>\r\n");
Response.Write("<Prompt></Prompt>\r\n");
Response.Write("<Text>");

		var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
		xmlhttp.Open("GET", "http://finance.yahoo.com/d/quotes.csv?s=CSCO&f=st5l9c6p4b1a3&e=csvt", false);
		var rawdata = xmlhttp.responseXML;
		xmlhttp.Send();
			
		var data = String(rawdata).split(",");	
		Response.Write("Symbol ("+ String(data[0]) + "\r");
		Response.Write("Symbol ("+ String(data[0]).replace(/\"/ig, "") + ") " + data[2] + "\r");	
		Response.Write("Time: " + String(data[1]).replace(/\"/ig, "") + "\r");
		Response.Write("Change: " + String(data[3]).replace(/\"/ig, "") + "\r");
		Response.Write("Percent: " + String(data[4]).replace(/\"/ig, "") + "\r");
		Response.Write("Bid: " + data[5] + "\t\tAsk: " + data[6]);
		
Response.Write("</Text>\r\n");
Response.Write("</CiscoIPPhoneText>\r\n");

Response.End();
Session.Abandon();


When I run it (in a browser) I get "Resource cannot be located", and when I run in the phone it just says requesting then does nothing.

---------------------------------------------------

Stock Chart
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
<%@ Language=JavaScript %>
<%

try
	{
	var Inet1 = new ActiveXObject("CiscoURLProxy.URLGrabber");               // Create the proxy object
	var rawdata = Inet1.GetURL("http://ichart.yahoo.com/t?s=csco", 1);           // Get the gif from Yahoo... Note the "1" as the second parameter tells the component ByteArray. Its in the proxy doc...
	var cip = new ActiveXObject("CIPIMAGE.ImageProcessor.1");                // Create my cip object
	var serverIP = Request.ServerVariables("LOCAL_ADDR");
	var d = new Date();
	var hour = d.getHours();
	var chartarray = new Array();

	cip.LoadPNGFromBuffer(rawdata);	                                         // Load the byte array
	cip.RGBToPalette();                                                      // I don't know if the source is RGB or a palette so I to this anyway. It doesn't hurt...
	cip.ColorToGray();                                                       // reduce the colors to grayscale
	cip.ReducePaletteColors(4);                                              // reduce the palette to 4 colors. (2-bit)

	var rawchartdata = cip.SaveCIPDataToBuffer();

	Response.Buffer = true;	
	Response.ContentType = "text/xml";                                       // Don't forget the xml mime type header we all love...
	Response.Write("<CiscoIPPhoneImage>\r\n<LocationX>-1</LocationX>\r\n<LocationY>-1</LocationY>\r\n<Width>132</Width>\r\n<Height>64</Height>\r\n<Depth>2</Depth>\r\n<Data>");

	
	for (var i = 0; i < 96; i++)
		{
		chartarray[i] = String(rawchartdata).substr(i * 96, 96);
		}

	for (var i = 13; i < 77; i++)
		{
		Response.Write(String(chartarray[i]).substr(2, 20)); // Show Numbers
		
		hour = d.getHours();
		
		if (Number(hour) < 13) // If before 1:00pm show left side of graph
			{
			Response.Write(String(chartarray[i]).substr(22, 42));
			}
		else if (Number(hour) < 14) // If after 1:00 pm and before 2:00pm show left side of graph
			{
			Response.Write(String(chartarray[i]).substr(32, 42));
			}
		else if (Number(hour) < 15) // If after 2:00 pm and before 3:00pm show left side of graph
			{
			Response.Write(String(chartarray[i]).substr(42, 42));
			}
		else // after 3:00pm show right side of graph
			{
			Response.Write(String(chartarray[i]).substr(46, 42));	
			}
		
		Response.Write(String(chartarray[i]).substr(90, 4));
		}

	Response.Write("</Data>\r\n<Prompt>CSCO Intra-day Chart</Prompt></CiscoIPPhoneImage>\r\n");

	Response.Flush(); // Flush by bufferd response 
	}
catch (err)
	{
	Response.Write("Error: " + err.description + ", " + err.number.toString(16)); // Yeah right, we won't have any errors....
	} 
 Response.End();
%>


When I run this I get (on the browser IE) "Permission Denied" and same on the phone too.




I have installed all the requirements (iis, ciscourlproxy, cip, etc)
I really need to make this work.

Thanks

Answer : Cisco IP Services - XML Application - Error (Resource Cannot be found)

None of the above suggestions worked. This is what worked for me-->

Thanks you guys for your help.

Much appreciated.
1:
2:
3:
4:
var rawdata;
Inet1 = new ActiveXObject("CiscoURLProxy.URLGrabber");
rawdata = Inet1.GetURL("http://finance.yahoo.com/d/quotes.csv?s=JPM&f=st5l9c6p4b1a3&e=csv");
Inet1 = "";
Random Solutions  
 
programming4us programming4us