BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-15-2006, 11:40 AM   #1
phil76
New Member
 
Join Date: Dec 2006
Model: 7290
Posts: 2
Default 404 when writing page to the requeststream for a push

Please Login to Remove!

Hello, the following code returns a 404 not found error when I use the development MDS server, however this works fine on the simulator and localhost MDS. Its just a sample to push out a web page onto the bb browser. Any ideas why? Sounds to me like the "push" listener on the dev box isnt listening, otherwise the request wouldnt yield a 404. I didnt configure this server and Im relatively new to the MDS/PUSH thing. Any ideas what the heck it could be? The device 202e6ed6 is registered on the server btw.

string resp = push("202e6ed6", "ht" + "tp://" + "www" + ".rbc.com", "Testing");
Response.Write("PUSH RETURNED: " + resp);

private string push(string to, string href, string title)
{
HttpWebRequest contentRequest = (HttpWebRequest)WebRequest.Create(href);
HttpWebResponse contentResponse = (HttpWebResponse)contentRequest.GetResponse();
byte[] data;

if (contentResponse.StatusCode == HttpStatusCode.OK)
{
WebHeaderCollection headers = contentResponse.Headers;
Stream responseStream = contentResponse.GetResponseStream();
StreamReader reader = new StreamReader(responseStream);
data = getDataFromStream(reader);
reader.Close();

string besaddress = "mydevserver.rbc.com";
string besport = "8080";
string url = "ht" + "tp://" + besaddress + ":" + besport + "/push?DESTINATION=" + to + "&PORT=7874" + "&REQUESTURI=/";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

request.Method = "POST";
request.Headers.Add("Content-Location", href);
request.Headers.Add("X-RIM-Push-Title", title);
request.Headers.Add("X-RIM-Push-Type", "Browser-Message");
request.ContentType = "text/html";
request.ContentLength = data.Length;

Stream requestStm = request.GetRequestStream();
requestStm.Write(data,0,data.Length);

HttpWebResponse response = (HttpWebResponse)request.GetResponse();
requestStm.Close();
response.Close();
if (response.StatusCode==HttpStatusCode.OK)
{
return "pushed";
}else
{
return "failed push";
}
}else
{
return "page not found";
}

}
Offline  
Old 12-15-2006, 12:35 PM   #2
phil76
New Member
 
Join Date: Dec 2006
Model: 7290
Posts: 2
Default

Also, when i access the service through a browser my mds responds but not the dev one:

ht tp://localhost:8080/push?
=====================
HTTP Status 400 - PushServlet: FAILED -#06 net.rim.ippp.a.b.c.ad.iq: DESTINATION parameter is missing or null

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

type Status report

message PushServlet: FAILED -#06 net.rim.ippp.a.b.c.ad.iq: DESTINATION parameter is missing or null

description The request sent by the client was syntactically incorrect (PushServlet: FAILED -#06 net.rim.ippp.a.b.c.ad.iq: DESTINATION parameter is missing or null ).


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

Apache Tomcat/5.5.9

ht tp://mydevserver.rbc.com:8080/push?
==============================
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage V-Mac Industries Inc. Pipe Threader Vosper Drophead Threader - READ picture

Vintage V-Mac Industries Inc. Pipe Threader Vosper Drophead Threader - READ

$199.00



Vintage MAC Knife Japan 4.75

Vintage MAC Knife Japan 4.75" Folding Lock Blade Knife Chef Pocket Knife Utility

$224.99



Vintage Mac Warehouse  3.5” Floppy Disk Solar Powered Calculator Company Swag picture

Vintage Mac Warehouse 3.5” Floppy Disk Solar Powered Calculator Company Swag

$66.60



VINTAGE RICHARD PETTY #43 MAC TOOLS RACING RED MAGNETIC CAR FENDER COVER picture

VINTAGE RICHARD PETTY #43 MAC TOOLS RACING RED MAGNETIC CAR FENDER COVER

$72.00



Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower picture

Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower

$55.24



Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver  picture

Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver

$40.00







Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.