Problem sending messages from servlets to mobile (wap) phones

Discussion in 'Java' started by Werner Oertig, Feb 17, 2004.

  1. Hi,

    I've a problem sending data from a servlet to a mobile phone.

    On the mobile i'm using a get request to access a servlet (running
    within tomcat 4.1). The servlet then sends data back to the mobile.
    The problem is, that the data isn't received by the mobile (or at
    least I don't see anything on it). If I use a browser to send the
    request it works fine.
    I then installed a portsniffer to intercept the output from the
    servlet. And surprise, surprise suddenly the mobile receives the
    message.

    Does anybody have an explanation why I can't send the message directly
    from the servlet and why it works if there is a portsniffer in
    between?

    This is the code that I use:

    String message = content.getWapResponse();
    response.setContentType( "text/vnd.wap.wml" );
    response.setContentLength( message.length() );
    response.setStatus( HttpServletResponse.SC_OK );
    PrintWriter writer = response.getWriter();
    writer.print( message );
    writer.flush();
    writer.close();

    Thanks for your help!
     
    Werner Oertig, Feb 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aaron Whiffin
    Replies:
    0
    Views:
    604
    Aaron Whiffin
    Sep 4, 2003
  2. ssgg

    GET FREE CELL PHONES and CAMERA PHONES!

    ssgg, Feb 13, 2006, in forum: C Programming
    Replies:
    0
    Views:
    316
  3. chen selina
    Replies:
    0
    Views:
    1,328
    chen selina
    Jul 13, 2010
  4. Kenny M.

    sending values to Mobile phones

    Kenny M., Jan 2, 2005, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    106
    R. Thomas, aka Xtreme.Net
    Jan 11, 2005
  5. Duncan Allen

    WAP Phones - Mobile Web Pages in .NET 2

    Duncan Allen, Jun 1, 2007, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    697
Loading...

Share This Page