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


IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79



OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$49.99



OEM IBM 2210 2210-12E Switch 16MD DRAM picture

OEM IBM 2210 2210-12E Switch 16MD DRAM

$175.00



IBM Selectric Part OEM 1141763 13

IBM Selectric Part OEM 1141763 13" Velocity Cable

$13.45



IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts picture

IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts

$28.00



IBM Selectric Part OEM 1141765 15

IBM Selectric Part OEM 1141765 15" Velocity Cable

$13.45







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