Small snippet from my code: (this is for getting the UPnP ports forwarded / GetGenericPortMappingEntry)
(you should already have read the location for the UPnP service URL and the correct ServiceTag (between the servicetag tags).
Note the AddHeader for SOAPAction which you don't have.
var
S, Found: String;
HTTP: THTTPSend;
begin
Location := IP_AND_PATH_OF_ROUTER_UPNP_SERVICE;
ServiceType := SERVICERTPE_BETWEEN_THE_SERVICETYPE_TAGS_IN_SERVICEXML;
S := '';
S := S + '<?xml version="1.0" encoding="utf-8"?>';
S := S + '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">';
S := S + ' <s:Body>';
S := S + ' <u:GetGenericPortMappingEntry xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">';
S := S + ' <NewPortMappingIndex>0</NewPortMappingIndex>';
S := S + ' </u:GetGenericPortMappingEntry>';
S := S + ' </s:Body>';
S := S + '</s:Envelope>';
Response := TStringList.Create;
HTTP := THTTPSend.Create;
try
WriteStrToStream(HTTP.Document, S);
HTTP.MimeType := 'text/xml; charset="utf-8"';
HTTP.Headers.Add('SOAPAction: ' + ServiceType + '#GetGenericPortMappingEntry');
if HTTP.HTTPMethod('POST', Location) then
begin
Response.LoadFromStream(HTTP.Document);
Found := Response.Text;
writeln(found);
end;
finally
Response.Free;
HTTP.Free;
end;
end;