Including other node modules in a Homepages Widget

Hi all!

 

I am still learning the ins and outs of the Homepages Widgets SDK, as well as Angular, so please excuse me if the question is silly.

As a learning experience (after going through the samples and creating a few 'hello world'-style widgets, I am attempting to interface with LN through ION. I was able to retrieve data with the `executeIonApiAsync()` function and am getting proper replies.

The issue is that this particular service (LN HoursRegistration API) only supports SOAP for communication. I attempted to use the `@types/xml2js` module to parse the SOAP reply into something I can use in TypeScript, but have encountered a problem.

When running the widget in the development environment, I get this in the console:

zone.min.js:1 GET http://localhost:8080/xml2js 404 (Not Found)
lime-main.js:1 [15:52:46,751] [ERROR] [WidgetService] Error: Fetch error: 404 Not Found

Similarly, when attempting to package the widget, I get:

Begin: Bundle with SystemJS Builder...
Created bundle script file: Widgets/_lime_temp_1569594870632/bundle-aot.js
Changed working directory to: /home/user/projects/Infor_HomepagesWidgetSDK/Samples/Widgets/_lime_temp_1569594870632
Executing: node ./bundle-aot.js
Unhandled rejection Error on fetch for xml2js at file:///home/user/projects/Infor_HomepagesWidgetSDK/Samples/Widgets/_lime_temp_1569594870632/xml2js
        Loading snt.hoursregistration/services/week.data.js
        Loading snt.hoursregistration/main.js  
        Loading snt.hoursregistration/widget-aot.js
        Error: ENOENT: no such file or directory, open '/home/user/projects/Infor_HomepagesWidgetSDK/Samples/Widgets/_lime_temp_1569594870632/xml2js'

(The widget works fine if I remove the xml2js import, but I assume that would mean I have to implement my own XML parsing, which does not particularly appeal to me.)

Am I correct in assuming that I cannot add extra node modules to my widget? Or have I missed some configuration step somewhere?

If node modules cannot be added, how would I go about consuming a SOAP reply in XML from APIs which do not support JSON? Or is there XML/SOAP support in lime or soho, which I somehow missed? (I searched the documentation pages, the GitHub page for the Homepages SDK and the community site.)

 

Thank you in advance!

Marko

Parents Reply Children
No Data