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


Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



Vintage Holt Commodore Commercial Floor Scrubber Polisher Buffer Burnisher picture

Vintage Holt Commodore Commercial Floor Scrubber Polisher Buffer Burnisher

$599.99



Mitsubishi Control Board DM00N649.  SM76A127G02 . Ductless unit 47-0910KR (C64) picture

Mitsubishi Control Board DM00N649. SM76A127G02 . Ductless unit 47-0910KR (C64)

$120.00



3D MULTIMEDIA VIDEO CARD C64/V2 1MB picture

3D MULTIMEDIA VIDEO CARD C64/V2 1MB

$94.05



Kenwood TK290 TK-290 VHF 146-174 160ch 5watt DTMF Radio with charger/Antenna C64 picture

Kenwood TK290 TK-290 VHF 146-174 160ch 5watt DTMF Radio with charger/Antenna C64

$75.75



POLAR PLASTICS C64 Construction Film,6x100,4Mil,Clear PK 4 picture

POLAR PLASTICS C64 Construction Film,6x100,4Mil,Clear PK 4

$178.04







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