• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

content-length property in wireless toolkit

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to test the HTTP network functionality in one of my applications. This functionality works on most phones with the exception of some Sony Ericsson models. I downloaded the Wireless Toolkit to test this HTTP functionality using the "Network Monitor" feature in this SDK. When I run the HTTP POST in my MIDlet, I receive the following message from the server:
HTTP/1.1 411 Length Required

All of the above HTTP header properties appear in the network monitor screen with the exeption of 'content-length' which does not seem to work.
Any suggestions would be greatly appreciated.
Thanks!
 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which server are you using? Tomcat? Apache? Can you intercept the request at the server end and see if the "Content-length" header is there? I have the feeling that the server is reporting a wrong error message.
 
Greg Schwartz
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael,
We use an outside hosting company, PHPWebHosting.com . Could you explain how we could intercept the packet on the server side as you mentioned?
Please note that the same jar/jad files worked correctly on a Nokia phone using the T-Mobile network. With that said, it seems that it is either the specific phone or the emulator that is causing this issue.
Thanks so much for your help!
Greg
 
Michael Yuan
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you control the server, you can attach a network monitor and see exactly what it receives from the client. My guess is that T-Mobile did not like the headers sent by your SE and somehow altered the HTTP request in a non-standard way. That triggered the abnormal server response. After all, 411 error is very rare.
To understand this properly, you need to intercept the traffic at socket level. I would suggest you to replace that remote IP with a server that you have control of. Then you can see what exactly is passed from the network. Please post back when you have solution.
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic