-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Adding custom envelope key option for server #1208
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -625,4 +625,72 @@ describe('SOAP Server with Options', function () { | |
}); | ||
}); | ||
|
||
it('should return soapenv as envelope key when it is set to soapenv', function (done) { | ||
test.server.listen(15099, null, null, function () { | ||
test.soapServer = soap.listen(test.server, { | ||
path: '/stockquote', | ||
services: test.service, | ||
xml: test.wsdl, | ||
uri: __dirname + '/wsdl/strict/', | ||
envelopeKey: 'soapenv' | ||
}, test.service, test.wsdl); | ||
test.baseUrl = 'http://' + test.server.address().address + ":" + test.server.address().port; | ||
|
||
//windows return 0.0.0.0 as address and that is not | ||
//valid to use in a request | ||
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { | ||
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; | ||
} | ||
// console.log(test.baseUrl); | ||
axios.post( | ||
test.baseUrl + '/stockquote', | ||
'<soapenv:Envelope' + | ||
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' + | ||
' xmlns:soap="http://service.applicationsnet.com/soap/">' + | ||
' <soapenv:Header/>' + | ||
' <soapenv:Body>' + | ||
'</soapenv:Envelope>' | ||
).then(res => { | ||
assert.ok(res.data.indexOf('soapenv:Envelope') > -1); | ||
done(); | ||
}).catch(err => { | ||
throw err; | ||
}); | ||
}); | ||
}); | ||
|
||
it('should return soap as envelope key by default', function (done) { | ||
test.server.listen(15099, null, null, function () { | ||
test.soapServer = soap.listen(test.server, { | ||
path: '/stockquote', | ||
services: test.service, | ||
xml: test.wsdl, | ||
uri: __dirname + '/wsdl/strict/', | ||
forceSoap12Headers: true | ||
}, test.service, test.wsdl); | ||
test.baseUrl = 'http://' + test.server.address().address + ":" + test.server.address().port; | ||
|
||
//windows return 0.0.0.0 as address and that is not | ||
//valid to use in a request | ||
if (test.server.address().address === '0.0.0.0' || test.server.address().address === '::') { | ||
test.baseUrl = 'http://127.0.0.1:' + test.server.address().port; | ||
} | ||
// console.log(test.baseUrl); | ||
axios.post( | ||
test.baseUrl + '/stockquote', | ||
'<soapenv:Envelope' + | ||
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"' + | ||
' xmlns:soap="http://service.applicationsnet.com/soap/">' + | ||
' <soapenv:Header/>' + | ||
' <soapenv:Body>' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I applied the fix, but tests are still failing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @w666 -- thank you. You closed the body tag in one place, but not the 2nd one above. There were two. |
||
'</soapenv:Envelope>' | ||
).then(res => { | ||
assert.ok(res.data.indexOf('soap:Envelope') > -1); | ||
done(); | ||
}).catch(err => { | ||
throw err; | ||
}); | ||
}); | ||
}); | ||
|
||
}); |
Uh oh!
There was an error while loading. Please reload this page.