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


Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16) picture

Dec/Adac Corp. D4-10390 Rev 6 Model 1664ATTL Output Pulse Board 1983 (B16)

$189.99



VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250 picture

VINTAGE Bruker Board DEC W4P3042 for SpectroSpin 250

$99.99



Niedermaier vintage Mannequins Visual Display Props Dec. 1991 Catalogue picture

Niedermaier vintage Mannequins Visual Display Props Dec. 1991 Catalogue

$141.00



HSS 12pcs Valve Seat & Face Cutter 45dec 30dec 20dec for Vintage Car, Bikes ,Jee picture

HSS 12pcs Valve Seat & Face Cutter 45dec 30dec 20dec for Vintage Car, Bikes ,Jee

$235.94



Adec Vintage Adjusting Dentist Doctor Medical Stool Rolling Swivel Chair picture

Adec Vintage Adjusting Dentist Doctor Medical Stool Rolling Swivel Chair

$199.99



Sketchy Chics - June 2021 - December 2022. Vintage Collection Art picture

Sketchy Chics - June 2021 - December 2022. Vintage Collection Art

$22.50







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