This content has been marked as final. Show 5 replies
Hi, could you find a way for retrieve data for web service? I am using httpconnection but my data in json are lossing by some rason.Regards
I just used HttpConnection to connect to the webservice and I'm getting the response in XML format.
Thanks for your reply. ok, but your xml response is heavyweight? I have a lot of data for retrieve of server. Can you put your code for get data of server with httpconnection? thanks and regards
Your exception says quite a lot. Is your schema identified as: http://www.w3.org/2001/XMLSchema? Try using http://www.w3.org/2001/XMLSchema.dtd instead.
I used the following code
if doc is not null, we can parse the contents and use it. I didn't have too much of data. The above code is working fine for me.
conn = (HttpConnection) Connector.open(url); conn.setRequestMethod(HttpConnection.GET); conn.setRequestProperty("Connection", "Keep-Alive"); int rc = ((HttpConnection)conn).getResponseCode(); if(rc != HttpConnection.HTTP_OK) throw new IOException("HTTP response code"+rc); is = conn.openDataInputStream(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); doc = db.parse(is); doc.getDocumentElement().normalize();