Free Support Forum - aspose.cloud

Problem using GetSlideCount with .NET SDK - JSON deserialization error

Hi there,

I have tried to use Cloud SDK, downloaded today, out of the box with no modifications, other than a simple test console project added to the SDK solution.

I keep getting an error when getting the slide count. It fails with a JSON deserialization error: Cannot deserialize JSON object into type 'System.String'. Line 38, position 14.

The PowerPoint file is uploaded correctly, and I can also get the document properties.
I have after this first attempt, tried to upgrade to the latest NewtonSoft.JSON, which then gave me a more detailed, slightly different, error message reported by Newtonsoft:

Error reading string. Unexpected token: StartObject. Path 'Slides.SelfUri', line 37, position 17.

The JSON returned is this:

{"Slides":{"SlideList":[{"Uri":{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides/1","Relation":"self","LinkType":null,"Title":null}},{"Uri":{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides/2","Relation":"self","LinkType":null,"Title":null}},{"Uri":{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides/3","Relation":"self","LinkType":null,"Title":null}},{"Uri":{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides/4","Relation":"self","LinkType":null,"Title":null}}],"SelfUri":{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides","Relation":"self","LinkType":null,"Title":null},"AlternateLinks":[],"Links":[{"Href":"http://api.aspose.com/v1.1/slides/powerpoint.pptx/slides","Relation":"self","LinkType":null,"Title":null}]},"Code":200,"Status":"OK"}


I have attached the powerpoint file, the SDK I use, including the test project, with the original Newtonsoft.JSON included. I hope you can see from this what's going on.


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi Jonas,

Thank you for the details.

We are able to reproduce your reported issue in Aspose for Cloud SDK for .NET. Please make the following change to fix the issue at your end.

Please comment the three lines in the file “SlidesEnvelop.cs” in the “Slidesà RequestHandlers” folder of SDK as mentioned below:

using System.Collections.Generic;

namespace Aspose.Cloud.Slides

{

///

/// represents container part of the slides resource response

///

public class SlidesEnvelop

{

//public List AlternateLinks { get; set; }

//public List Links { get; set; }

//public string SelfUri { get; set; }

public List<SlideResponse> SlideList { get; set; }

}

}

We will update the online version of the SDK soon. Please try the above solution at your end and in case you need any further assistance, please feel free to contact support.

Thanks & Regards,

Hi Jonas,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have updated the online version of Aspose for Cloud SDK for .NET. Please download it again and do let us know if it works fine for you.

Thanks & Regards,