Skip to content

Commit d4efe27

Browse files
authored
Merge pull request #79 from icholy/handle-namespaced-primites
Handle namespaced primitive types
2 parents d9afaec + 0be1954 commit d4efe27

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/parser.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ const NODE_SOAP_PARSED_TYPES: { [type: string]: string } = {
4545
date: "Date",
4646
};
4747

48+
function toPrimitedType(type: string): string {
49+
const index = type.indexOf(":");
50+
if (index >= 0) {
51+
type = type.substring(index + 1);
52+
}
53+
return NODE_SOAP_PARSED_TYPES[type] || "string";
54+
}
55+
4856
/**
4957
* parse definition
5058
* @param parsedWsdl context of parsed wsdl
@@ -111,7 +119,7 @@ function parseDefinition(
111119
name: stripedPropName,
112120
sourceName: propName,
113121
description: type,
114-
type: NODE_SOAP_PARSED_TYPES[type] || "string",
122+
type: toPrimitedType(type),
115123
isArray: true,
116124
});
117125
} else if (type instanceof ComplexTypeElement) {
@@ -171,7 +179,7 @@ function parseDefinition(
171179
name: propName,
172180
sourceName: propName,
173181
description: type,
174-
type: NODE_SOAP_PARSED_TYPES[type] || "string",
182+
type: toPrimitedType(type),
175183
isArray: false,
176184
});
177185
} else if (type instanceof ComplexTypeElement) {

0 commit comments

Comments
 (0)