Spoke too soon. The soap is returning the right data but the function string isn't putting the SN in using. See the debug string has the variable name in the soap request instead of the actual Serial Number
thats strange .. .. i doubt that this would make a difference but
- first try to remove all white space between your xml tags in the template string
- then try to concatenate the string with + SN but now in single quotes
let SN = global.get("SN");
msg.payload = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetChargeRecipe xmlns="http://tempuri.org/"><serialNumber>' + SN + '</serialNumber><site>AC</site></GetChargeRecipe></soap:Body></soap:Envelope>'
//msg.topic = "";
delete msg.topic;
return msg;
Going to start a new post as cleaned it up to be more clear between which two it works and doesn't work between

