TimLuq / wsdl-to-ts

Generate TypeScript typings for WSDL services
ISC License
61 stars 48 forks source link

"RangeError: Maximum call stack size exceeded" when trying with larger files #2

Open jovanmilenoski opened 7 years ago

jovanmilenoski commented 7 years ago

Hi. Is this really made to work with smaller wsdl files, or I am doing something wrong?

Stack trace below.

RangeError: Maximum call stack size exceeded at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:26:32) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24) at wsdlTypeToInterfaceObj (/usr/lib/node_modules/wsdl-to-ts/lib/wsdl-to-ts.js:61:24)

TimLuq commented 7 years ago

Hmm, did not think this would be a problem. Thanks for noticing. Do you know if the interface has a recursive definition and that is what is causing this? (E.g. A -> B -> C -> D -> B.)

Is the WSDL you are executing against public? If so are you able to add a comment with a link?

jovanmilenoski commented 7 years ago

Unfortunately, I can not share that publicly. Can I send you by email or something?

TimLuq commented 7 years ago

My guess is that there is an infinite recursion going on. In that case this project will need a rewrite which will be released as v1.0.

If that is not the case you may try to extend the available size of the stack by running something like: node --stack_size=1200 "$(which wsdl-to-ts)"

MarkRobertJohnson commented 6 years ago

Setting --stack_size=1200 made the error go away, but no files were generated.

MarkRobertJohnson commented 6 years ago

Here is the WSDL I am trying to convert:

salesforcemetadata.zip

ChuckJonas commented 6 years ago

@MarkRobertJohnson lol... came here for the same error. I'm trying to do the salesforce partner WSDL.

Did you ever figure out something that worked?

MarkRobertJohnson commented 6 years ago

@ChuckJonas No, I threw in the towel and ended up using JSForce.

aranda-adapptor commented 6 years ago

@TimLuq I'm getting the stack error on this WSDL: https://srv6.demo-attendant.advam.com/makeBooking/webservice/booking.wsdl

Pretty sure it is a case of recursive types unfortunately.

TimLuq commented 6 years ago

I'm going to spend some time on v1 during next week. I can't promise anything, but v1 may be released as a late holiday gift.

sledorze commented 6 years ago

I found out there was a problem with attributes not being exposed from node soap so the generated types were missing part of their 'fields' (unrelated to this issue but maybe an interesting to know before investing on it)

TimLuq commented 6 years ago

I had 3 weeks off work, which I actually ended up working 80 hours of. I began some stuff on v1 which I pushed to the v1 branch. It's under way, but a lot left to do.

mvayngrib commented 6 years ago

awesome module! However, I also hit the recursive definition issue. @TimLuq, is it still something you're working on?

TimLuq commented 6 years ago

No progress during the last 20 days, but it's in the back of my mind. I will continue when I have the time.

If anyone wants to clone the v1 branch do something minor or major, I'll accept PR's as well.