Developer forum

Forum » Integration » Live integration not working, stock and prices not shown

Live integration not working, stock and prices not shown

Goncalo Faria
Reply

Hello.

I've been having an issue with a clients Live integration with AX. The requests and response succeeds but then there is an error and no prices or stock are show:

Request GetProductsInfo sent:
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GetEcomData ExternalUserId="CONTACTO" AccessUserCustomerNumber="CONTACTO" VatCountryCode="DK" VatPostingGroup="">
    <tables>
        <Products type="filter">
            <Product>
                <ProductId>010106303470152</ProductId>
                <ProductVariantId></ProductVariantId>
                <ProductNumber>010106303470152</ProductNumber>
                <ProductUnitId></ProductUnitId>
                <ProductIdentifier>010106303470152..LANG3</ProductIdentifier>
                <CurrencyCode></CurrencyCode>
                <Quantity>1</Quantity>
            </Product>
        </Products>
    </tables>
</GetEcomData>
 
Response GetProductsInfo received:
 
<?xml version="1.0" encoding="utf-8"?>
<tables>
    <table tableName="EcomProducts">
        <item table="EcomProducts">
            <column columnName="ProductId"><![CDATA[010106303470152]]></column>
            <column columnName="ProductVariantId"><![CDATA[]]></column>
            <column columnName="ProductNumber"><![CDATA[010106303470152]]></column>
            <column columnName="ProductName"><![CDATA[VALV.KVN-VIII -KX-GT PN-40 RF DN-150 C/ANILLOS GRAF.LAMINADO]]></column>
            <column columnName="ProductLongDescription"><![CDATA[VALV.KVN-VIII -KX-GT PN-40 RF  DN-150 C/ANILLOS GRAF.LAMINADO]]></column>
            <column columnName="ProductIdentifier"><![CDATA[010106303470152..LANG3]]></column>
            <column columnName="Quantity"><![CDATA[1]]></column>
            <column columnName="ProductPrice"><![CDATA[3371.21]]></column>
            <column columnName="ProductStock"><![CDATA[1.00]]></column>
        </item>
    </table>
    <table tableName="EcomPrices">
        <item table="EcomPrices">
            <column columnName="PriceId"><![CDATA[5637155962]]></column>
            <column columnName="PriceProductId"><![CDATA[010106303470152]]></column>
            <column columnName="PriceProductVariantId"><![CDATA[]]></column>
            <column columnName="PriceProductLanguageId"><![CDATA[LANG3]]></column>
            <column columnName="PriceCurrency"><![CDATA[EUR]]></column>
            <column columnName="PriceQuantity"><![CDATA[1.00]]></column>
            <column columnName="PriceAmount"><![CDATA[677.00]]></column>
            <column columnName="PriceUserCustomerNumber"><![CDATA[]]></column>
        </item>
    </table>
</tables>

 

then getting the /dwapi/ecommerce/products/010106303470153?UserId=&LanguageId=LANG3&CurrencyCode=EUR&CountryCode=ES&ShopId=SHOP10&FilledProperties=Id,Price,PriceBeforeDiscount,StockLevel,VariantInfo,NeverOutOfstock,Prices&PriceSettings.ShowPricesWithVat=True&PriceSettings.FilledProperties=Price,PriceFormatted&getproductinfo=true"

Returns:


{ "Message": "An error has occurred.", "ExceptionMessage": "Object reference not set to an instance of an object.", "ExceptionType": "System.NullReferenceException", "StackTrace": " at Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Products.ProductManager.FetchProductInfosInternal(Dictionary`2 productsForRequest, CacheLevel productCacheLevel, LiveContext context, Settings settings, Logger logger, Boolean updateCache)\r\n at Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Products.ProductManager.FetchProductInfos(Dictionary`2 products, LiveContext context, Settings settings, Logger logger, Boolean updateCache)\r\n at Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Products.StockProvider.FindStockLevel(Product product)\r\n at Dynamicweb.Ecommerce.Stocks.StockLevelManager.FindStockLevel(Product product, String unitId, StockLocation stockLocation)\r\n at Dynamicweb.Ecommerce.Products.Product.GetUnitStock(StockLocation stockLocation, String unitId)\r\n at Dynamicweb.Ecommerce.ProductCatalog.ViewModelPropertyFiller`1.Fill[S](T model, String propertyName, Func`1 source)\r\n at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.BulkCreateView(ProductViewModelSettings settings, Boolean isRecursive, IList`1 products)\r\n at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(ProductViewModelSettings settings, Product product)\r\n at Dynamicweb.Ecommerce.WebAPI.Controllers.ProductsController.GetProduct(String id, String variantId, ProductViewModelSettings request)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()" }

 

Anny suggestion?

 

Thank you,

Goncalo


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Goncalo,
it looks like you are having the "Product information cache level" set to Session in the Live integration settings, so try to change it to "Page" instead.
We already have a bug for fixing that problem so it should be fixed soon, meanwhile you can try this workaround.
BR, Dmitrij

 
Goncalo Faria
Reply

Hello Dmitriy,

If I set it up in in Page instead, I dont get any values. No prices or stock.

