MDL-37275 webservices: ensure a webservice function is chosen before attempting to add to service