-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
soap client describe() resolves namespace cross references between schema #1014
soap client describe() resolves namespace cross references between schema #1014
Conversation
lib/wsdl.js
Outdated
@@ -116,6 +117,12 @@ var Element = function(nsName, attrs, options) { | |||
} | |||
} | |||
} | |||
for (var schemaKey in schemaAttrs) { | |||
var schemaMatch = /^xmlns:?(.*)$/.exec(schemaKey); | |||
if (schemaMatch && schemaMatch[1] && schemaMatch) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you really want to check for schemaMatch
twice here? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed :)
@@ -855,7 +862,9 @@ ElementElement.prototype.description = function(definitions, xmlns) { | |||
if (type) { | |||
type = splitQName(type); | |||
var typeName = type.name, | |||
ns = xmlns && xmlns[type.prefix] || definitions.xmlns[type.prefix], | |||
ns = xmlns && xmlns[type.prefix] || | |||
(definitions.xmlns[type.prefix] !== undefined && this.schemaXmlns[type.prefix]) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when checking for !== undefined
explicitly, we are aware that null
would pass - is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I checked the presence or absence of the property, not its value. So yes, it was intentional to check only for undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I could change definitions.xmlns[type.prefix] !== undefined
into definitions.xmlns[type.prefix]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the presence or absence of the property
good catch, I didn' t think of that... 👍
Hi,
this PR adds support to cross references in namespaces between types from different schema.