I am currently working on an android application which requires sending a stream that contained the XML to the server. At the moment, I have an xml as a string in the client application and I want to convert the xml string into an input stream, so that the stream can be passed to the wcf service for processing. Does anyone know how to achieve this?
Here is the code I wrote in android(java) for converting the xml string into input stream, but i think there is some problem with it. Does anyone know what the problem is?
String xml = "<Tr rn=\"000000000000000\" vr=\"T\" sSpre=\"S\" reg=\"P\" dSpre=\"2000-01-01\" dOdprt=\"2000-01-01\" iban=\"SI00\" eno=\"R\" vir=\"B\" maticnaPps=\"0000000000\"><Imetnik davcna=\"00000000\" matSub=\"0000000000\" drz=\"705\"><PopolnoIme>UNKNOWN</PopolnoIme><KratkoIme>UNKNOWN</KratkoIme><Naslov sifTipNaslova=\"00\" sifObcina=\"000\" sifPosta=\"0000\" sifUlica=\"0000\" sifNaselje=\"000\" stHisna=\"000\" sifHsmid=\"00000000\"><Obcina>UNKNOWN</Obcina><Posta>UNKNOWN</Posta><Ulica>UNKNOWN</Ulica><Naselje>UNKNOWN</Naselje></Naslov></Imetnik></Tr>";
InputStream is= new ByteArrayInputStream(xml.getBytes("UTF-8"));
Thanks for any helps in advance.