Skip to content

Commit

Permalink
Update README.md - examples using IVEUServiceClient
Browse files Browse the repository at this point in the history
  • Loading branch information
MortenMeisler authored Mar 8, 2024
1 parent c62f119 commit b84c1ec
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,36 @@ var reply = await response.Content.ReadAsStringAsync();
The `reply` will now contain the SOAP response XML from STIL. You can then pick out
the `Body` element, which will contain the actual response object. If you have the need
you can also handle Faults as well.

## Example using the IVEUServiceClient
The IVEUServiceClient contains a small number of service methods specific for [integrationsplatformen's VEU (voksen efteruddannelse) endpoints](https://viden.stil.dk/display/OFFintegrationsplatformen/Service), but you are welcome to extend this.

### Setup using the service collection extension
#### program.cs
```csharp
// uses default local certificate store, but you can optionally provide your own certificate handler
builder.Services.AddStilVeuServiceClient(builder.Configuration);
```

#### appsettings.json
```json
"Stil": {
"BaseUrl": "https://et.integrationsplatformen.dk",
"SigningCertificateThumbprint": "<thumbprint for x509 certificate>"
}
```

#### somefile.cs
```csharp
// Create a request for the HentTilmeldingerVeuInteressenter method
HentTilmeldingerRequest request = new HentTilmeldingerRequest
{
// ... set the properties of the request
};

// Call the HentTilmeldingerVeuInteressenter method and get the response
var response = await stilServiceClient.VEU.HentTilmeldingerVeuInteressenter(request);

// Use the response data
Console.WriteLine($"Number of tilmeldinger: {result.Message.hentTilmeldingerResponse.Resultat.Resultat.PersonListe.Length}");
```

0 comments on commit b84c1ec

Please sign in to comment.