diff --git a/test/server-options-test.js b/test/server-options-test.js index 7c542b201..0b057b4f3 100644 --- a/test/server-options-test.js +++ b/test/server-options-test.js @@ -154,8 +154,8 @@ describe('SOAP Server with Options', function() { }); }); }); - - + + it('should escapeXML in response body', function(done) { var responseData = '<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns3:UpdateProfileResponse xmlns:ns3="http://www.bigdatacollect.or/Name/Types" xmlns="http://www.bigdatacollect.or/Common/Types"><ns3:Result resultStatusFlag="SUCCESS"><IDs><UniqueID source="TESTSOURCE">100</UniqueID></IDs></ns3:Result></ns3:UpdateProfileResponse></S:Body></S:Envelope>'; test.server.listen(15099, null, null, function() { @@ -173,7 +173,7 @@ describe('SOAP Server with Options', function() { if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; } - + soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) { assert.ok(!err); client.GetLastTradePrice({ tickerSymbol: 'xml response' }, function(err, response, body) { @@ -184,7 +184,7 @@ describe('SOAP Server with Options', function() { }); }); }); - + it('should not escapeXML response in body', function(done) { var responseData = '100'; test.server.listen(15099, null, null, function() { @@ -202,7 +202,7 @@ describe('SOAP Server with Options', function() { if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; } - + soap.createClient(test.baseUrl + '/stockquote?wsdl', function(err, client) { assert.ok(!err); client.GetLastTradePrice({ tickerSymbol: 'xml response' }, function(err, response, body) { @@ -230,24 +230,24 @@ describe('SOAP Server with Options', function() { if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; } - + request.post({ - url: test.baseUrl + '/stockquote?wsdl', - body : '' + - ' ' + - ' ' + - ' ' + - ' ' + - '', - headers: {'Content-Type': 'text/xml'} - }, function(err, res, body) { - assert.ok(!err); - assert.equal(res.statusCode, 500); - assert.ok(body.indexOf('\n at') !== -1); - done(); - } + url: test.baseUrl + '/stockquote?wsdl', + body : '' + + ' ' + + ' ' + + ' ' + + ' ' + + '', + headers: {'Content-Type': 'text/xml'} + }, function(err, res, body) { + assert.ok(!err); + assert.equal(res.statusCode, 500); + assert.ok(body.indexOf('\n at') !== -1); + done(); + } ); }); }); @@ -260,7 +260,7 @@ describe('SOAP Server with Options', function() { xml: test.wsdl, uri: __dirname + '/wsdl/strict/', escapeXML: false, - suppressStack: true + suppressStack: true }, test.service, test.wsdl); test.baseUrl = 'http://' + test.server.address().address + ":" + test.server.address().port; @@ -269,24 +269,24 @@ describe('SOAP Server with Options', function() { if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; } - + request.post({ - url: test.baseUrl + '/stockquote?wsdl', - body : '' + - ' ' + - ' ' + - ' ' + - ' ' + - '', - headers: {'Content-Type': 'text/xml'} - }, function(err, res, body) { - assert.ok(!err); - assert.equal(res.statusCode, 500); - assert.equal(body.indexOf('\n at'), -1); - done(); - } + url: test.baseUrl + '/stockquote?wsdl', + body : '' + + ' ' + + ' ' + + ' ' + + ' ' + + '', + headers: {'Content-Type': 'text/xml'} + }, function(err, res, body) { + assert.ok(!err); + assert.equal(res.statusCode, 500); + assert.equal(body.indexOf('\n at'), -1); + done(); + } ); }); });