I have a problem with Kxml2. I hope someone is able to help me.
In my application it is nescessary to first send an XML (actually SOAP) message and after that, parse the result. The code I use for this is given just below. This works all great...
But now I need to do a "Rollback" to the webservice. Therefore I need to send a second XML file in the same HTTP session (because I need to send back the session number for security). Just setting up a new output stream using the same parser results in the error 'already reached end of document'. Using a new parser results in the error 'connection already open'...Code:httpConn = (HttpConnection)Connector.open(url); httpConn.setRequestMethod(HttpConnection.POST); httpConn.setRequestProperty("Content-Type", "text/xml;charset=UTF-8"); outputstream = httpConn.openOutputStream(); //**Blablabla some XML in string "WalletCard" :-) outputstream.write(WalletCard.getBytes()); KXmlParser Walletparser = new KXmlParser(); Walletparser.setInput(new InputStreamReader(httpConn.openInputStream())); //**Here comes the actual parsing
Does anyone has an idea?