Simple OPC UA Web Service Samples

July 25, 2008
The OPC Foundation has posted on its web site sample code that implements an OPC UA Client and Server without the use of any UA SDKs or communications stacks.

Much of the recent focus of the OPC Unified Architecture team has been the completion and testing of the OPC UA communication stacks and SDKs in portable C/C++, .NET and Java. While these code deliverables provide the simplest path for development of OPC UA applications that require the speed of binary communications, OPC also supports a pure Web Services binding that allows modern development tools like Microsoft’s Visual Studio to auto-generate the necessary classes to support OPC UA application programming.

The OPC Foundation recently posted on the web site such a sample that implements an OPC UA Client and Server without the use of any UA SDKs or communications stacks. In these samples Microsoft Visual Studio 2008 with WCF 3.5 projects were created that consumed the standard published OPC UA WSDL (Web Services Description Language) file. The Microsoft auto-generated Web Services glue code and a little more implementation code (about 2,000 lines total) yielded a simple client and server that not only interoperate with each other, but also with the existing samples that use the UA SDK and stack. The samples are kept simple on purpose but they do implement enough to be useful.

The sample client implements the following:

  • Create/Activate Session (Including application verification but no user authentication)
  • Browse
  • Read (scalars, arrays and complex data)
  • Create Subscription
  • Create Monitored Items

The sample server implements the following:

  • Default address space (including all OPC UA defined types and the Server object)
  • Discovery Endpoint
  • Create/Activate Session (Including application verification but no user authentication)
  • Read (scalars, arrays and complex data)
  • Browse (no Browse Next)
  • Translate Browse Paths
  • Create Subscription
  • Create Monitored Items

While these samples use the Microsoft development tools, other modern software development environments that support code generators compliant with the latest Web Services standards like WS-Secure Conversation on which OPC UA relies could be used with similar success.

For various support and licensing reasons, we believe some potential OPC UA implementers would prefer not to use our SDKs and stacks. The standard Web Service bindings to OPC UA provide this option nicely.

For more information, please visit www.opcfoundation.org.

Sponsored Recommendations

Wireless Data Acquisition System Case Studies

Wireless data acquisition systems are vital elements of connected factories, collecting data that allows operators to remotely access and visualize equipment and process information...

Strategizing for sustainable success in material handling and packaging

Download our visual factory brochure to explore how, together, we can fully optimize your industrial operations for ongoing success in material handling and packaging. As your...

A closer look at modern design considerations for food and beverage

With new and changing safety and hygiene regulations at top of mind, its easy to understand how other crucial aspects of machine design can get pushed aside. Our whitepaper explores...

Fueling the Future of Commercial EV Charging Infrastructure

Miguel Gudino, an Associate Application Engineer at RS, addresses various EV charging challenges and opportunities, ranging from charging station design strategies to the advanced...