J2me - servlet : data not coming to servelt

Hi all,
I'm trying to parse data to servlet from a Midlet. but servet not recieved data.
Midlet code segment is:
void invokeServlet(String url) throws IOException {
        HttpConnection c = null;
        InputStream is = null;
        OutputStream os = null;
        StringBuffer b = new StringBuffer();
        TextBox t = null;
        try {
          c = (HttpConnection)Connector.open(url);
          c.setRequestMethod(HttpConnection.POST);
          c.setRequestProperty("IF-Modified-Since", "20 Oct 2001 16:19:14 GMT");
          c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
          c.setRequestProperty("Content-Language", "en-CA");
          c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
          os = c.openOutputStream();
          // encode data
          os.write(("to="+to).getBytes()); //to is the global String variable
          os.flush();
          is = c.openDataInputStream();
          int ch;
          while ((ch = is.read()) != -1) {
            b.append((char) ch);
            System.out.print((char)ch);
          t = new TextBox("Confirmation", b.toString(), 1024, 1);
          t.setCommandListener(this);
        } finally {
           if(is!= null) {
              is.close();
           if(os != null) {
              os.close();
           if(c != null) {
              c.close();
        display.setCurrent(t);
    } Servlet code segment is:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          System.out.println("test post");
          response.setContentType("text/plain");
        java.io.PrintWriter out = response.getWriter();
        String to = request.getParameter("to");
        // construct an instance of EmailSender
        out.println("data recieved... " + to);
     }                   finally I got on the mobile screen data recieved...null
why it is null?

I think you should use this properties :
c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
c.setRequestProperty("Content-Length",   Integer.toString(message.length())); Be carefull that the Content-Length property takes the parameter name into account too .... so the length is computed on the whole message ("to=" + to)
Regards.

Similar Messages

  • SLED date not coming automatically

    hi,
    As per my client requirement they will enter the production date only in goods receipt and SLED date have to come automatically at GR time. I already maintain the Total shelf life and minimum remaining shelf life in material master.i activated SLED for plant and movement type but SLED date not coming automatically.
    If i l enter SLED date more than my Total shelf life period , then system automatically updating the total shelf life period in batch master record. how to avoid this issue? i want whatever shelf life entered in GR should have to recorded not system calculated based on master data(Total-shelf life)
    Thanks
    Muthuraman.D

    Dear all,
    i am using internal batch numbers at the time of goods receipt  provide me  some solution for above issue?.....
    Thanks
    Muthuraman.D
    Edited by: muthuraman d on Nov 7, 2011 12:18 AM

  • Data not coming in cube...

    Hi,
    I have loaded data in ODS but when loading the data from this ODS to cube it is not fetching any data in the cube. I have created the DTP to transfer data from ODS. but no data is coming in cube.
    Any mistake I have to correct? or any setting I have to check?
    Please let me know.
    Thanks,
    Jeetu

    Hi Ravi,
    I presed execute button from DTP in schedule tab.
    It is showing DTP as green , no error is there.
    But no records are loaded from ODS through DTP.
    Thanks,
    jeetu

  • Data not coming from DOE to Mobile After defining Rule for device attribute

    Hi All,
    I have created a DO and rule for it.In case of Bulk Rule for all definition when i triggere extract from Portal then all the data comes to outbound queue but when i define rule for Device attribute then no data comes to my Outboun queue.Here is the scenario what i am doing :
    1. I have order header in my backend which has a field named "Work_Center" and this will be criteria field.
    2. In CDS table i have all the records for all the work center.
    3. Now in RMM under customized , i have added an attribute named "Work_center".
    4. Now i defined a rule with Device attribute mapping and activated the rule.
    5. Now on Portal i assigned this data object and in the device attribute tab i assigned the value(this value exist in CDS table for few orders) of a   Work center to the attribute "Work_Center" .
    6. Then i triggrere extract but its Outbound queue is empty, what could be the reason.
    Is my approach is correct
    Regards,
    Abhishek

    Hi Abhishek,
    You can check one ore thing, after you have performed all the steps till step 5, i.e. just before triggering
    extract. Check if the AT table for ur DO has entries based on the criteria specified by you...
    1. In the workbench click on the Data Object, and then right click and select "View Metadata".
    2. Select Distribution Model tab.
    3. Now select your DO's Association table.
    4. For the input field DEVICE ID specify your corresponing device id,and also for status field specify it 
        as "I"  and execute
    If there are any entries now in the AT table, and on triggering extract if they are not coming to the
    outbound Q there is some EXTRACT Q blocked. And is there were no entries in the AT then the rule
    specified is not  the satifying.
    Thanks,
    Swarna
    Now if you have entries w

  • Data Not coming From DSO to Cube

    Hi All,
    I have data in DSO. When i run the DTP , request status is green.
    Now when i go to cube and see the data the request has came but data has not transferred .....
    The Request Status is green in cube but data is not cuming....
    No transferred data.
    How can bring data in cube..??
    Regards,
    Rohit

    Hi,
    When you loaded the DSO......after that are you loading the cube for the first time?If so .....and still data is not coming..then check if the last loaded request somehow got deleted from the DSO....
    If after loading the DSO....you have already loaded the cube...and this is the second time you are loading the cube.........then obviously it will pick 0 records...........since delta DTP always picks the fresh new request..........if there is no new request in the source .......then it will pick 0 records.......
    Also both the cased are not working.........then check the End routine or Start routine.if any.......
    Thanks and Regards,
    Debjani.......

  • Date not coming in proper format after applying formula in Update Rules

    Hi All,
    I have two time characteristics "Goods Issue date" and "Goods Return date" and One key figure "No. of days elapsed".
    The key figure "number of days elapsed" is being calculated by taking difference of "goods issue date" from "goods return date", but the format for that is not coming proper for example:-
    Goods Issue Date is 21.06.2006
    Goods Return Date is 22.08.2006
    According to formula No. of days elapsed shud be 62
    but it is coming as 04.03.0001.
    Please help as it is a urgent requirement.
    Much Appreciated,
    Sunil Morwal.

    Dear Sunil,
      Kindly check if creating 2 new KeyFigures (DATE) will be of help by assigning the said "two time characteristics" values.
      From these 2 new KYFs, apply your formula..
      Hope this helps..
      Thanks.
    Message was edited by: Arnold Padiernos

  • Data not coming to BW from SAP system from last 7 days....please help

    Hi Experts,
    I am monitoring the process chain from last 7-8 days but no data is coming to BW from SAP R/3 . then i checked in SAP R/3 system in RSA7 there weree no queues it was empty. then i checked LBWQ and some MCEX03,MCEX11,MCEX13,MCEX04 were there and i double clicked on one of them then i saw the status in queue as NOSEND . we have used QUEUED DELTA as update mode in LBWE. now i want to bring data for last 7-8 days in BW system. please can anyone provide me the detail steps for this as it is our PRODUCTION system. please provide the steps...!!!!

    Hi,
    Go to SM37 in your R/3 environment and check if there are any jobs starting with LIS* in released status. This is the job which would push the entries from LBWQ to RSA7 for specific applications. If there are no jobs, this is the reason for your problem.
    If you do find any job there, then double click on them to check their frequency. Generally it should be hourly.
    If there is no such job, then go to LBWE. For each of your applications, click on Job Control and maintain the job scheduling. In the start date, maintain it as periodic job. Then simply schedule teh jobs. Once the jobs are scheduled, after every run of them, LBWQ would get cleared.
    Then it would get picked from RSA7 by the BI job.
    Edited by: Rahul K Rai on Dec 8, 2010 4:00 PM

  • Data not coming in proper tabular format - BICS

    Hi friends,
    I tried connecting Xcelsius with BW(BEX query) where I succeeded to connect both system and was able to see objects coming through BEX query into Xcelsius connection defination TAB. When I go to its output values, it contains "cross-tab Data". I clicked on it and map it in excel. My BEX query has only two things one is Material (Char) and other is Amount(Key Figure). So I mapped it with two colums of excel of Xelsius and finally mapped those two colums with Spreadsheet component of Xcelsius to view the things precisely as it is coming.
    But the problem is when I see the output, though it is showing the data but the header of the spreadsheet is bit scattered.As in,
    it should display like:
    Material.....|...Amount..|
    Mat1..........| 5000........|
    Mat2..........| 2000........|
    But it is showing something like
    Key Figures...|...Amount....|
    Material.........................|...........................
    Mat1..............................| 5000........|
    Mat2..............................| 2000........|
    Overall Result...............|..7000.......|
    You can see the second table contains data which is really different from the format I am looking for. What could be the reason for this? Anybody can guide me..
    Thanks alot!!

    Hi kgaurav2k1, if you don´t want to see the "Overall Result" you need to change the query definition to not show total (from Bex Query Designer). Regarding the header, I´ve never could change it, and decided to use the data from the 3rd row. It is the format for a cross-tab header.
    Hope I help.
    Regards,
    Liliana

  • Data not coming in web report

    Hi,
    I have created a multiprovider based on two cubes...have done neccessary identification and selection as well. But the query->web report is not displaying data from one cube. It only displays data for char n kf for one cube and the char n kf for other cube dosent show any data. Also, there are no filters set in the query and data is also available in both the cubes.
    Can anyone please suggest what must be going wrong. Your help will be surely rewarded.
    Regards,
    Minal

    but check if there are any global filters or hidden filters in query used for web reporting
    i donot want any reward

  • Data not coming in AFRU table for 21.05.10 for sometime

    Could you please tell me that why does this happen?
    For a particular date i.e. for 21.05.10, in the afru table the data was not there, it was saying "No Entries for that date" (in se16). Actually there is a z-report which was not showing the per ton draw calculation for that particular date. But for the other dates, it was showing fine.
    Infact, when in the afru table it was showing "No Table Entries found for that particular date", parallely in the z-report it was showing a Default value "341" for all items for 21.05.10.
    But just after 10 mins. the data got updated and its showing fine.
    What can be the problem? Coz its happenning often, and we the abapers are getting tight scold. But the program is correct. I have checked.
    Please Suggest.
    Saheli

    Saheli,
    You need to let us know how you program is designed, if the data is fetched from AFRU table and in AFRU table there were no entries for a posting date, how can you get a value in your custom report?
    Please explain what your report does, so that we can i think and suggest as what might be going wrong.
    Regards,
    Prasobh

  • Messages/Data not coming to Quality XI System

    Dear Xi experts,
    Scenario : RFC to IDOC
    When i execute the RFC program in SAP system based on the variant, i am not getting any data in my Quality XI system.
    I checked the connections (RFC Parameters) from SAP and XI quality...looks it's working fine.
    Regards,
    Ramana Kumar. A

    Hi,
    Never delete the messages in SMQ2 - this will not sort out your problem.
    If your messages are reaching the queue in the application system (ie. can be seen in SMQ2) your problem is the QIN scheduler is not running. This transfers the messages from the application queue to the XI system.
    This is something Basis can help you with.
    Kind regards
    Colin.

  • DATA not coming properly

    Hi ,
    I have a customized report which uses the logical databse PSJ. It has project, wbs element(prps-posid) in the selection screen. When I give input to the project , the output is coming properly with the field(WBS element), but when I give the output WBS element as input in the field , it is retrieving some more data . I went into debugging and found that while retrieving posid from prps table , it is retrieving the value '############' due to which the output has more than the records that should be . Anyone has come across  this scenario, please reply .
    Thanks in advance.

    I assume that the change is present in the PSA. If so is it just one field that is changing or multiple fields. ?
    Also make sure the PSA is empty before loading.
    Asif

  • Data not coming on second page of smartform

    Dear All,
    I am having a smartform . The smartform displays 7 items on first page 7 on next and so on. The problem is if there are total 10 items , the smartform is showing 7 items correctly on first page but showing only one item i.e 8th item on the second page. But it is showing the total in the footer correctly i.e total of all the  10 items .
    Please suggest wht can be the problem.
    I tried everything from my side but all in vain.
    Plz Suggest.
    Manik L Dhakate

    Hi,
    In the default setting, the next page is the page itself.
    If a page is processed (filled) and processing of the form is not finished yet (if not all texts or data
    are displayed), the system processes another page. The page used as next page can be
    determined statically during the form definition (Next page) or dynamically at runtime (manual
    page break).
    The new page is the static next page. If a new page is called by a manual page break with
    page specification within the main window (dynamic next page), the system processes this
    page.
    This page does not contain a main window and no static next page exists
    In a main window you display text and data, which can cover several pages (flow text). As soon
    as a main window is completely filled with text and data, the system continues displaying the text
    in the main window of the next page. It automatically triggers the page break

  • Data Not coming Properly for 0HR_PA_OS_1 Data Source?

    Hi Experts,
    I am trying to load data to 0PAOS_C01 using 0HR_PA_OS_1 data source. For field 0POS_OCCVAC key figure i am not getting any data from Data Source.
    I checked in RSA3 for 0HR_PA_OS_1 data source and  in that it is not populating data for filed OCC_VAC_PERC  field. I checked with HR functional team and they mentioned its a BI issue.
    Kindly tell me how can i populate values for the particular field. FYI i am getting correct data for other fields.
    Please help me.
    Thanks

    The possible reasons
    1.Your user id might not be having the proper authorization to pull the HR data.This you can confirm with your basis guy,if you are unable to find what are the authorization roles required for HR data, for the time being you can take SAP_ALL authorization in development box and try to pull.
                            OR
    2.Try to pull from BW side,you may be able to see the data there because this uses the background user id used in RFC connection ( provided if your background user id having proper authorization ).

  • Float type data not coming properly in ALDSP 2.5

    Hi,
    we are using ALDSP 2.5. We have a SQL server data base. We have created data services based on stored procs from this data base. we have a read method with a field declared as float data type. But the DSP is not showing up the correct data.
    For example,
    we get 250526.31 in DSP where as the stored proc returns 250526.32
    here are some more samples,
    DSP StoredProc
    594919.8     594919.79          
    248918.8 248918.79                              
    339514.47     339514.48                         
    322823.47     322823.48                         
    695810.8 695810.82
    694300.44     694300.42

    open a case with customer support. Attach your DSP dataspace and client, and your stored procedure definition.

Maybe you are looking for

  • Create an instance of my class variable

    Hello all, I'm a newbie to iPhone/iPad programming and am having some trouble, I believe the issue is that I'm not creating an instance of my class variable.  I've got a class that has a setter and a getter, I know about properties but am using sette

  • My iPad screen cracked on its own.  Is this covered by warranty?

    My iPad screen cracked on its own.  Is this covered by warranty?

  • How can i populate records using LOV value

    Create a form based on the following output use EMP Table Create a non Database Block i.e Control Block----> Dept No Create a Database Block -EMP Create an LOV for the Dept no from dept table. For the Current Dept No . Populate the Employee Records H

  • IBook died. Panthr. Can to save/transfr  info to another Mac? with Tiger?

    Let's say a person for some reason didn't have a back up. And then his iBook G4 stopped working and was advised not worth fixing cuz could buy a better, upgraded, but used Mac computer. Can his info, all his docs and bookmarks and favorites, etc., ev

  • Deleting mail messages

    When using my IPad I am unable to delete messages from my IMAP mail acct. I tried to delete messages both individually and as a group using the edit function; however, the messages would disappear, then I got a message that I was unable to delete/mov