J2me http connection error

Hi,
I got null value from my hand set when getting conn.getHeaderField value while my J2ME emulator is working fine.
Any one hv a clue on tis..
My snipet of code
HttpConnection conn = (HttpConnection)Connector.open("http://61.6.108.195:8001/Frens/test.jsp?test=apa4",Connector.READ_WRITE);
               conn.setRequestMethod(HttpConnection.POST);
               conn.setRequestProperty("Connection", "keep-alive");
               InputStream input = (InputStream) conn.openInputStream();
               int i = 0;
               String str = "";
               while ( (i = input.read()) != -1){
                    str = str + String.valueOf((char) i);
               str = conn.getHeaderField("test");
               conn.close();
               timeAlert.setString("value=:" + str);

i'm using nokia 6610

Similar Messages

  • HTTP connectivity error while using Blackberry MDS and JDE 5.0.0

    Hello,
    I am using BB MDS simulator 4.1.2 and BB JDE 5.0.0 for testing sample Oracle ADF Mobile client apps that I have developed.
    My app tries to access webservices via HTTP.
    Here is where I am encountering a HTTP connectivity issue.
    1. For instance, while trying to test HTTP using Blackberry browser, I see the error : "Unknown host mobile.blackberry.com:80"
    2. The sample I tried to run to test webservices - accepts a word from the user and gets it translated in to a desired language, using a webservice provided on the internet.
    Here, I have tried to translate the word 'madam' from English to French.
    I have encountered a HTTP/1.0 400 Bad Request.
    Kindly have a look at the MDS Trace as below (related entries in bold) and suggest if I am missing something from the configuration perspective.
    PS : I have tried various options from the blackberry forums but they were not very helpful.
    <2010-05-24 17:48:16.000 IST>:[215]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Device connections: AVG latency (msecs)0>
    <2010-05-24 17:48:16.000 IST>:[216]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = RemovedReceivingQueue, DEVICEPIN:CONNECT
    IONID = 2100000a:771975383, ReceivingQueueSize = 0>
    <2010-05-24 17:48:16.343 IST>:[217]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Notification, TAG = 36110347, STATE = DE
    LIVERED>
    <2010-05-24 17:48:19.046 IST>:[218]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = RemovedSendingQueue, DEVICEPIN = 2100000
    a>
    <2010-05-24 17:49:57.437 IST>:[219]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Receiving, TAG = 371769629, DEVICEPIN =
    2100000a, VERSION = 16, CONNECTIONID = 771975384, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = httpc, PR
    OTOCOL = TCP, PARAMETERS = [www.webservicex.net:80], SIZE = 121>
    <2010-05-24 17:49:57.437 IST>:[220]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = CreatedReceivingQueue, DEVICEPIN:CONNECT
    IONID = 2100000a:771975384, ReceivingQueueSize = 1>
    <2010-05-24 17:49:57.437 IST>:[221]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = StartExecuting, TAG = 371769629, DEVICEP
    IN = 2100000a, VERSION = 16, CONNECTIONID = 771975384, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = http
    c, PROTOCOL = TCP, PARAMETERS = [www.webservicex.net:80], SIZE = 121>
    <2010-05-24 17:49:57.437 IST>:[222]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = EndExecuting, TAG = 371769629, DEVICEPIN
    = 2100000a, VERSION = 16, CONNECTIONID = 771975384, SEQUENCE = 0, TYPE = CONNECTION-REQUEST, CONNECTIONHANDLER = httpc,
    PROTOCOL = TCP, PARAMETERS = [www.webservicex.net:80], SIZE = 121>
    <2010-05-24 17:49:57.437 IST>:[223]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Available threads in DefaultJobPool = 9 r
    unning JobRunner: DefaultJobRunner-3>
    <2010-05-24 17:49:57.453 IST>:[224]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HTTP Thread: DefaultJobRunner-3 started>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION =>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Transmission Line Section]:>
    *<2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI*
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = GET /TranslateService.asmx/Translate?LanguageMode=English
    TOFrench&Text=madam HTTP/1.1>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Headers Section]: 2 headers>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = x-rim-conttime:10000>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Host:www.webservicex.net>
    <2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Parameters Section]: 2 parameters>
    *<2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI*
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = LanguageMode=EnglishTOFrench>
    *<2010-05-24 17:49:57.453 IST>:[225]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = ReceivedFromDevice, DEVI*
    CEPIN = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Text=madam>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION =>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Transmission Line Section]:>
    *<2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN*
    *= 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = GET /TranslateService.asmx/Translate?LanguageMode=EnglishTOFren*
    ch&Text=madam HTTP/1.1>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Headers Section]: 6 headers>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Connection:close>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Via:MDS_4.1.2.17>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Accept:*/*>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = x-rim-original-accept:*/*>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = x-rim-conttime:10000>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Host:www.webservicex.net>
    <2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Parameters Section]: 2 parameters>
    *<2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN*
    *= 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = LanguageMode=EnglishTOFrench>*
    *<2010-05-24 17:49:57.453 IST>:[226]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToServer, DEVICEPIN*
    *= 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Text=madam>*
    <2010-05-24 17:49:57.515 IST>:[227]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Statistics save task started>
    <2010-05-24 17:49:57.625 IST>:[228]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Statistics save task finished -- number o
    f rows inserted:5>
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION =>
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Transmission Line Section]:>
    *<2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN*
    *= 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = HTTP/1.0 400 Bad Request>*
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Headers Section]: 2 headers>
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Content-Type:text/plain>
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = Content-Length:35>
    <2010-05-24 17:50:18.453 IST>:[229]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HANDLER = HTTP, EVENT = SentToDevice, DEVICEPIN
    = 2100000a, CONNECTIONID = 771975384, HTTPTRANSMISSION = [Parameters Section]: 0 parameters>
    <2010-05-24 17:50:18.468 IST>:[230]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = CreatedSendingQueue, DEVICEPIN = 2100000
    a>
    <2010-05-24 17:50:18.468 IST>:[231]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HTTP Thread: DefaultJobRunner-3 stopping>
    <2010-05-24 17:50:18.468 IST>:[234]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Sending, TAG = 36110349, DEVICEPIN = 210
    0000a, VERSION = 16, CONNECTIONID = 771975384, SEQUENCE = 0, TYPE = DATA, SIZE = 48>
    <2010-05-24 17:50:18.468 IST>:[235]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HTTP Thread: DefaultJobRunner-3 stopped>
    <2010-05-24 17:50:18.484 IST>:[236]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Finished JobRunner: DefaultJobRunner-3, a
    vailable threads in DefaultJobPool = 10, time spent = 21047ms>
    <2010-05-24 17:50:18.500 IST>:[239]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Sending, TAG = 36110350, DEVICEPIN = 210
    0000a, VERSION = 16, CONNECTIONID = 771975384, SEQUENCE = 1, TYPE = DISCONNECT-ORDER, SIZE = 0>
    <2010-05-24 17:50:18.500 IST>:[240]:<MDS-CS_MDS>:<DEBUG>:<LAYER = SCM, EVENT = Device connections: AVG latency (msecs)32>
    <2010-05-24 17:50:18.500 IST>:[241]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HTTP Thread: ConnectionsInputStreamesReader0-Def
    aultJobRunner-3 stopping>
    <2010-05-24 17:50:18.500 IST>:[242]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, HTTP Thread: ConnectionsInputStreamesReader0-Def
    aultJobRunner-3 stopped>
    <2010-05-24 17:50:18.500 IST>:[243]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = RemovedReceivingQueue, DEVICEPIN:CONNECT
    IONID = 2100000a:771975384, ReceivingQueueSize = 0>
    <2010-05-24 17:50:18.531 IST>:[244]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Notification, TAG = 36110349, STATE = DE
    LIVERED>
    <2010-05-24 17:50:18.562 IST>:[245]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = Notification, TAG = 36110350, STATE = DE
    LIVERED>
    <2010-05-24 17:50:19.046 IST>:[246]:<MDS-CS_MDS>:<DEBUG>:<LAYER = IPPP, EVENT = RemovedSendingQueue, DEVICEPIN = 2100000
    a>

    Hi, there:
    A couple of things to try and check:
    - Does your network connection goes through proxy server? If you are behind a proxy server, then you would need to set up proxy server in MDS by open the file <MDS simulator install>/config/rimpublic.property, go to the [HTTP Handler] section, and add the following line:
    application.handler.http.proxyEnabled = true
    application.handler.http.proxyHost=<your proxy server host name>
    application.handler.http.proxyPort=<your proxy server port>
    - Try BlackBerry MDS simulator that came with JDE 5.0. MDS 4.1.2 should still work with 5.0 device simulators, but it's worth a shot
    Can you hit the web service from the browser in your Blackberry simulator? Feel free to directly contact me at [email protected] - if necessary we can also pull in BlackBerry/RIM resources to help diagnose this.
    Thanks,
    Joe Huang

  • FirstMidletServlet with http connection error

    Ok so im quite new to midlets. Im trying to run the FirstMidletServlet which connects to a servlet using a tomcat server.
    It builds fine and runs ok until i am prompted to us airtime in the emulator. Once i click ok it just comes up with "Error" absolutetly nothing else not in the console in the wireless toolkit or in tomcat server console window.
    The servlet executes fine in the browser window so i know its not that.
    Any ideas why? Heres the code below
    Im running it on tomcat 5.5 and jdk1.5.0_14
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    * An example MIDlet to invoke a CGI script.
    public class FirstMidletServlet extends MIDlet {
        private Display display;
        String url = "http://localhost/Servlet/HelloServlet";
        public FirstMidletServlet() {
           display = Display.getDisplay(this);
         * Initialization. Invoked when we activate the MIDlet.
        public void startApp() {
         try {
                invokeServlet(url);
         } catch (IOException e) {
             System.out.println("IOException " + e);
             e.printStackTrace();
         * Pause, discontinue ....
        public void pauseApp() {
         * Destroy must cleanup everything.
        public void destroyApp(boolean unconditional) {
         * Prepare connection and streams then invoke servlet.
         void invokeServlet(String url) throws IOException {
            HttpConnection c = null;
            InputStream is = null;
            StringBuffer b = new StringBuffer();
            TextBox t = null;
            try {
              c = (HttpConnection)Connector.open(url);
              c.setRequestMethod(HttpConnection.GET);
              c.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT");
              c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
              c.setRequestProperty("Content-Language", "en-CA");
              is = c.openDataInputStream();
              int ch;
              while ((ch = is.read()) != -1) {
                b.append((char) ch);
                //System.out.println((char)ch);
              t = new TextBox("First Servlet", b.toString(), 1024, 0);
            } finally {
               if(is!= null) {
                  is.close();
               if(c != null) {
                  c.close();
            display.setCurrent(t);
        }    

    what do you mean, "prompted to us airtime in the emulator"? I don't see anything related to that sentence in the code you posted. Is there more code you aren't showing us? Where does it say "Error" at?
    It promts you in the wireless toolkit that you are about to connect to an external connection. so you click yes then it trys to connect to servlet and get the "error" thats all it says on the wireless toolkit display!

  • Firewall HTTP connection Error

    We have a small java software product that communicates with a web server using HTTP calls. Recently we have added a firewall with a transparent Proxy. Since the firewall was installed the application is no longer able to make the connections to the web server.
    We have tried to communicating using the Web Address and IP address, also tried setting the HTTP Proxy to the Web Address and/or IP Address (socksProxyHost etc...). And on all of these tests the app got the same error -
    [2003.07.23 07:45:12 MDT] java.net.SocketException: Reply from SOCKS server has bad version 60 at java.net.PlainSocketImpl.getSOCKSReply(Unknown Source) at java.net.PlainSocketImpl.doSOCKSConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket. (Unknown Source) at java.net.Socket. (Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient. (Unknown Source) at sun.net.www.http.HttpClient. (Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source) at sf.server.dj.a(dj.java:429) at sf.server.dj.a(dj.java:419) at sf.server.dj.a(dj.java:206) at sf.server.dj.a(dj.java:174) at sf.server.cz.j(cz.java:305) at sf.server.cy.h(cy.java:1426) at sf.server.dl.a(dl.java:236) at sf.server.dl.run(dl.java:158) at java.lang.Thread.run(Unknown Source)
    Does anyone have an idea of why we would be getting this error, the firewall is set up to allow communication, I'm a little worried that the java may just not be compatible with the firewall Socks code. - am using JRE 1.3_02
    Any help would be appreciated
    Sincerely
    Ray

    it's not java..it's your webserver configuration
    talk with your network administration about this problem
    I'm behind a firewall myself - but my java work fine
    Only time it went down was when the system admins made changes to the webserver..and the java apps 9as well as other apps were blocked)

  • J2ME Http Connection

    Hi,
    I have downloaded a midlet which connects to a Http Server(A URL) and gives back the values. Now I am getting all the data with the tags also.But I want to get the values only without tags.The code i am using is
    * FileViewer.java
    * Download and view a file over a network
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    public class FileViewer extends MIDlet implements CommandListener
    private Display display;     // Reference to Display object
    private TextBox tbViewer; // View file contents in a textbox
    private Command cmView; // Command to view file
    private Command cmExit; // Command to exit
    private String url = "http://sudheer/test.html";
    public FileViewer()
    display = Display.getDisplay(this);
    // Define commands
    cmView = new Command("View", Command.SCREEN, 2);
    cmExit = new Command("Exit", Command.EXIT, 1);
    tbViewer = new TextBox("Viewer", "", 250, TextField.ANY);
    tbViewer.addCommand(cmView);
    tbViewer.addCommand(cmExit);
    tbViewer.setCommandListener(this);
    public void startApp()
    display.setCurrent(tbViewer);
    private void viewFile() throws IOException
    HttpConnection http = null;
    InputStream iStrm = null;
    try
    // Create the connection
    http = (HttpConnection) Connector.open(url);
    // Client Request
    // 1) Send request method
    http.setRequestMethod(HttpConnection.GET);
    // 2) Send header information (this header is optional)
    http.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
    // 3) Send body/data - No data for this request
    // Server Response
    // 1) Get status Line
    System.out.println("Msg: " + http.getResponseMessage());
    System.out.println("Code: " + http.getResponseCode());
    // 2) Get header information
    if (http.getResponseCode() == HttpConnection.HTTP_OK)
    // 3) Get data (show the file contents)
    iStrm = http.openInputStream();
    int length = (int) http.getLength();
    if (length > 0)
    byte serverData[] = new byte[length];
    iStrm.read(serverData);
    tbViewer.setString(new String(serverData));
    finally
    // Clean up
    if (iStrm != null)
    iStrm.close();
    if (http != null)
    http.close();
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    public void commandAction(Command c, Displayable s)
    if (c == cmView)
    try
    viewFile();
    catch (Exception e)
    System.out.println(e.toString());
    else if (c == cmExit)
    destroyApp(false);
    notifyDestroyed();

    Hi
    since you are using http, you must either deal with this issue in the client (your MIDlet) or server-side in some way. HTTP is HTTP is HTTP (if you see what I mean!) so, if you GET a URL and read the result back from the associated stream, you will get the content identified by the URL. If this is an html page then that is what you get, tags included.
    If you have control over the server then you could consider "repurposing" the content for consumption by your MIDlet with either a custom servlet or perhaps by using some XML/XSLT magic.
    Alternatively you simply have to parse the html page in your MIDlet, extracting the content from amongst the tags as you go.
    Good luck
    Martin

  • While Creating Web service call from JDeveloper getting http 403 error

    1. I have created the new application as Oracle Fusion (ADF) application
    2. I have included the web service technology to the application
    3. I am trying to create new web service data control layer , after specifying URL we are getting the following error
    WSDL:Exception:fault code:=OTHER_ERROR failed read from WSDL from http://10.141.28.242:1030/oraclediagent/OdiInvoke?wsdl
    HTTP connection error code is 403.
    could anyone please try to solve this
    thanks
    887401

    HTTP 403 means you don't have permission to access that URL. Have you supplied credentials?

  • HTTP connection to ABAP runtime failed

    I am building a scenario where XI picks up a file from a directory and pushes an IDoc to ECC.  I have configured the interface with the Design tool, and I believe my setup in the Configuration tool are correct too, however I am encountering an error when testing the scenario by means of --
    Tools --> Test Configuration.
    The testing tool is giving me the following error upon processing the reciever determination:
    HTTP connection to ABAP Runtime failed.
    Error: 403 Forbidden
    URL: http://serveraddress:port/sap/xi/simulation?sap-client=100
    User: PIDIRUSER
    First of all, I am not sure who the PIDIRUSER is, I assume it's a system user?  Second, given that this error is a HTTP connection error, I am lead to believe that the issue lies somewhere in the RFC connection from XI -> ECC.  I am not sure why exactly it's attempting to connect via HTTP as my communication channel is using the IDoc adapter with an RFC destination to connect to ECC.  Possibly I have configured this incorrectly.  I have read about having to configure a RFC adapter when posting messages from R/3 to XI, does the same apply when posting an IDoc from XI to ECC?  Does anyone have any other thoughts as to why this error may be occuring?  Thanks in advance for your time and help.

    This might help you
    http://help.sap.com/saphelp_nw04/helpdata/en/82/f4993c03e0cd37e10000000a11405a/content.htm
    /people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
    http://help.sap.com/saphelp_nw04/helpdata/en/39/83682615cd4f8197d0612529f2165f/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/39/83682615cd4f8197d0612529f2165f/frameset.htm
    Regards
    Agasthuri Doss

  • Error trying to create https connection from Web Dynpro

    Hi experts!!
    I am trying to create a WD view with an actionButton and a form template, when the user fills the data in the form and presses the button, i want to create an Https connect and post some parameters to the URL.
    HttpsURLConnection cannot be resolved,
    com.sun.net.ssl.internal.ssl.Provider() does't not exist in the package com.sun.net.ssl.internal.ssl.Provider()
    do i need to add any jars?? I've already added the jsse.jar
    The code i use is the following.
    private void sendHttp(){
          String response = "";
          HttpsURLConnection connection = null;
          try {
                      System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
                      java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
                      URL url = new URL(<your_url>);
                      connection = (HttpsURLConnection) url.openConnection();
                      connection.setDoInput(true);
                      connection.setDoOutput(true);
                      connection.setAllowUserInteraction(true);
                      connection.setUseCaches(false);
                }     catch(Exception e) {
                      response = response +  "Error in getting connection: " ;
                      response = response +  e ;
                if (connection != null){
                      try {
                            connection.setRequestMethod("POST");
                            connection.setFollowRedirects(true);
                            //build all the parameters into 1 string
                            String query = "parameter1name=" + URLEncoder.encode(parameter1value);
                                  query += "&";
                                  query += "parameter2name=" + URLEncoder.encode(parameter2value);
                            connection.setRequestProperty("Content-length",String.valueOf (query.length()));
                            connection.setRequestProperty("Content-Type","application/x-www- form-urlencoded");
                            connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)");
                            // open up the output stream of the connection
                            DataOutputStream output = new DataOutputStream( connection.getOutputStream() );
                            // write out the data
                            int queryLength = query.length();
                            output.writeBytes( query );
                            output.close();
                            //if responsecode <> 200 you should stop: should always be 200
                            String responsecode = connection.getResponseCode();
                            if (responsecode.equalsIgnoreCase("200")){
                                  String inputLine;
                                  StringBuffer input = new StringBuffer();
                                  BufferedReader in =     new BufferedReader(     new InputStreamReader(connection.getInputStream()));
                                                                                    //Get site response
                                  while ((inputLine = in.readLine()) != null) {
                                        input.append(inputLine);
                                  in.close();
                                  response = response + input.toString();
                      }     catch(Exception e) {
                          response = response +  "Error in using connection: " ;
                          response = response +  e ;
              wdContext.currentContextElement().setResponse(response);

    Hai ,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/526bd490-0201-0010-038e-d3ff7eb1d16e
    please check above link .
    application server u have take load balancing click on next  there u take click on radio button of Msg server .
    Regards ,
    venkat

  • Http 403 error message when connecting to WRT120n router

    I recently upgraded to the WRT120n router at home. I quickly connected my desktop computer, my wife's Mac and two Lenovos, but my son's HP Pavilion cannot access the Internet. It returns the http 403 error message. Windows (Vista) and Network Magic tell me the laptop is connected to the router and the Internet, but the browser does not work. Have tried IE, Chrome and Firefox - same result. Have also tried to connect with cable. Hooking up wirelessly with WPA, was no problem, but the browser is unable to access the Internet.
    Grateful for any help.

    What is the ip address you are getting on the Vista Computer..?
    Click Start >> All Programs >> Accessories >> Command Prompt...A black box will appear(Command Prompt)...In the Command Prompt window type ipconfig and press 'Enter'...Look for Wireless Network Connection IP Address , Subnet Mask and Default Gateway...
    IP Address should be 192.168.1.x, Subnet Mask : 255.255.255.0, Default Gateway : 192.168.1.1 (assuming your router is 192.168.1.1)...
    If you get the above mentioned IP Address, Subnet and Gateway Address then you should ping the Gateway, type ping 192.168.1.1 and press Enter...If it gives you request timed out then disable any firewalls, security softwares on the computer...
    If you get 4 replies then type ping 4.2.2.2 and press Enter, if you get request timed out, then you need to upgrade your router's firmware...If you get 4 replies then type ping yahoo.com and press Enter...If you get replies for Yahoo then you should get the Internet after adjusting the browser settings...
    Adjusting Browser Settings : Open an IE, click Tools >> Internet Options, then delete all files, cookies, history, forms...Goto "Connections", make sure Never Dial a Connection is checked, click on LAN Settings and make sure all the options are unchecked...Once you are done click on O.k...Close the IE and re-open it...
    If yahoo times out then provide static DNS on your LAN Connection...
    Click on the Start button >>> Settings >>> Control Panel >>>Network Connections- Right click on the icon for Wireless Network Connection and go to properties- On the 'General' tab select 'Internet Protocol TCP/IP' and click on the Properties button- Select 'Use the Following DNS Settings' Preferred DNS 4.2.2.2 Alternate DNS - 192.168.1.1>>Click on Ok button to Save and Click on "Close" on main Properties window...You should be able to go online... 

  • How to solve Error in http connection. Error -1

    urlMidlet2===http://localhost:8080/testProj?userId=20&selMPBL=23&svMPBL=IPOD+Touch+Screen+e!1!Tue+Jan+06+00:00:00+UTC+2009!Tue+Jan+06+00:00:00+UTC+2009!Sat+Jan+31+00:00:00+UTC+2009!Mp3+Player!IPOD!Rejected!12
    [j2mepolish] Generic/DefaultColorPhone: !1!2!1222!13333
    [j2mepolish] Generic/DefaultColorPhone: Protocol for this connection is http
    [j2mepolish] Generic/DefaultColorPhone: This object is connected to localhost host
    [j2mepolish] Generic/DefaultColorPhone: HTTP Port in use is 8080
    [j2mepolish] Generic/DefaultColorPhone: respCode=====-1
    [j2mepolish] Generic/DefaultColorPhone: Error in opening HTTP Connection. Error#-1
    Why is this error coming? How to solve it?
    Thanks in advance.
    Edited by: J2me_Beginner on Jun 7, 2009 9:38 PM

    I am making a form using an interface. When Activate the Form, I got this error:
    Invalid HTTP connection: ADS
    Message no. FPRUN000
    But I do not know how to solve or config ADS. Any one know how to slove this error ?
    Thanks a lot.

  • Error : HTTP Connection to ABAP Runtime failed

    Hi,
       i am working on xml to flatfile interface.when i am trying to test the scenario from ID - > Tools -> Test configuration option i am getting below error.
    Receiver Determination <Not found>
    Internal Error Http connection to ABAP runtime failed.
    Error : 403 for bidden.
    I have checked in Receiver determination its been configured properly.
    Is it any basis settings problem ?
    Thnx,
    Siva.

    Hi Siva,
    Check this links
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
    Regards
    Ramesh

  • HTTP response error :Connection reset

    Hi all,
    I am getting following error in log while sending message to the trading partner and the main problem is that once this error comes then after that I am not able to send any more message to any of my Trading Partners. Even if I try to send message to any other Trading Partner, nothing comes in the B2B log and report as well. After restarting the B2B I am able to send message again to other Trading Partners.
    Can anyone please tell the reason for getting this error? I also want to know that after getting this error once, why am I not able to send message to any Trading Partner?
    2008.12.12 at 06:41:07:647: Thread-13: B2B - (WARNING)
    Message Transmission Transport Exception
    Transport Error Code is OTA-HTTP-SEND-1006
    StackTrace oracle.tip.transport.TransportException: [IPT_HttpSendHttpResponseError] HTTP response error :Connection reset.
    at oracle.tip.transport.TransportException.create(TransportException.java:91)
    at oracle.tip.transport.basic.HTTPSender.send(HTTPSender.java:627)
    at oracle.tip.transport.b2b.B2BTransport.send(B2BTransport.java:311)
    at oracle.tip.adapter.b2b.transport.TransportInterface.send(TransportInterface.java:980)
    at oracle.tip.adapter.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1744)
    at oracle.tip.adapter.b2b.msgproc.Request.outgoingRequest(Request.java:968)
    at oracle.tip.adapter.b2b.engine.Engine.processOutgoingMessage(Engine.java:1147)
    at oracle.tip.adapter.b2b.transport.AppInterfaceListener.onMessage(AppInterfaceListener.java:137)
    at oracle.tip.transport.basic.jms.JMSMonitor.processMessages(JMSMonitor.java:610)
    at oracle.tip.transport.basic.jms.JMSMonitor.run(JMSMonitor.java:236)
    Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:168)
    at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.HandshakeOutStream.flush(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA12275)
    at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:112)
    at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3018)
    at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:2843)
    at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:2635)
    at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1107)
    at oracle.tip.transport.basic.HTTPSender.send(HTTPSender.java:590)
    ... 8 more
    2008.12.12 at 06:41:07:647: Thread-13: B2B - (DEBUG) oracle.tip.adapter.b2b.transport.TransportInterface:send Error in sending message
    2008.12.12 at 06:41:07:648: Thread-13: B2B - (INFORMATION) oracle.tip.adapter.b2b.msgproc.Request:outgoingRequestPostColab Request Message Transmission failed
    2008.12.12 at 06:41:07:648: Thread-13: B2B - (DEBUG) DBContext beginTransaction: Enter
    2008.12.12 at 06:41:07:648: Thread-13: B2B - (DEBUG) DBContext beginTransaction: Transaction.begin()
    2008.12.12 at 06:41:07:648: Thread-13: B2B - (DEBUG) DBContext beginTransaction: Leave
    2008.12.12 at 06:41:07:648: Thread-13: B2B - (DEBUG) oracle.tip.adapter.b2b.msgproc.Request:outgoingRequestPostColab [IPT_HttpSendHttpResponseError] HTTP response error :Connection reset.
    Connection reset
    2008.12.12 at 06:41:07:651: Thread-13: BusinessLogicLayer - (DEBUG) Authorization disabled. UserBootstrapped:false, useAuthorization:true, configType:Runtime
    2008.12.12 at 06:41:07:652: Thread-13: BusinessLogicLayer - (DEBUG) Push Stack: updateBusinessMessage
    2008.12.12 at 06:41:07:656: Thread-13: BusinessLogicLayer - (DEBUG) Pop Stack: updateBusinessMessage
    2008.12.12 at 06:41:07:656: Thread-13: B2B - (DEBUG) oracle.tip.adapter.b2b.engine.Engine:notifyApp retry value <= 0, so sending exception to IP_IN_QUEUE
    2008.12.12 at 06:41:07:658: Thread-13: B2B - (DEBUG) Engine:notifyApp Enter
    2008.12.12 at 06:41:07:663: Thread-13: B2B - (DEBUG) Enqueue Engine AQJMSCorrelationID = null
    2008.12.12 at 06:41:07:663: Thread-13: B2B - (DEBUG) notifyApp:notifyApp Enqueue the ip exception message:
    <Exception xmlns="http://integration.oracle.com/B2B/Exception" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <correlationId>null</correlationId>
    <b2bMessageId>0AF77A6111E29ED374E000001BDE3D60</b2bMessageId>
    <errorCode>AIP-50079</errorCode>
    <errorText>Transport error: [IPT_HttpSendHttpResponseError] HTTP response error :Connection reset.
    Connection reset</errorText>
    <errorDescription>
    <![CDATA[Machine Info: (dys094w004)
    Transport error: [IPT_HttpSendHttpResponseError] HTTP response error :Connection reset.
    Connection reset ]]>
    </errorDescription>
    <errorSeverity>2</errorSeverity>
    </Exception>
    2008.12.12 at 06:41:07:692: Thread-13: B2B - (DEBUG) Engine:notifyApp Exit
    2008.12.12 at 06:41:07:693: Thread-13: B2B - (DEBUG) DBContext commit: Enter
    2008.12.12 at 06:41:07:696: Thread-13: B2B - (DEBUG) DBContext commit: Transaction.commit()
    2008.12.12 at 06:41:07:696: Thread-13: B2B - (DEBUG) DBContext commit: Leave
    2008.12.12 at 06:41:07:696: Thread-13: B2B - (DEBUG) oracle.tip.adapter.b2b.msgproc.Request:outgoingRequest Exit
    2008.12.12 at 06:41:07:696: Thread-13: B2B - (INFORMATION) oracle.tip.adapter.b2b.engine.Engine:processOutgoingMessage:
    ***** REQUEST MESSAGE *****
    Please help.
    Thanks & Regards,
    Anuj Dwivedi

    Hi Sinkar,
    Thanks for the reply. I confirmed it with my Trading Partner and their server is not running but still I want to know that why am I not able to send message to any other Trading Partner after getting this error once. And if I restart the server, it again acts normally and I am able to send message to other Trading Partners.
    SSL is configured properly because I was able to communicate with this Trading Partner earlier when their server was up.
    We are working on 10.1.2.3.0 with 7457066 MLR 5 patch. Please guide if any other patch required.
    Thanks for the help.
    Warm Regards,
    Anuj Dwivedi

  • SM59 Error in HTTP connections to ABAP Sytems

    Hi All,
      My scenario is to connect to XI systems... I need to create a RFC destination (HTTP connections to ABAP Systems) in SM 59 with below details.....
    Target host: xyz.abc.com
    Service No. : 0000
    Prefix path : /sap/xi/engine?type=entry
    But SAP GUI is not accepting the character "?" ...
    Can any one tell what can be done to avoid this error?

    Hi,
    it's only a warning -> just press 'Enter' key.
    Regards
    Patrick

  • HTTP connection to ABAP Runtime failed. Error: 403 Forbidden

    Hi ALL
    We where testing our scenario using the Test Configuration in Integration Engine.
    We have come across the following error in the second step of Determining the receiver.Here is the error message we received...
    HTTP connection to ABAP Runtime failed. Error: 403 Forbidden URL: _http://SAPXDV01.sap.client1.local:8000/sap/xi/simulation?sap-client=150 User: PIDIRUSER
    Please, do let us know ... if you have received similar error & what solution can be applied...
    Your help is greatly appreciated!
    Thank you,
    Patrick

    Hi,
    Go through this thread...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0f00c890-0201-0010-beb2-c96050edc426
    JCO_COMMUNICATION_FAILURE
    Error in XI server: JCO_COMMUNICATION_FAILURE in Message Mapping
    This might help you..
    Regards,
    Divya

  • File To Proxy Error ICM HTTP CONNECTION FAILED

    Dear All ,
    Iam Doing File to Proxy Scenario.
    XML File is picked by XI Adapter is Properly and if i go and Check in SXMB_MONI,
    It is Showing Status is Scheduled for outbound processing and if i see in  Que Status  is stop with red symbal .If I Click on QueueID it is opening the inbound qRFC Monitoring ,there if click on Queue Name it is showing Status :SYSFAIL,If I Click on SYSFAIL it is Showing the XI Error CLIENT_RECIVE_FAILED.INTERNAL:Que Stop, If I Click on QueueName it is showing while Executing the Functiomodule SXMS_ASYNC_EXE It is having prob i thik showin Error Text :CLIENT_RECIVE_FAILED.INTERNAL:Que Stop,If I Click on Quename it is showing a program RSXMB_SELECT_MESSSAGES is Similar to our SXMB_MONI ,here it is showing the Status Falg Red ,If I Click on that message it is opening the pipeline steps , here while calling Adapter Showing red symbal  giving the Error Message ICM_HTTP_CONNECTION_FAILED
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">CLIENT_RECEIVE_FAILED</SAP:Code>
      <SAP:P1>400</SAP:P1>
      <SAP:P2>ICM_HTTP_CONNECTION_FAILED</SAP:P2>
      <SAP:P3 />
      <SAP:P4 />
      <SAP:Stack>Error while receiving by HTTP (error code: 400, error text: ICM_HTTP_CONNECTION_FAILED)</SAP:Stack>
      <SAP:Retry>A</SAP:Retry>
      </SAP:Error>
    Please help me its urgent.
    Regards
    Kumar

    hi
    This is the problem relleated to the HTTP connections, since using the proxy theXML travels to the destination, on your receiveing system make sure HTTP service are active.
    in R/3 run this report :SPROX_CHECK_HTTP_COMMUNICATION  you will get the error then proceed with the below steps to fix it.
    YOur HTTP seriveces on the R/3 have some problem.....
    Goto SMICM>goto>servicess you should see the HTTP service running with the ABAP port entry, if this is up then check
    SICF--->press f2 you should not have any proxy check there.....
    if these are fine then problem is with the Sproxy configuration........

Maybe you are looking for