ApiKey is used to control the usage and it is affixed as an url parameter (implemented using somewhat modified version of this solution). Question is, how to go about appending this parameter when consuming the API through the use of the ServiceReference in Visual Studio?
Asked
Active
Viewed 851 times
2 Answers
0
It seems to work just fine if you use the full URL to the $metadata in the Add Service Reference dialog in VS. So for example http://services.odata.org/OData/OData.svc/$metadata?apiKey=1234 works, and it does send the query string as specified.

Vitek Karas MSFT
- 13,130
- 1
- 34
- 30
0
I've found the answer on social.msdn.com. Basically, you need to use the AddQueryOption method of a resource proxy, like:
SomeService.SomeResource.AddQueryOption("apikey", "1234")

Michał Drozdowicz
- 1,232
- 11
- 30