---
lang: en
title: 'API docs: service-proxy.getservice'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/service-proxy
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 | legacy.DataSource | A legacy data source |

<b>Returns:</b>

Promise&lt;T&gt;


