strong-soap icon indicating copy to clipboard operation
strong-soap copied to clipboard

createClient() gets stuck

Open giorgiogross opened this issue 1 year ago • 0 comments

Description

We're trying to initialise a SOAP client with local WSDL files. This works with most of our WSDL files, but for a few ones createClient never completes. Going into the strong-soap code revealed that execution stops while parsing the XML. One of the WSDL files it happens with can be found here: https://github.com/gematik/api-telematik/blob/OPB5/conn/phrs/PHRManagementService_V2_5_2.wsdl

Steps to reproduce

  • Clone the repo at https://github.com/gematik/api-telematik
  • create new new strong-soap client and pass in the path to conn/phrs/PHRManagementService_V2_5_2.wsdl
  • Result: createClient never returns. Note that createClient works fine with files in the parent dir, eg https://github.com/gematik/api-telematik/blob/OPB5/conn/EventService.wsdl
  • When done in a test case, once the test times out, the following stack trace is printed:
TypeError: Cannot read properties of null (reading 'postProcess')

      at node_modules/strong-soap/src/parser/xsd/simpleType.js:56:13
          at Array.forEach (<anonymous>)
      at SimpleType.postProcess (node_modules/strong-soap/src/parser/xsd/simpleType.js:55:32)
      at visitDfs (node_modules/strong-soap/src/parser/xsd/schema.js:97:10)
      at node_modules/strong-soap/src/parser/xsd/schema.js:89:7
          at Array.forEach (<anonymous>)
      at Schema.postProcess (node_modules/strong-soap/src/parser/xsd/schema.js:88:19)
      at node_modules/strong-soap/src/parser/wsdl.js:89:22
      at node_modules/strong-soap/src/parser/wsdl.js:246:9
      at WSDL._processNextInclude (node_modules/strong-soap/src/parser/wsdl.js:196:14)
      at staticLoad (node_modules/strong-soap/src/parser/wsdl.js:245:12)
      at WSDL.<anonymous> (node_modules/strong-soap/src/parser/wsdl.js:255:9)
      at Function.load (node_modules/strong-soap/src/parser/wsdl.js:433:25)
      at WSDL._processNextInclude (node_modules/strong-soap/src/parser/wsdl.js:254:12)
      at WSDL.processIncludes (node_modules/strong-soap/src/parser/wsdl.js:271:10)
      at loadUpSchemas (node_modules/strong-soap/src/parser/wsdl.js:81:12)
  • I've examined the WSDL with SoapUI and it looks fine; also other developers (Java..) don't seem to have issues with it.

Expected result

Either parse the XML successfully, or throw an exception offering useful feedback on what went wrong.

Additional information

node -e 'console.log(process.platform, process.arch, process.versions.node)' darwin arm64 18.17.1

npm ls --prod --depth 0 | grep loopback

giorgiogross avatar Apr 10 '24 14:04 giorgiogross