Improve protocol resolution from service url