loopbackio / loopbackio/strong-soap
createClient() gets stuck
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 410
- Forks
- 162
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 7
Description
# 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 ()
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 ()
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. (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`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with the linked PHRManagementService_V2_5_2.wsdl and compare it with EventService.wsdl. Start by tracing the stack through src/parser/xsd/simpleType.js, src/parser/xsd/schema.js, and src/parser/wsdl.js. Done means the WSDL parses successfully or createClient throws a useful exception instead of hanging; add coverage for the failing case if the existing tests support it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100