dymosoftware / dymo-connect-framework

DYMO Connect Framework for Javascript.
Other
92 stars 54 forks source link

Sample code broken #15

Closed JamesHouden closed 3 years ago

JamesHouden commented 3 years ago

Running the PreviewAndPrintLabel sample code in github, forcing the load of the .dymo or .label file results in the following 500 exceptions from https://127.0.0.1:41951/DYMO/DLS/Printing/RenderLabel

I'm using Dymo Connect 8.7.3

Here's the full error. See the sample application to repro issue.

VM172:1 POST https://127.0.0.1:41951/DYMO/DLS/Printing/RenderLabel 500
(anonymous) @ VM172:1
ajaxSync @ dymo.connect.framework.js:2
invokeWsCommand @ dymo.connect.framework.js:2
DlsWebService.renderLabel @ dymo.connect.framework.js:2
renderLabel @ dymo.connect.framework.js:2
dymo.label.framework.renderLabel @ dymo.connect.framework.js:2
dymo.label.framework.Label.render @ dymo.connect.framework.js:2
updatePreview @ PreviewAndPrintLabel.js:46
(anonymous) @ PreviewAndPrintLabel.js:114
c @ jquery.min.js:2
fireWith @ jquery.min.js:2
l @ jquery.min.js:2
(anonymous) @ jquery.min.js:2
load (async)
send @ jquery.min.js:2
ajax @ jquery.min.js:2
S.<computed> @ jquery.min.js:2
labelFile.onchange @ PreviewAndPrintLabel.js:103
dymo.connect.framework.js:2 Uncaught Error: {"message"

{"message":"An error has occurred.","exceptionMessage":"ReadElementContentAs() methods cannot be called on an element that has child elements. Line 3, position 6.","exceptionType":"System.Xml.XmlException","stackTrace":"   at System.Xml.XsdValidatingReader.InternalReadElementContentAsObject(XmlSchemaType& xmlType, Boolean unwrapTypedValue, String& originalString)\r\n   at System.Xml.XsdValidatingReader.ReadElementContentAsString()\r\n   at DYMO.LabelAPI.DYMOLabel`1.Deserialize(XmlReader reader)\r\n   at DYMO.CrossPlatform.Common.Helpers.SerializationHelper.Deserialize[T](XmlReader reader)\r\n   at DYMO.LabelAPI.LabelHelper.ReadAndOpenLabel(XmlReader reader)\r\n   at DYMO.LabelAPI.LabelHelper.OpenLabel(XmlReader reader)\r\n   at DymoSDK.Implementations.DymoLabel.LoadLabelFromXML(String xmlContent)\r\n   at DYMOWebApi.Windows.Controllers.DymoDLSSDKController.RenderLabel(FormDataCollection formDataCollection)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\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.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()\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.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()\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.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"}: 
    at ajaxSync (dymo.connect.framework.js:2)
    at invokeWsCommand (dymo.connect.framework.js:2)
    at DlsWebService.renderLabel (dymo.connect.framework.js:2)
    at Object.renderLabel (dymo.connect.framework.js:2)
    at Object.dymo.label.framework.renderLabel (dymo.connect.framework.js:2)
    at dymo.label.framework.Label.render (dymo.connect.framework.js:2)
    at updatePreview (PreviewAndPrintLabel.js:46)
    at Object.success (PreviewAndPrintLabel.js:114)
    at c (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
JamesHouden commented 3 years ago

wrong github repo