HTTP connection using wtk 2.5.2 and usb modem

Hi, i´m developing an application that loads some data from a web page doing a POST. I´m using the emulator to connect to the server, and send de request. I check the response code from de connection and it is ok(value 200), but when a read de content, I always get 22 bytes, with nothing of useful data.
I searched all the internet but i found nothing about this problem.
Could anybody help me??
Thanks.

Use this piece of code:
HttpConnection c = null;
        DataInputStream dis = null;
        try
            String url = "http://www.google.com";
            c = (HttpConnection) Connector.open(url);
            int len = (int) c.getLength();
            dis = c.openDataInputStream();
            byte[] data = new byte[len];
            dis.readFully(data);
            //tf = new TextField("Data",data.toString(), len, TextField.ANY);
            //f.append(tf);
            //d.setCurrent(f);
            f.append(data.toString());
        catch(Exception e)
            e.printStackTrace();
        finally
            if (dis != null)
                try {
                    dis.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
            if (c != null)
                try {
                    c.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
    }

Similar Messages

  • WRT 160NL and USB modem as gateway to Internet

    Is it possible to use WRT 160N with new firmware from http://www.dd-wrt.com  and USB modem (WiMax, CDMA)?
    Did anybody use it? What is result and procedure?

    Ask in a dd-wrt forum. They should know what dd-wrt is capable of and what not...

  • HTTP Connection using GET request

    We have a J2ME app which is accessing a server using an HTTP Connection. We were using a POST to send the data but kept getting an HTTP/1.1 100 Continue from the server. This is annoying since it's extra code to work around this issue (should be handled by the HTTP stack in the JVM).
    We changed the POST to a GET. This works in the simulator but it doesn't seem to work on the real device (testing with a Motorola T720 and a Nokia). The HTTP request never seems to get to the server, although it leaves the phone just fine.
    Any ideas ?
    =Alan=

    We have found the error of our ways. Here is the scenario and the problem we had:
    1) Originally we had an HTTP POST request going to the server. After we openned connection to the URL, set the HTTP headers, openned the output stream and wrote data, closed the output stream and waited for data to come back on the connection.
    -- Result: Have an HTTP/1.1 100 Continue sent back when the server is contacted. This is irritating as it's quite a bit more work to handle.
    2) We changed the URL in the connection from a POST to a GET (url?data=urlencoded.string). We also changed the HTTP headers to reflect a GET. Since there wasn't any data to write, we openned an output stream, but didn't write any data, then closed the stream.
    -- Result: Not even getting to the server - WHY ?
    3) Then it hit us, get rid of the header information since we don't need it for a GET. Also get rid of even opening an output stream since it's really stupid to do that with a GET.
    -- Result: Now it works like a charm !
    Hope this helps any others whos brains might be stuck in idle like mine was :)
    =Alan=

  • I need to connect my iPad to a projector and USB ports. What do I need to do this and where can I get the suitable fittings? I really need to have more than one USB connection port. Help

    I need to connect my iPad to a projector and have USB ports. What do I need to do this and where can I get the suitable fittings? I really need to have more than one USB connection port. Help

    You can connect via a cable or wireless using an Apple TV.
    http://ipad.about.com/od/iPad_Guide/a/How-To-Connect-Your-Ipad-To-Your-Tv.htm
    Connect an iPad to a Television or Projector
    http://www.everymac.com/systems/apple/ipad/ipad-faq/how-to-connect-ipad-to-tv-te levision-projector.html
    Connecting iPad iPhone or iPod to TV or Projector
    http://www.disabled-world.com/assistivedevices/computer/ipad-tv.php
    iPad Accessories: Connections for a TV or Projector
    http://www.dummies.com/how-to/content/ipad-accessories-connections-for-a-tv-or-p rojector.html
    You may be interested in AirPlay on the Apple TV:
    http://www.apple.com/airplay/
    Alternately, there are Apple Digital AV Adapters for hardwired connections:
    http://support.apple.com/kb/ht4108
    If your location does’t have wifi to use with the Apple TV, use a portable router.
    Portable routers http://compnetworking.about.com/od/routers/tp/travel_routers.htm
     Cheers, Tom

  • My Iphone charges from laptop but wont connect to ITunes. Itunes logo and usb lead

    My iphone was fine and I woke up and it just had a Itunes logo and a usb lead. I read that i have to update it to I07 so i connected it to Itunes. Around 40 percent into the process i dissconected and now I am left with an iphone stuck on Itunes logo and usb lead which will charge from laptop but wont even be reconised in Windows or Itunes please help!!

    Hi Annab1010,
    If your iPhone isn't being recognized and will not update/restore, you may find the following articles helpful:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/ts1538
    Apple Support: If you can't update or restore your iOS device
    http://support.apple.com/kb/ht1808
    Regards,
    - Brenden

  • Using cell phone as a 3G USB modem for Leopard

    Hi All,
    I just get an MacBook Pro the last week, I was happy with the UI of the OS at first sight, but when come to the setting of the network, I am really frustrated.
    I get a SE P1i cell phone, I would like to use it as a usb modem for my MAC so that I can have 3G internet connection when on the road. But the problem is that, I can't connect it to my MAC at all!
    Leopard can regonize my phone but it seems that none of the modem script(including the SONY ERICSSON script pre-installed) work for my phone. when I checked in the activity log, I see that the result of running every modem scripts are
    "CCLExit: -6019 (Modem error, modem not responding.)"
    I guess it should not be the problem of my phone as I try using SE K800i, the same result...
    although I know that I can use the bluetooth rather the USB cable to connect them together, I would prefer USB cable as it is faster and more secure.
    anyway, any help would be appreciated.

    detailed instructions:
    http://blog.evandavey.com/2008/02/how-to-connect-huawei-e220-usb-modem.html
    scripts (and instructions):
    http://www.taniwha.org.uk/
    (generally I understand one does the same as with a bluetooth phone, but plugs in the usb cable and skips the bluetooth part)

  • Win 7 Pro 64 occasionally fails to connect using IKEV2 to Win2008R2 Routing and Remote Access server

    I'm a networking guy and having this troubling VPM issue that I can't find.
    I have a number of VPN connections from my Win7Pro 64 PC to various customers.  Their end points are all Windows Routing and Remote Access on Windows 2008R2 STD servers.
    Every once and a while I will hang at Verifying User ID and Password and eventually get  ERROR 809. Change the security type on my VPN connection from IKEV2 to PPTP - never an issue, connects in right away.
    I can also try from another PC (at the same or alternate location) to get into that same server using the same credentials and access - no issue using either IKEV2 or PPTP.
    This has happened at various times to various customers. Here is what I know it is not:
    - Not the local or remote routers or Firewalls since I can always get in from other PC's going through the same network. Even so, tried rebooting all several times
    - Not an ISP issue at either end since I can always get into other IKEV2 servers from the same PC and from other PC's to the server I can't from my PC.
    This leads to the only logical conclusion.  It is something to do with my Win7Pro 64 PC but for the life of my I can not find it.
    I have obviously tried rebooting the Win7Pro PC. I have also tried recreating the VPN connection several times. Nothing.
    Help!

    Hi,
    I know that you've mentioned that it is not a issue about firewall or router settings, but this error usually comes when some firewall between client and server is blocking the ports used by VPN tunnel.
    so to allow IKEv2 traffic, please make sure to configure the network firewall to open UDP ports 500 and 4500, and to allow IP protocol 50.
    If that is not possible, deploy SSTP based VPN tunnel on both VPN server and VPN client – that allows VPN connection across firewalls, web proxies and NAT
    You can refer to this blog
    http://blogs.technet.com/b/rrasblog/archive/2006/06/14/which-ports-to-unblock-for-vpn-traffic-to-pass-through.aspx
    Regards
    Yolanda
    TechNet Community Support

  • Connecting Using SSL Authentication Without Username and Password

    Hi,
    We're on RedHat Linux 4.0 using 10.2.0.3 (server/client). We're trying to figure out a way to connect to the database using instantclient and JDBC-OCI and SSL authentication without using a username or password. According to the documentation this should be possible but no sample code is given.
    LD_LIBRARY_PATH is set /opt/app/oracle/product/10.2.0/db_1/lib:/usr/lib:/home/oracle/instantclient where the instantclient was installed from the 10.2.0.1 client software
    and we are using JDK version 1.6.0_03.
    We're also referencing the following paper:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/pdf/wp-oracle-jdbc_thin_ssl_2007.pdf
    We've got our client and server wallets configured and the sample code we tried looks like this:
    import java.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.net.ns.*;
    import oracle.net.ano.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.*;
    import java.security.*;
    import oracle.jdbc.pool.OracleDataSource;
    public static void main(String[] argv) throws Exception {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Security.addProvider(new oracle.security.pki.OraclePKIProvider());
    System.setProperty("oracle.net.tns_admin", "/opt/app/oracle/product/10.2.0/db_1/network/admin");
    String url = "jdbc:oracle:thin:@orcl";
    java.util.Properties props = new java.util.Properties();
    props.setProperty("oracle.net.authentication_services","(TCPS)");
    props.setProperty("javax.net.ssl.trustStore",
    "/opt/app/oracle/product/10.2.0/db_1/admin/wallet/server/cwallet.sso");
    props.setProperty("javax.net.ssl.trustStoreType","SSO");
    props.setProperty("javax.net.ssl.keyStore", "/opt/app/oracle/product/10.2.0/db_1/admin/wallet/client/cwallet.sso");
    props.setProperty("javax.net.ssl.keyStoreType","SSO");
    props.put ("oracle.net.ssl_version","3.0");
    props.put ("oracle.net.wallet_location", "(SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=/opt/app/oracle/product/10.2.0/db_1/admin/wallet/client)))");
    System.out.println("At Here...");
    OracleDataSource ods = new OracleDataSource();
    //ods.setUser("scott");
    //ods.setPassword("tiger");
    ods.setURL(url);
    ods.setConnectionProperties(props);
    System.out.println("At Here1...");
    Connection conn = ods.getConnection();
    System.out.println("At Here2...");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select 'Hello Thin driver SSL "
    + "tester ' from dual");
    while (rset.next())
    System.out.println(rset.getString(1));
    rset.close();
    stmt.close();
    conn.close();
    When this code is compiled and run, the following error is thrown:
    Exception in thread "main" java.sql.SQLException: invalid arguments in call
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    If a username and password is supplied, the code works. So does anyone have a working of using SSL to authenticate without supplying username/password?
    Thanks
    mohammed

    Hi,
    I just solved this. I noticed from another thread that I was not using the OCI driver (see below):
    String url = "jdbc:oracle:thin:@pki14";
    Once I changed it to:
    String url = "jdbc:oracle:oci:@pki14";
    The code worked perfectly. One more setting that you'll have to do is to create the user you want to connect as externally:
    create user scott identified externally as
    'CN=acme, OU=development, O=acme, C=US';
    grant connect,create session to scott;
    Note that the DN should be the same as the SSL certificate that you created in your wallet.
    hth
    mohammed

  • Http connection using palm emulator

    hi all...
    am preety new to j2me . am trying to access a URL ( http://www.yahoo.com)from my palm emulator . am using j2me wireless tool kit 1.0.4 and palm emulator.
    the program buils but fails to execute. i have changed the "networking" field in "JAVA HQ" to "enabled" ...still problem persists . i am not able to connect to web server running on my comp also.
    am sure there are some other settings that have to be made for network connectivity.
    if anyone can help me please...
    thans
    sanjib

    HI AM SANJIB ONCE AGAIN....
    am enclosing the error message am getting...hope i will help u to pinpoint where the problem is :
    KVM stdout: 27 Jun 2002, 15:29
    Could not create icon com.sun.midp.midlet.Selector$MIDletInfo@1cb37664startApp threw an Exception
    java.lang.IllegalArgumentException
    java.lang.IllegalArgumentException
         at com.sun.cldc.io.j2me.socket.Protocol.openPrim(+7)
         at com.sun.midp.io.InternalConnector.openPrim(+308)
         at com.sun.midp.io.InternalConnector.openInternal(+6)
         at com.sun.midp.io.j2me.http.StreamConnectionPool.createStreamConnectionElement(+109)
         at com.sun.midp.io.j2me.http.StreamConnectionPool.getConnection(+121)
         at com.sun.midp.io.j2me.http.Protocol.connect(+118)
         at com.sun.midp.io.j2me.http.Protocol.sendRequest(+85)
         at com.sun.midp.io.j2me.http.Protocol.openInputStream(+48)
         at FirstExample.getViaStreamConnection(+30)
         at FirstExample.startApp(+8)
         at javax.microedition.midlet.MIDletProxy.startApp(+7)
         at com.sun.midp.midlet.Scheduler.schedule(+189)
         at com.sun.midp.midlet.Main.main(+133)
    sanjib

  • My itunes will not connect using at&t communications manager and internet

    my itunes and store will not connect to internet using at&t communications manager

    That's usually caused by a conflict between iTunes and the Bytemobile LSP inserted by the AT&T communication manager, as per the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store

  • How to configure https connection using a http proxy in weblogic server

    Hi,
    I have a proxy in Aqualogic Service Bus that points to a https external service. Our development environment internet access is supported by a http proxy server. The ALSB proxy fails to connect, with the following error message:
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-380002</con:errorCode>
    <con:reason>
    Tried all: *1 addresses, but could not connect over HTTPS to server: sitenet43.serasa.com.br port: 443*
    </con:reason>
    <con:location>
    <con:node>RouteTo_ConsultarSerasa</con:node>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>
    I've added the following parameters to jvm args:
    -Dhttp.proxyHost=10.128.0.50
    -Dhttp.proxyPort=3126
    -Dhttp.proxyUser=<someUserName>
    -Dhttp.proxyPassword=<somePassword>
    Accessing the page in Internet Explorer or Firefox is working fine. Somebody knows any additional configuration to this case?
    Thanks in advance
    Rogério Cruz

    In osb you can configure a HTTP proxy server. Once this is done all BS http/https requests will be through the configured proxy server.
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/global_resources.html#wp1137225
    Manoj

  • Using fieldpoint with scientific linux and USB-RS232 interface

    I am using a desktop PC with SLC5 and an USB-RS232 interface. I need to program a fieldpoint FP1000 module within labView. Visaconf is correctly seeing the interfaces (4 ports: /dev/ttyUSB0 .. 3, mapped as ASRLx::INSTR, with x = 1..4), but when I try to use "Advanced Serial Write and Read.vi", I always get timeout. If I try "Optomux Send General Command.vi", it looks broken (the parameter "VISA resource name" is connected to the "port number" input of "FPOptoHandler.vi" and the type is not matched).
    What am I doing wrong ? Am I missing some piece ?
    Thanks a lot in advance,
    Roberto Ferrari

    The people over in the GarageBand forums are amazing at diagnosing and fixing these sorts of things. I recommend that you give it a try posting the question over there:
    http://discussions.apple.com/forum.jspa?forumID=1308
    Good luck!

  • Using external HD Cinema display and USB keyboard/mouse with "closed" MBP

    I have an early 2009 17-inch MacBook Pro and a ~2007 HD Cinema Display. I routinely hook up my cinema display and an external USB keyboard/mouse when I am at my desk, and I close the lid on the MacBook to just use the external display. When I leave the office (I do about 50% of my work away from my desk) I use the MacBook on its own, often just putting it to sleep while I connect or disconnect the monitor and keyboard.
    My problem comes more often when I have used my computer on its own, and I try to plug it back into my cinema display. I have the computer set to ask for a password on coming out of sleep or screen saver, and every so often the computer just hangs when I wake it up--usually when I plug in the external keyboard. When I am able to login, sometimes I am not able to use any of the icons on my desktop--it's almost as if they are not there or recognized by the finder. My solution has been to go into the view options and choose to re-arrange the desktop in some way, and then I can select them again as normal. This is a frustrating solution as 1. it takes extra time, and 2. I loose my desktop arrangement, which makes it hard to easily find what I'm looking for.
    Is there a "better" way (order of plugging things in, settings, etc. besides shutting down and restarting) to connect and disconnect my MacBook from my external monitor and keyboard to assure an easy login and use of my desktop icons?

    I'm not sure if this is germane, but Apple specifically warns about plugging or unplugging USB or FireWire devices from the laptops while they are sleeping. Doing so can result in kernel panics, crashes, inability to wake up the computer, etc. So specifically they recommend you only connect or disconnect such devices before putting the computer to sleep and after waking it up.

  • All connections lost after installing either bluetooth or USB Modem

    Hi There,
     I have checked but did not find post related to my issue. I'm running AC 5, XP on a T60. Everything is ok as long as I'm using only my network internal card or the internal wireless adaptator. But each time I have tried to install either bluetooth or an external modem, they work fine BUT I loose all the previous connections and moreover the network (wire network and wireless) seems to have disappear.
     Anyone had encountered this issue ?.
    Thanks for your help,

    I forgot ...., I have to restore the system each time in order to recover the previous state.
    Thanks again,

  • Https Connection from servlets using JSSE.

    Hi all,
    Although my question is the same as the QOW for this week, there is an error "unsupported keyword EMAIL" returned when i try to establish a https connection using servlet. The error log is as follow:
    =====================================
    java.io.IOException: unsupported keyword EMAIL
    at com.sun.net.ssl.internal.ssl.AVA.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.RDN.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.X500Name.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.X500Name.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V1.2-120198])
    at URLReader.doGet(URLReader.java:78)
    ===================================
    Does anyone know the meaning of this error?
    I try to write a java application using the similar code and it totally works fine(i can connect to the server and obtain the page). Does JSSE support Java Servlet? Or this is the problem of tomcat server? FYI, I'm using
    Tomcat 3.2.2
    Java SDK 1.3
    Many thanks!
    Ethan
    p.s. Here is the source for my program
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.net.*;
    import javax.net.ssl.*;
    import com.sun.net.ssl.*;
    public class URLReader extends HttpServlet{
    private PrintWriter out = null;
    public void doGet(HttpServletRequest req, HttpServletResponse res){
    res.setContentType("text/html");
    res.setHeader("Cache-Control", "no-cache");
    res.setHeader("Progma", "no-cache");
    out = res.getWriter();
    java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    System.setProperty("javax.net.ssl.trustStore", "File_for_keyStore");
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    try {
         URL url = new URL("https://server_name:port/index.htm");
         HttpsURLConnection urlconnection = (HttpsURLConnection)url.openConnection();
         BufferedReader in = new BufferedReader(new InputStreamReader(urlconnection.getInputStream()));
         String outputLine ;
         while ( (outputLine = in.readLine()) != null){
         out.println("There is the result: "+outputLine);
         in.close();
    catch(Exception e){
    public void doPost(HttpServletRequest req, HttpServletResponse res){
    }

    I was just having this issue, after months of error-free ssl behavior, on a new machine i was installing (Note: that I was running the IBM jdk1.3) It turns out that when I was editing the java.security file to know about JCE/JSSE providers i had the providers in the wrong order. The Error causing sequence was:
    security.provider.1=com.sun.net.ssl.internal.ssl.Provider
    security.provider.2=com.ibm.crypto.provider.IBMJCA
    # Extra provider added ibm@33894
    security.provider.3=com.ibm.crypto.provider.IBMJCE
    # extra provider i added
    security.provider.4=sun.security.provider.Sun
    The issue disappeared when i changed the order to:
    security.provider.1=sun.security.provider.Sun
    security.provider.2=com.sun.net.ssl.internal.ssl.Provider
    security.provider.3=com.ibm.crypto.provider.IBMJCA
    # Extra provider added ibm@33894
    security.provider.4=com.ibm.crypto.provider.IBMJCE
    hope that helps!
    --john molnar
    Trellis Network Security

Maybe you are looking for