Blackberry got 413 error code requesting web service

Often when i make blackberry applications (for OS 5,6,7) that require me to acquire data from internet using http request i got an error code 413. After try and error, here is how i resolve this problem.



Just for your info, 413 error code is indicating that our request is too large. Here is the details for 413 http error code.
Introduction
The Web server (running the Web site) thinks that the HTTP data stream sent by the client (e.g. your Web browser or our CheckUpDown robot) was simply too large i.e. too many bytes. What constitutes 'too many bytes' depends partly upon the operation being attempted. For example a request to upload a very large file (via the HTTP PUT method) may encounter a ceiling on upload file size set by the Web server.

413 errors in the HTTP cycle
Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle:

  • Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).

  • Open an IP socket connection to that IP address.

  • Write an HTTP data stream through that socket.

  • Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.


This error occurs in the final step above when the client receive an HTTP status code that it recognises as '413'. (Last updated: March 2012).

Fixing 413 errors - general
This error seldom occurs in most Web traffic, particularly when the client system is a Web browser. The problem can only be resolved by examining what your client system is trying to do then discussing with your ISP why the Web server rejects the number of bytes sent by the client system.

Fixing 413 errors - CheckUpDown
This error should simply never occur on your CheckUpDown account. If it does, it typically indicates defective programming of our systems or of the Web server which manages the site. The length of the HTTP data stream we normally send is relatively small and well within the limits of what most Web servers should accept.

Please contact us (email preferred) whenever you encounter 413 errors - there is nothing you can do to sort them out. We then have to liaise with your ISP and the vendor of the Web server software to agree the exact reason for the error.


 

Solution


This problems happen because by default blackberry MDS emulator can only recive data maximum 250Kb, you can change this setting on a file called "rimpublic.property" located at:

C:\Eclipse\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.43\components\MDS\config

at line 17 you will found something like this:

IPPP.connection.MaxNumberOfKBytesToSend=250

change the value to the bigger value:

IPPP.connection.MaxNumberOfKBytesToSend=1000

Save your MDS configuration and restart your MDS emulator. Your error shouldn't appears anymore.

 

Comments