How to use OCR web service in android application. How can we send request and get response?
How can we use OCR web service in android application I have use this webservice. How can i pass data using soap base web service and get response back. How can i p开发者_Go百科ass request for nested XML tags ?
http://www.ocrwebservice.com/services/OCRWebService.asmx?op=OCRWebServiceRecognize
Please help..
Please check this library for Android: kSoap2.
Also, check this similar question, that offers a few other solutions: "How to call web service with Android"
Hope it helps!
Actually i got the correct answer. For nested request i wrote the below code and it worked.
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
// Add input values to SOAPObject object - request
request.addProperty("user_name", "test");
request.addProperty("license_code",
"test");
// Add property for nested tags
PropertyInfo pi = new PropertyInfo();
pi.setName("OCRWSSetting");
pi.setValue(new SoapObject(NAMESPACE, "OCRWSSettings")
.addProperty("ocrLanguages", "ENGLISH")
.addProperty("outputDocumentFormat", "TXT")
.addProperty("convertToBW", false)
.addProperty("getOCRText", true)
.addProperty("createOutputDocument", false)
.addProperty("multiPageDoc", false)
.addProperty("ocrWords", false));
request.addProperty(pi);
// Add property for another nested tags
pi = new PropertyInfo();
pi.setName("OCRWSInputImage");
pi.setValue(new SoapObject(NAMESPACE, "OCRWSInputImage")
.addProperty("fileName", getString(R.string.file_name))
.addProperty("fileData",base64String)
);
request.addProperty(pi);
精彩评论