def get_service(ws, name):
    """Get the web service object from Azure ML workspace that matches name"""
    webservices = ws.webservices
    service = None
    for servicename, webservice in webservices.items():
        if name == servicename:
            service = webservice
            break
    return service