如何在Android应用程序中使用OCR Web服务。我们如何发送请求并得到回应?应用程序、如何在、Web、Android

由网友(32号你来找我)分享简介:如何在Android应用程序,我们可以使用OCR Web服务我已经使用这个Web服务。我如何可以通过使用皂基Web服务数据,并得到响应返回。如何传递要求嵌套的XML标记?How can we use OCR web service in android applicationI have use this w...

如何在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);
阅读全文

相关推荐

最新文章