Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private static XmlDocument Communicate(Settings settings, string request, string
if (!Helpers.ParseResponseToXml(erpXmlResponse, logger, out result))
{
result = null;
exception = new Exception("Response is not valid XML");
exception = new Exception($"Response is not valid XML: {erpXmlResponse}");
}
if (result != null && !LicenseService.ValidateLicense(url, result, logger))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.4.25</Version>
<Version>10.4.26</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Live Integration</Title>
<Description>Live Integration</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private static ResponseCacheLevel GetOrderCacheLevel(Settings settings)

// save this hash for next calls
SaveOrderHash(settings, currentHash);

XmlDocument response = GetResponse(settings, requestXml, order, createOrder, logger, out bool? requestCancelled, liveIntegrationSubmitType);
if (response != null && !string.IsNullOrWhiteSpace(response.InnerXml))
{
Expand All @@ -143,8 +143,7 @@ private static ResponseCacheLevel GetOrderCacheLevel(Settings settings)
// error occurred
if (createOrder && (!requestCancelled.HasValue || !requestCancelled.Value))
{
HandleIntegrationFailure(settings, order, failedOrderStateId, orderId, null, logger);
Services.OrderDebuggingInfos.Save(order, $"ERP communication failed with null response returned.", OrderErpCallFailed, DebuggingInfoType.Undefined);
HandleIntegrationFailure(settings, order, failedOrderStateId, orderId, null, logger);
}

Diagnostics.ExecutionTable.Current.Add("DynamicwebLiveIntegration.OrderHandler.UpdateOrder END");
Expand Down Expand Up @@ -268,7 +267,7 @@ private static OrderLine CreateOrderLine(Order order, string productNumber, Logg
private static XmlDocument GetResponse(Settings settings, string requestXml, Order order, bool createOrder, Logger logger, out bool? requestCancelled, SubmitType submitType)
{
XmlDocument response = null;
requestCancelled = null;
requestCancelled = null;

string orderIdentifier = Helpers.OrderIdentifier(order);

Expand All @@ -289,7 +288,8 @@ private static XmlDocument GetResponse(Settings settings, string requestXml, Ord

if (createOrder && error != null)
{
Services.OrderDebuggingInfos.Save(order, $"ERP communication failed with error: {error}", OrderErpCallFailed, DebuggingInfoType.Undefined);
string msg = !string.IsNullOrEmpty(error.Message) ? error.Message : error.ToString();
Services.OrderDebuggingInfos.Save(order, $"ERP communication failed with error: {msg}", OrderErpCallFailed, DebuggingInfoType.Undefined);
}

NotificationManager.Notify(Notifications.Order.OnAfterSendingOrderToErp, new Notifications.Order.OnAfterSendingOrderToErpArgs(order, createOrder, response, error, settings, logger));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override CommandResult Handle()
bool result = OrderHandler.UpdateOrder(settings, order, SubmitType.ManualSubmit) ?? false;
return new CommandResult
{
Message = result ? "Order successfully transferred to ERP" : "Error creating order in ERP. Check the LiveIntegration log for details",
Message = result ? "Order successfully transferred to ERP" : "Error creating order in ERP. Check the Order log and LiveIntegration log for details",
Status = result ? CommandResult.ResultType.Ok : CommandResult.ResultType.Error
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ private static string GetExportedOrdersMessage(List<Order> orders, List<string>
output += $"Orders with IDs [{string.Join(",", orders
.Where(o => !(exportedOrders.Contains(o.Id) ||
alreadyExportedOrders.Contains(o.Id)))
.Select(o => o.Id).Distinct().ToArray())}] were not transferred to ERP. Check the LiveIntegration log for details";
.Select(o => o.Id).Distinct().ToArray())}] were not transferred to ERP. Check the Order logs and LiveIntegration log for details";
}
}
else
{
output = "None of the selected orders were transferred to ERP. Check the LiveIntegration log for details.";
output = "None of the selected orders were transferred to ERP. Check the Order logs and LiveIntegration log for details.";
}

return output;
Expand Down
Loading