http://supportforums.blackberry.com/t5/Java-Development/Java-io-ioException-Tunnel-Timed-out-received/td-p/432968
Here's the source code download page for the RIM network diagnostic tool:
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is_-_Network_Diagnostic_Tool.html?nodeid=1450596&vernum=0
There is a mid/high level approach to the subscription process using new classes in blackberry OS6 from the dev guide as follows:
http://docs.blackberry.com/id-id/developers/deliverables/29215/Subscribe_to_a_BPS_content_provider_1226150_11.jsp
mport the required classes and interfaces.
import net.rim.device.api.io.messaging.*;
2.
Initialize a NonBlockingReceiverDestination variable to manage the subscription.
NonBlockingReceiverDestination nbrd = null;
3.
Create a MessageListener object to process incoming push messages.
try {
4.
MyMessageListener pushListener = new MyMessageListener();
Create a URI object with the port information that the content provider assigns to you.
URI pushURI = URI.create("http://:101");
5.
Create an InboundDestinationConfiguration object to set parameters for the push subscription.
InboundDestinationConfiguration config =
InboundDestinationConfigurationFactory.createBPSConfiguration
(true, // start this application when a push message arrives
false, // allow other applications to receive these push messages
false, // do not store these messages (persistence not supported)
"12-Ab234cD5eF67h890", // application ID,
BPSuri); // BlackBerry Push Service URI
6.
Create a NonBlockingReceiverDestination.
nbrd = DestinationFactory.createNonBlockingReceiverDestination
(config, pushURI, pushListener);
7.
Create a SenderDestination to send a subscription message.
13
Development Guide
Sending login information to an HTTP server
NonBlockingSenderDestination bpsDestination =
DestinationFactory.createNonBlockingSenderDestination
(myContext, uri, responseListener);
8.
Configure a subscription message.
ByteMessage subMsg =
BpsSubscriptionMessageBuilder.createByteSubscriptionMessage
(bpsDestination, nbrd, "user", "pwd");
9.
Send the subscription message.
bpsDestination.send();
Step six of the above process throws an InvalidScheme IOException. Something about "http" it doesn't like.
The above process hides a few details of the procedure. It opens a local socket listener on the port assigned to you by RIM, (101 in the above example) and then connects to the service and sends a subscription message.
I've found a low level HttpConnection and standard XML string based approach in a Blackberry Forum posting (RIM knowledgebase) which is throwing the Tunnel Exception. I'll post that link when I find it again.
The container should be configurable, with respect to what specific device integration capabilities are included.