×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    58

    j2me web service error

    Hello everyone,

    I have developed a web service application in j2me, which is working fine in emulator but when i deploy it in nokia handset (nokia 110) it shows me random errors: java.io.IOException 53 error in http operation, java.io.IOException 28 error in http operation, java.io.IOException 52 error in http operation etc. Also when tested with (nokia c101) it shows xml parser exception. here is my attached code:

    private final String SERVICEURL = "http://www.friends2support.org/Friends2SupportService.asmx";
    private final String NAMESPACE = "http://friendstosupport.org/";
    private final String SOAPACTIONSTATES = "http://friendstosupport.org/GetStates";

    public void getStateName() {
    try {
    SoapObject rpc = new SoapObject(NAMESPACE, STATEMETHOD);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.bodyOut = rpc;
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.XSD;
    HttpTransport ht = new HttpTransport(SERVICEURL);
    ht.debug = true;
    ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    ht.call(SOAPACTIONSTATES, envelope);
    SoapObject response1 = (SoapObject) envelope.bodyIn;
    SoapObject root1 = (SoapObject) response1.getProperty(0);
    SoapObject s_deals1 = (SoapObject) root1.getProperty("NewDataSet");
    String[] statename = new String[s_deals1.getPropertyCount()];
    String[] stateid = new String[s_deals1.getPropertyCount()];
    for (int i = 0; i < s_deals1.getPropertyCount(); i++){
    SoapObject ss1 = (SoapObject) s_deals1.getProperty(i);
    statename[i] = ss1.getProperty("state").toString().trim();
    stateid[i] = ss1.getProperty("stateId").toString().trim();
    }
    ascendingStateOrder(statename, stateid);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: j2me web service error

    From where do classes like SoapSerializationEnvelope come from? kSoap? Sounds like an issue in that library...

    I think those devices support JSR 172 (XML RPC services)... have you tried using it? There is an example in the wiki.

Similar Threads

  1. Web service with j2me
    By chia_84 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-06-30, 10:47
  2. New to j2me web service
    By littleson in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2009-02-11, 11:47
  3. j2me web service
    By littleson in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2009-02-10, 16:10
  4. j2me-web service
    By phate7 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-03-12, 21:00
  5. Error Implementing J2ME Web Service in Nokia 80 Series
    By ductechteam in forum Mobile Java General
    Replies: 0
    Last Post: 2005-08-21, 14:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×