Strange. It works well for me. How is your catalog structured? Does it have nodes and entries as direct children?
I have this:
Catalog root (type: catalog root)
-books (type: catalog)
-- (contains lots of variants)
-- X (type: category)
-- X2 (type: category)
-enbooks (type: catalog)
Please contact our developer support service for further assistance. When we have your databases we will be able to investigate properly
Hi Rickard, we received the ticket from you. However it might be easier to investigate the problem if you can send me the catalog directly, my email is quma at episerver.com
Hi,
I updated to ServiceAPI 5.0 and EPiServer.Commerce 12.2.0 some days ago. Now when I try to fetch all catalogs (episerverapi/commerce/catalogs) from service API I get this exception:
"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"Unable to cast object of type 'Castle.Proxies.ProductContentProxy' to type 'EPiServer.Commerce.Catalog.ContentTypes.NodeContent'.","ExceptionType":"System.InvalidCastException","StackTrace":" at System.Linq.Enumerable.d__95`1.MoveNext()\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.CatalogModelFactory.MapCatalogContent(CatalogContent catalogContent)\r\n at EPiServer.ServiceApi.Commerce.Controllers.Catalog.Construction.CatalogModelFactory.b__2_0(CatalogContent c)\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content)\r\n at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.WebHost.HttpControllerHandler.d__1b.MoveNext()"}}
It worked before the update. There is no added content after the update. Have anyone seen this before?
Thanks,
Rickard