Made publish service method take in a Service object.