envelope misses encoding attribute
using current soap (0.2.7) and node (0.10.5)
line 117 of client.js in soap module reads
(method.inputSoap === 'encoded') && (encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ');
js linter/hinter flags it, because it is expecting an assignment or a function call, but instead this is an expression.
also, this line seems to misbehave. console logging method.inputSoap gives me
{
'$name': 'ping0In',
use: 'encoded',
encodingStyle: 'http://schemas.xmlsoap.org/soap/encoding/'
}
so it is definitely not === 'encoded'. However, second part of the above expression is not executed. encoding which is declared as var encoding = ''; stays empty and the encoding attribute is not added to soap envelope.
unfortunately for me, server endpoint was made by some java d***heads, and throws fatal errors at me for not specifying encoding in the envelope ;)
replacing line 117 with
if (method.inputSoap !== 'encoded') {
encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ';
}
solves this for me.
+1
(method.inputSoap === 'encoded') && (encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ');
This is an incredibly convoluted way to do a simple if statement...
For reference if (method.inputSoap === 'encoded') is false (encoding = 'soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" ') is set.
@maxwellium thanks for submitting! Can you enter a pull request for this?