{
  "Id": "010106303470153",
  "VariantId": null,
  "LanguageId": null,
  "Name": null,
  "Title": null,
  "ShortDescription": null,
  "LongDescription": null,
  "MetaDescription": null,
  "MetaTitle": null,
  "MetaKeywords": null,
  "Number": null,
  "Created": null,
  "Updated": null,
  "Keywords": null,
  "Weight": null,
  "StockLevel": 500.0,
  "Width": null,
  "Height": null,
  "Depth": null,
  "PurchaseMinimumQuantity": null,
  "PurchaseQuantityStep": null,
  "Cost": null,
  "EAN": null,
  "ExpectedDelivery": null,
  "Discontinued": false,
  "DiscontinuedAction": 0,
  "PointPrice": null,
  "DefaultVariantId": null,
  "DefaultUnitId": null,
  "VariantName": null,
  "Active": false,
  "Rating": null,
  "ReplacementProduct": null,
  "Price": {
    "ShowPricesWithVat": false,
    "Price": 0.0,
    "PriceFormatted": "0,00 EUR",
    "PriceWithoutVat": 0.0,
    "PriceWithoutVatFormatted": null,
    "PriceWithVat": 0.0,
    "PriceWithVatFormatted": null,
    "Vat": 0.0,
    "VatFormatted": null,
    "VATPercent": 0.0,
    "VATPercentFormatted": null,
    "CurrencyCode": null
  },
  "PriceInformative": null,
  "PriceBeforeDiscount": {
    "ShowPricesWithVat": false,
    "Price": 0.0,
    "PriceFormatted": "0,00 EUR",
    "PriceWithoutVat": 0.0,
    "PriceWithoutVatFormatted": null,
    "PriceWithVat": 0.0,
    "PriceWithVatFormatted": null,
    "Vat": 0.0,
    "VatFormatted": null,
    "VATPercent": 0.0,
    "VATPercentFormatted": null,
    "CurrencyCode": null
  },
  "Discount": null,
  "ProductDiscounts": null,
  "Prices": [],
  "ProductFields": null,
  "ProductCategories": null,
  "FieldDisplayGroups": null,
  "Groups": null,
  "PrimaryOrDefaultGroup": null,
  "VariantInfo": {
    "ProductID": "010106303470153",
    "VariantID": "",
    "OptionID": null,
    "OptionName": null,
    "OptionColor": null,
    "OptionSort": 0,
    "ProductName": "VALV.KVN-VIII -KX-GT PN-40 RF DN-200 C/ANILLOS GRAF.LAMINADO",
    "ProductNumber": "010106303470153",
    "ProductStock": 10.0,
    "VariantInfoGroupId": null,
    "VariantInfoGroupName": null,
    "VariantInfoGroupDescription": null,
    "OptionImage": null,
    "Image": {
      "Value": "/Files/Images/missing_image.jpg",
      "Name": "Default",
      "Keywords": null,
      "DisplayName": null
    },
    "Price": {
      "ShowPricesWithVat": false,
      "Price": 0.0,
      "PriceFormatted": "0,00 EUR",
      "PriceWithoutVat": 0.0,
      "PriceWithoutVatFormatted": null,
      "PriceWithVat": 0.0,
      "PriceWithVatFormatted": null,
      "Vat": 0.0,
      "VatFormatted": null,
      "VATPercent": 0.0,
      "VATPercentFormatted": null,
      "CurrencyCode": null
    },
    "PriceMin": {
      "ShowPricesWithVat": false,
      "Price": 0.0,
      "PriceFormatted": "0,00 EUR",
      "PriceWithoutVat": 0.0,
      "PriceWithoutVatFormatted": null,
      "PriceWithVat": 0.0,
      "PriceWithVatFormatted": null,
      "Vat": 0.0,
      "VatFormatted": null,
      "VATPercent": 0.0,
      "VATPercentFormatted": null,
      "CurrencyCode": null
    },
    "PriceMax": {
      "ShowPricesWithVat": false,
      "Price": 0.0,
      "PriceFormatted": "0,00 EUR",
      "PriceWithoutVat": 0.0,
      "PriceWithoutVatFormatted": null,
      "PriceWithVat": 0.0,
      "PriceWithVatFormatted": null,
      "Vat": 0.0,
      "VatFormatted": null,
      "VATPercent": 0.0,
      "VATPercentFormatted": null,
      "CurrencyCode": null
    },
    "Stock": 10.0,
    "VariantInfo": null
  },
  "DefaultImage": null,
  "GroupPaths": null,
  "ImagePatternImages": null,
  "Manufacturer": null,
  "AssetCategories": null,
  "NeverOutOfstock": false,
  "StockUnits": null,
  "UnitOptions": null,
  "RelatedGroups": null
}
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Can you specify the version you are using?

 
Goncalo Faria
Reply

Hello Nicolai,

Dynamicweb 9.14.4;

Dynamicweb.Ecommerce 1.14.13;

Dynamicweb.Ecommerce.DynamicwebLiveIntegration 7.0.3 .

 

Any other relevant for this?

 

Regards,

Goncalo


 

 

You must be logged in to post in the forum