Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We discussed with @raymondfeng the idea of being able to load WSDL files from memory into strong-soap (as opposed to from a file system or a url). Reymond suggested making use of the existing loading structure (as used by
WSDL.open(...)
), which can be described as:var wsdl = new WSDL(definition....)
constructor.load()
on this object to process the contents of the wsdl, usingwsdl.load(....)
There are 2 usecases that this PR is aiming to cover.
Usecase 1) could be achieved by the current
strong-soap
functionality, so to achieve this all this PR does it to add a new test to demonstrate it.Usecase 2) could technically be achieved by the current
strong-soap
functionality by reading the files from the file system, creating WSDL objects from them, loading each object intooptions.WSDL_CACHE
, then callingload()
. The problem was that the order these objects were loaded in was important and the load would fail if they were done in the wrong order. The implication of this was the in order to be able to dynamically load a multipart wsdl intostrong-soap
, the user would be required to parse the tree structure then callload()
in the correct order (which is one of the jobs thatstrong-soap
was already doing for free).As a result this PR makes some small updates to the loading processes in order to recognize WSDLs which have been added to the cache, but not had
load()
called against them. If any of these are found thenload()
will be called. This is done by the introduction of anisLoaded
flag which will get set in the objectsload()
function.The files used in the tests are ones already present in this repository, however, in order to keep this test self contained, they have been copied to the directory
wsdl/from-memory
Related issues
Checklist
guide