Open kcastrotech opened 7 years ago
We are already on a modified fork of node-soap to fix a recursion issue with stack overflow when parsing the MS wdsl. If it makes sense to, we can modify that fork? Otherwise, been thinking of replacing node-soap completely, but yet to find the time to research another library.
I ended up putting this on the back burner and focusing on push notifications instead which I was able to get working with minimal modifications. However, I think I've got an idea on how to do this.
It would appear that the node-soap HttpClient (soap\lib\http.js:21) accepts options.request as an option that later gets used to make the eventual request to the soap server. I then tracked the wsdlOptions object and it would appear that it gets passed along to wsdl.open_wsdl whereby it is then used to create a new HttpClient (soap\lib\wsdl.js:2149). I think I can tap into that by passing a custom function as wsdlOptions.request that wraps the request module. Then I should be able to intercept the request and pipe (https://github.com/request/request#streaming) it to a function that can process the incoming stream.
If that works then no modifications should be needed. I'll keep everyone posted on how it goes.
Also, have you seen strong-soap? (https://github.com/strongloop/strong-soap) I haven't played with it yet but it might be a suitable alternative and would seem to fit in node-ews perfectly with little to no modification. I'm just not sure about the stack overflow issue. But if I get a chance I'll replace node-soap with that and let you know how it goes. Can you link me to the original issue and fix for the stack overflow problem so I can be sure to test properly?
Issue #17 and fork of node this lib uses is here: https://github.com/CumberlandGroup/node-soap with modified code here: https://github.com/CumberlandGroup/node-soap/commit/aafad446344ef858d424126061287376893edc8e
The issue is node-soap does a LOT of recursive function without a process.nexttick, while the MS wsdl has a lot of self referencing logic. (=boom) See here for some details on this with javascript and recursion: http://stackoverflow.com/questions/28349548/how-does-process-nexttick-keep-my-stack-from-blowing-up
Oh yeah... I remember that issue now! :)
Moved over to the updated version of node-soap (19.2) in version 3.2.x. Im curious if this is working now?
Has this issue been fixed aready? I still encounter the Problem
I'm playing around with the EWS streaming subscription and am wondering if there is a way to access the streaming request as data comes in instead of waiting until it finishes?
For example, if I create a subscription then use the "GetStreamingEvents" function like so:
The "then(events => {..." isn't called until after the connection times out (e.g. 1 minute) and the response at that point contains multiple envelopes with or without events:
So what I need to do is tap into the request as it's running and parse the streaming data as it comes in.
I've been digging through the node-ews and node-soap code but am not seeing anything that can allow me to do that without forking it. I was hoping someone here may have another idea or knows of something that I've missed?
Thanks in advance!