Skip to content

Commit

Permalink
handle non-part children of message element
Browse files Browse the repository at this point in the history
  • Loading branch information
vpulim committed May 2, 2012
1 parent 8a83cd8 commit 1479c53
Show file tree
Hide file tree
Showing 2 changed files with 722 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/wsdl.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ var ElementTypeMap = {
port: [PortElement, 'address'], port: [PortElement, 'address'],
binding: [BindingElement, '_binding SecuritySpec operation'], binding: [BindingElement, '_binding SecuritySpec operation'],
portType: [PortTypeElement, 'operation'], portType: [PortTypeElement, 'operation'],
message: [MessageElement, 'part'], message: [MessageElement, 'part documentation'],
operation: [OperationElement, 'documentation input output fault _operation'], operation: [OperationElement, 'documentation input output fault _operation'],
input : [InputElement, 'body SecuritySpecRef'], input : [InputElement, 'body SecuritySpecRef documentation header'],
output : [OutputElement, 'body SecuritySpecRef'], output : [OutputElement, 'body SecuritySpecRef documentation header'],
fault : [Element, '_fault'], fault : [Element, '_fault'],
definitions: [DefinitionsElement, 'types message portType binding service'] definitions: [DefinitionsElement, 'types message portType binding service']
}; };
Expand Down Expand Up @@ -318,9 +318,16 @@ DefinitionsElement.prototype.addChild = function(child) {




MessageElement.prototype.postProcess = function(definitions) { MessageElement.prototype.postProcess = function(definitions) {
var part = this.children && this.children[0]; var part = null, child,
children = this.children || [];

for (var i in children) {
if ((child = children[i]).name === 'part') {
part = child;
break;
}
}
if (!part) return; if (!part) return;
assert(part.name === 'part', 'Expected part element');
if (part.$element) { if (part.$element) {
delete this.parts; delete this.parts;
var nsName = splitNSName(part.$element); var nsName = splitNSName(part.$element);
Expand Down
Loading

0 comments on commit 1479c53

Please sign in to comment.