---
lang: en
title: 'API docs: service-proxy.getservice'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.service-proxy.getservice.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/service-proxy](./service-proxy.md) &gt; [getService](./service-proxy.getservice.md)

## getService() function

Get a service proxy from a LoopBack 3.x data source backed by service-oriented connectors such as `rest`<!-- -->, `soap`<!-- -->, and `grpc`<!-- -->.

<b>Signature:</b>

```typescript
export declare function getService<T = GenericService>(ds: legacy.DataSource): Promise<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  ds | <code>legacy.DataSource</code> | A legacy data source |

<b>Returns:</b>

`Promise<T>`


