Process the XML in a User object

  • 1.6K Views
  • Last Post 01 October 2015
supreet posted this 28 January 2015

Hi, I am using your cloud SDK. I receive an XML same as mentioned in your API Reference docs here http://ocrsdk.com/documentation/apireference/processBusinessCard/

The question is how do I convert it to my user object in c#

This is my user class for your reference

public class User { public string Phone { get; set; } public string Email { get; set; }

    public string Name { get; set; }
    public string Company { get; set; }

    public string Job { get; set; }

    public string Text { get; set; }

}

Thanks ST

Order By: Standard | Newest | Votes
supreet posted this 28 January 2015

To add to my question this is the code I use to download from the URL & get the text data

var webClient = new WebClient(); webClient.Encoding = Encoding.UTF8; webClient.DownloadStringCompleted += (s, e) => { try { var text = e.Result; } }

supreet posted this 28 January 2015

& following is a text representation that I finally get in text variable above

<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\r\n<document xmlns:xsi="\\"http://www.w3.org/2001/XMLSchema-instance\\"" xsi:schemalocation="\\"http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd" <a="" href="http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd\\" "="">http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd\\" xmlns=\\"http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd\\">\r\n <businesscard>\r\n <field type="\\"Phone\\"">\r\n <value>+91-8602-005-268</value>\r\n </field>\r\n <field type="\\"Email\\"">\r\n <value>kunal.chowdhury@taritas.com</value>\r\n </field>\r\n <field type="\\"Name\\"">\r\n <value>Kunal Chowdhury</value>\r\n </field>\r\n <field type="\\"Company\\"">\r\n <value>taritas</value>\r\n </field>\r\n <field type="\\"Job\\"">\r\n <value>Technical Lead</value>\r\n </field>\r\n <field type="\\"Text\\"">\r\n <value>KUNAL CHOWDHURY\r\nTechnical Lead\r\nQ +91-8602-005-268\r\n© kunal.chowdhury@taritas.com\r\n?</value>\r\n </field>\r\n </businesscard>\r\n</document>

supreet posted this 02 February 2015

any updates on this please. We are still stuck here. Thanks

Lilya Chesnova posted this 02 February 2015

Sameer Arya posted this 01 October 2015

Hi,

Above link are not working, Could you please recheck and send it again.

Thanks

Oksana Serdyuk posted this 01 October 2015

Hi, the link is OK.

Close