https://github.com/sklose/wemowsdl
WSDL definitions to control a Belkin WeMo device
https://github.com/sklose/wemowsdl
Last synced: 6 months ago
JSON representation
WSDL definitions to control a Belkin WeMo device
- Host: GitHub
- URL: https://github.com/sklose/wemowsdl
- Owner: sklose
- Created: 2013-06-09T21:33:58.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T13:07:16.000Z (about 9 years ago)
- Last Synced: 2025-03-27T15:53:34.552Z (7 months ago)
- Homepage:
- Size: 2.93 KB
- Stars: 10
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
WeMoWsdl
========This project provides WSDL definitions that can be used to generate client-side code for controlling Belkin WeMo devices.
Example usage with C#
---------------------Add a Service Reference to 'https://raw.github.com/sklose/WeMoWsdl/master/BasicService.wsdl'. Afterwards you can run the following example code (adjust, IP address and namespaces accordingly)
```csharp
string ip = "192.168.1.101";
int port = 49153;var client = new ServiceReference1.BasicServicePortTypeClient();
client.Endpoint.Address = new EndpointAddress(string.Format("http://{0}:{1}/upnp/control/basicevent1", ip, port));var state = client.GetBinaryState(new ServiceReference1.GetBinaryState());
Console.WriteLine("Switch is current set to: {0}", state.BinaryState);Console.WriteLine("Turning Switch On");
var msg = new ServiceReference1.SetBinaryState { BinaryState = "1" };
client.SetBinaryState(msg);
```