Community

Getting Internal Server Error when trying to use processFields on a submitted image. Answered

I am trying to read empty and square checkboxes using sumbitImage and processFields using this XML file.

<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://ocrsdk.com/schema/taskDescription-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ocrsdk.com/schema/taskDescription-1.0.xsd http://ocrsdk.com/schema/taskDescription-1.0.xsd">
  <fieldTemplates>
      <checkmark id="checkmarkBox">
          <type>square</type>
          <correctionAllowed>true</correctionAllowed>
      </checkmark>
      <checkmark id="checkmarkField">
          <type>empty</type>
          <correctionAllowed>true</correctionAllowed>
      </checkmark>
  </fieldTemplates>
  <page>
      <checkmark template="checkmarkBox" id="r-1-c-1" left="145" top="777" right="170" bottom="795" />
      <checkmark template="checkmarkField" id="r-1-c-2" left="555" top="140" right="655" bottom="280" />
  </page>
</document>

This is how I am posting to RestClient

response = RestClient.post("#{BASE_URL}/submitImage", :upload => {
  :file => File.new(FILE_NAME, 'rb')
})

This works just fine and the status that is returned is "Submitted". I then take the taskId from that response and do:

RestClient.post("#{BASE_URL}/processFields?taskId=#{task_id}", :upload => {
  :file => File.new(XML_FILE_NAME, 'rb')
})

after I run the code all that I get back is this error

<?xml version="1.0" encoding="utf-8"?><error><message language="english">Internal Server Error</message></error>

I can't find the error, Please someone help.

0

Comments

4 comments

  • Avatar
    Paul Mancuso

    If you don't have an answer, could you please give me some example code for using submitImage and processFields

    0
    Comment actions Permalink
  • Avatar
    SDK_support

    To let us investigate the issue, please share or send to CloudOCRSDK@abbyy.com some additional information:

    1. the name of your application,
    2. the image you recognize,
    3. logs from any HTTP debugger (for example, Fiddler).
    0
    Comment actions Permalink
  • Avatar
    Oksana Serdyuk

    Unfortunately, we have not got a ready Ruby sample for the submitImage and the processFields methods, but we can recommend the following links:

    1. The Ruby sample for the processImage method,
    2. The Java sample for the processFields method,
    3. The sample xml file for the processFields method and the corresponding image.
    0
    Comment actions Permalink
  • Avatar
    Oksana Serdyuk

    The issue occurs due to an error in your XML-file: the "applyTo" attribute is required for the "page" element name:

    <page applyTo="0,1">
    
    0
    Comment actions Permalink

Please sign in to leave a comment.