We are trying to push some XML to the BBs using a Java agent found in one of the samples provided by RIM. The URL we need to push has form http://:/push?DESTINATION=<PIN|EMAIL>&PORT=&REQUESTURI=/ . Does anyone know what is the push Port (the virtual port on the handheld application)here?
sniplet of the code that was copied from the RIM sample:
/**
-
A helper class which makes HTTP connections to Mobile Data Service
-
with the necessary information to push to a custom application
-
Copyright (C) 2003 Research In Motion Ltd.
*/
public class HttpPushWorker {
/**
- Default Constructor is private
*/
public HttpPushWorker()
{
}
/**
* Creates the HTTP push.
* This method first gets the data from the source Page and then 'forwards' it to
* the push connection with all the necessary HTTP headers the Browser uses to
* identify this connection as a HTTP push.
* @param String BESAddress - the address or IP of the BES/MDS
* @param String BESPort - the MDS listening port
* @param String pushPort - the virtual port on the handheld application
* @param String pushPin - the PIN or Email address used as the destination of the push
* @param String pushData - the data to push
*/
public void httpPush(String BESAddress
,String BESPort
,String pushPin
,String pushPort
,String pushData){
// Default values
// Create the push URL for MDS of the following format
// http://<BESAddress>:<BESPort>/push?DESTINATION=<PIN|EMAIL>&PORT=<pushPort>&REQUESTURI=/
StringBuffer sb = new StringBuffer("http://");
sb.append(BESAddress);
sb.append(":");
sb.append(BESPort);
sb.append("/push?DESTINATION=");
sb.append(pushPin);
sb.append("&PORT=");
sb.append(pushPort);
sb.append("&REQUESTURI=/");
String httpURL = sb.toString();
// Make the connection o the MDS
URL pushUrl = null;
HttpURLConnection pushConn = null;
try {
// Open the URL connection for reading header and data
pushUrl = new URL(httpURL);
pushConn = (HttpURLConnection) pushUrl.openConnection();
pushConn.setDoInput(true); // to receive confirmation
pushConn.setDoOutput(true); // to post data
pushConn.setRequestMethod("POST");
Thank you for your input