BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-09-2008, 02:53 AM   #1 (permalink)
New Member
 
Join Date: Jul 2008
Model: 8700
PIN: N/A
Carrier: bb
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default MDS not working with JDE 4.3

Please Login to Remove!

Hi

I'm using Blackberry to develop an application to send data over HTTP. I am posting the data from blackberry to a java servlet (web server).
It is working fine when I am working with JDE 4.2.0 and JDE 4.2.1 .
But not getting data in the java servlet when I send data using JDE 4.3.0 . No exeception printed. And also got the httpConnection.getResponseCode() as 200

I tried with the MDS that come with the JDE4.3 and the MDS in "BlackBerry Email and MDS Services Simulators 4.1.4"

Any help would be appreciated.

below is the code I am using to post data.

url is the path to servlet and
str is the data

Code:
byte[] data = str.getBytes();
int length = data.length;
httpConnection = (HttpConnection) Connector.open(url, Connector.WRITE);
httpConnection .setRequestMethod(HttpConnection.POST);
httpConnection .setRequestProperty("User-Agent",
	"Profile/MIDP-1.0 Configuration/CLDC-1.0");
httpConnection .setRequestProperty("Content-Language", "en-US");
httpConnection .setRequestProperty("Accept",						"application/octet-stream");
httpConnection.setRequestProperty("Content-Length", Integer.toString(length));
output = httpConn.openDataOutputStream();
output.write(data, 0 ,length);
return 0;
Offline  
Old 07-09-2008, 03:41 AM   #2 (permalink)
New Member
 
Join Date: Jul 2008
Model: 8700
PIN: N/A
Carrier: bb
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi thanks to GOD and all forum members/viewers.

the reason was I am immediatly return after writing data, It works fine when I read the inputstream.
Offline  




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