Web Service Wincc OA
- jeissonsierrac
- Posts:62
- Joined: Wed Jun 03, 2015 9:37 pm
Web Service Wincc OA
it is possible to create a web service in win cc oa
- vogler
- Posts:122
- Joined: Thu Oct 28, 2010 8:32 am
Re: Web Service Wincc OA
You can use the build in http server in control - see the documentation of httpServer, httpConnect.
And you can use jsonEncode/jsonDecode to transform ctrl objects from/to json.
httpServer(false, PORT, PORT_SSL)
httpConnect("httpHelloWorld", "/helloWorld"); // http://localhost:8082/helloWorld
string httpHelloWorld()
{
return jsonEncode(makeMapping("hello", "world", "time", getCurrentTime()));
}
And you can use jsonEncode/jsonDecode to transform ctrl objects from/to json.
httpServer(false, PORT, PORT_SSL)
httpConnect("httpHelloWorld", "/helloWorld"); // http://localhost:8082/helloWorld
string httpHelloWorld()
{
return jsonEncode(makeMapping("hello", "world", "time", getCurrentTime()));
}