0

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 pass request for nested XML tags ?

http://www.ocrwebservice.com/services/OCRWebService.asmx?op=OCRWebServiceRecognize

Please help..

krunal shah
  • 16,089
  • 25
  • 97
  • 143
  • I want to point out another possibility: The WiseTrend OCR API at http://www.wisetrend.com/wisetrend_ocr_cloud.shtml - it's a REST API so should be much easier to use, and it uses the ABBYY OCR engine which is great for low-quality images (like those from mobile phone cameras). (Disclaimer: WiseTrend is my company's customer). – Eugene Osovetsky Dec 01 '10 at 01:00

2 Answers2

2

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!

Community
  • 1
  • 1
Telmo Marques
  • 5,066
  • 1
  • 24
  • 34
  • Thanks for your answer but actually i know how to use webservice with android. My question was regarding nested tags request that we have to pass. – krunal shah Nov 17 '10 at 04:25
1

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);
krunal shah
  • 16,089
  • 25
  • 97
  • 143