如何在Android应用程序中使用OCR Web服务。我们如何发送请求并得到回应? [英] How to use OCR web service in android application. How can we send request and get response?

查看:98
本文介绍了如何在Android应用程序中使用OCR Web服务。我们如何发送请求并得到回应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android应用程序,我们可以使用OCR Web服务 我已经使用这个Web服务。 我如何可以通过使用皂基Web服务数据,并得到响应返回。 如何传递要求嵌套的XML标记?

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

请帮助..

推荐答案

其实我得到了正确的答案。对于嵌套要求我写了下面code和它的工作。

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);

这篇关于如何在Android应用程序中使用OCR Web服务。我们如何发送请求并得到回应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