07-29-2008 12:35 PM
Blackberry Simulator-> Blackberry 8300 smartphone(EDGE) v188.8.131.52 (JDE 4.5)
MDS Simulator-> Version contained with JDE 4.5
Issue: I am currently writing an application which needs to communicate with a JBoss server. I am running the server on my localhost at port 8080. I have modified the MDS to listen on 9080.
I am trying to execute the following code from the simulator which is attempting to communicate
with my servlet at the address specified:
HttpConnection httpConnection = (HttpConnection)Connector.open("http://192.168.1.100:8080/RemoteCellTestServer/co
httpConnection.setRequestMethod(HttpConnection.POST);httpConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");String params = "action=saveSMS&address=1234543&message=sheesh&id=
httpConnection.setRequestProperty("action", "saveSMS");httpConnection.setRequestProperty("address", "43234542");
String response = httpConnection.getResponseMessage();System.out.println("RESP:ID" + httpConnection.getHeaderField("id"));
System.out.println("RESP:ADDR" + httpConnection.getHeaderField("address"));System.out.println("RESP:MSG" + httpConnection.getHeaderField("message"));
I have results as follows:
If I use localhost or the loopback addr 127...... I recv a 403 error
If I use the address above from ipconfig on windows i get a 400 bad request. I have seen several threads with regards to this but everyone
else seems to be needing a proxy. I am not in a corporate env and don't
need a proxy. It simply appears that MDS will not allow me to connect
to the localhost which I need to do ASAP to develop the server side
for our application.
Your assistance is greatly appreciated.
07-29-2008 01:24 PM
The MDS Simulator does not allow connections to localhost or 127.0.0.1. Instead, you should be able to use your actual IP address or machine name of your PC.
Do you have any local firewalls on your PC that could be blocking the connection?
07-29-2008 01:50 PM
Thanks for the quick response. I have disabled the firewalls and I am still unable to connect to the address from ipconfig. I recv a bad request 400 and my server is not receiving the request. One thing to note when pinging my local host by name it returns an IPv6 address is this supported by the MDS environment? Is there anything I can do in the configuration of the MDS env to allow connection to the localhost or loopback?
07-30-2008 11:05 AM
Does your PC also have an IPv4 address? Your code sample above shows a URL with an IPv4 address.
Please enable verbose logging in the MDS Simulator by following the steps here:
How To - Enable HTTP and HTML logging in the Mobile Data Service Simulator
Please also add the following 2 lines if they are not present.
Then post the log file found in C:\Program Files\Research In Motion\BlackBerry JDE 4.5.0\MDS\logs. It should have a .txt extension and the current date.
08-07-2008 12:27 PM
I have configured the environment as prescribed and have generated a log file. Is there a way to post the log file?
The limit is 20,000 characters per post thus the post of the log content is failing.
Note: I disabled IPv6 with no change in result.
08-07-2008 03:33 PM
Sorry for the inconvenience. After investigating the logs for both MDS and JBoss I have found that with the version of JBoss I am using (4.2.2) they are no longer binding to 0.0.0.0. I restarted the server with a param to bind to the IP of my host and it works fine. Once again I apologize for the inconvenience.
11-06-2008 07:34 PM
I´m experiencing the same problem.
I want to connect to my localhost, I got the ip and it resposes http error 403, forbiden
I can browse it from explorer, but not in the BB simulator.
If I connect from other computer to the server, It asks me for login and password, then I browse the services.
Some one knows how to solve it?
I´m getting frustrated with this!
Thanks in advance!
11-06-2008 08:07 PM
I have found that remapping the host name on my test system works best for me. This way, I don't have to worry about changing the URL back to the production value before I do a distribution build.
Edit the file windows/system32/etc/hosts and add an entry like this:
"127.0.0.1 www.foobar.com" (substitute your host URL)
MDS will connect to this fine (in my experience). When you are finished testing just comment out the entry with a '#' character.
Of course, you have to make sure you are doing a "direct" connection when working on the simulator.
11-12-2008 02:34 PM