Updated algorithm to extract root URL from SOAP