diff --git a/src/wsdl/index.ts b/src/wsdl/index.ts index 5d911d943..35a490166 100644 --- a/src/wsdl/index.ts +++ b/src/wsdl/index.ts @@ -431,7 +431,7 @@ export class WSDL { } else { if (name === 'int' || name === 'integer') { value = parseInt(text, 10); - } else if (name === 'double' || name === 'float') { + } else if (name === 'double' || name === 'float' || name === 'decimal') { value = Number(text); } else if (name === 'bool' || name === 'boolean') { value = text.toLowerCase() === 'true' || text === '1'; diff --git a/test/server-test.js b/test/server-test.js index 10edb098c..28dafdc82 100644 --- a/test/server-test.js +++ b/test/server-test.js @@ -45,7 +45,7 @@ test.service = { } }; } else { - return { price: 19.56, tax: -1.23 }; + return { price: 19.56, tax: -1.23, other: 20.001 }; } }, @@ -256,7 +256,7 @@ describe('SOAP Server', function() { soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) { assert.ifError(err); var description = client.describe(), - expected = { input: { tickerSymbol: "string" }, output:{ price: "float", tax: "double" } }; + expected = { input: { tickerSymbol: "string" }, output:{ price: "float", tax: "double", other: "decimal" } }; assert.deepEqual(expected , description.StockQuoteService.StockQuotePort.GetLastTradePrice); done(); }); @@ -269,6 +269,7 @@ describe('SOAP Server', function() { assert.ifError(err); assert.strictEqual(19.56, result.price); // float assert.strictEqual(-1.23, result.tax); // double + assert.strictEqual(20.001, result.other); // decimal done(); }); }); diff --git a/test/wsdl/strict/stockquote.wsdl b/test/wsdl/strict/stockquote.wsdl index 43e3efaef..d66238270 100644 --- a/test/wsdl/strict/stockquote.wsdl +++ b/test/wsdl/strict/stockquote.wsdl @@ -21,6 +21,7 @@ +