How can I deserialize this JSON (Unexpected character encountered while parsing value)?

I have no experience with deserialization, and am trying to figure out how to get this working. I am using JSON.NET, and attempts to deserialize come up with the following: Unexpected character encountered while parsing value: c. path '', line 0 position 0

I am currently working with the following JSON object:




            "OrderDate":"11/17/2014 2:20:35 PM",

            "ShippingMethod":"USPS Priority Mail",





                        "AddressLine1":"9 Hispalis Rd",













                        "AddressLine1":"9 Hispalis Rd",









            "UpdateAt":"11/17/2014 2:21:08 PM",
























"ShippedDate1":"12/11/2014 12:56:40 AM",





"SupplierName":"Baldwin Filters",

"ShippingService":"USPS Parcel Post",

"ShipTo":"Paul Quirnbach",






Open in new window

Here is the PO Class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace FreestyleAPI
    public class PO
    public int id { get; set; }

    public int OrderNumber { get; set; }

    public DateTime OrderDate { get; set; }

    public string ShippingMethod { get; set; }

    public BillingAddress BillingAddress { get; set; } //requires class

    public ShippingAddress ShippingAddress { get; set; } //requires class

    public DateTime UpdateAt { get; set; }

    public string OrderStatus { get; set; }

    public decimal TotalAmount { get; set; }

    public decimal PaidAmount { get; set; }

    public decimal ShippingAmount { get; set; }

    public decimal TaxAmount { get; set; }

    public OrderItems[] OrderItems { get; set; } //requires class

    public string HandlingInstructions { get; set; }

    public string SpecialInstructions { get; set; }

    public string PromotionCode { get; set; }

    public string SalesChannelId { get; set; }

    public Shipments[] Shipments { get; set; } //requires class

    public DropshipPurchaseOrders[] DropShipPurchaseOrders { get; set; } //requires class


Open in new window

Here is the deserialization code:

logger.Log("loadJSON:" + strfile);

            FileReference fileref = new FileReference();
            fileref.filename = strfile;

            PO POTest = new PO(); //instance of PO class

            fileref.isValid = false;
            //load the xml document
                POTest = JsonConvert.DeserializeObject<PO>(strfile);

                Console.WriteLine("success,loaded JSON");
                logger.Log("loaded JSON:" + strfile);

            catch (Exception ex)
                logger.Log("unable to load JSON doc:" + strfile + " " + ex.ToString());

Open in new window

Jordan JohnsonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
strfile contains a file path, not JSON data. I suspect you intended on passing the contents of that file?

POTest = JsonConvert.DeserializeObject<PO>(strfile);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.