Download the PHP package techdock/opcua-webapi-client without Composer
On this page you can find all versions of the php package techdock/opcua-webapi-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package opcua-webapi-client
OPC UA WebAPI Client for PHP
A PHP client library for interacting with OPC UA servers via the OPC UA WebAPI. This library provides a simple and intuitive interface for reading values, browsing the address space, and performing other OPC UA operations over HTTP/HTTPS.
Features
- Full support for OPC UA WebAPI operations
- Read node values (single and multiple)
- Browse the OPC UA address space
- Support for various node ID formats (numeric, string, namespace URIs)
- Comprehensive model classes for all OPC UA data types
- PSR-7 compatible HTTP client (Guzzle)
- Well-tested with integration examples
Requirements
- PHP 8.1 or higher
- ext-curl
- ext-json
- ext-mbstring
- Guzzle HTTP client
Installation
Install via Composer:
Quick Start
Usage Examples
Reading a Single Node Value
Reading Multiple Node Values
Reading multiple nodes in a single request is more efficient:
Browsing the Address Space
Using Namespace URIs
For nodes with custom namespaces:
Error Handling
Configuration
Custom Timeouts
Custom Host
API Reference
The DefaultApi class provides the following main methods:
read(ReadRequest $request)- Read one or more node valueswrite(WriteRequest $request)- Write values to nodesbrowse(BrowseRequest $request)- Browse the address spacebrowseNext(BrowseNextRequest $request)- Continue browsingtranslateBrowsePathsToNodeIds(TranslateBrowsePathsToNodeIdsRequest $request)- Translate browse pathscall(CallRequest $request)- Call methods on objectscreateSession(CreateSessionRequest $request)- Create a sessionactivateSession(ActivateSessionRequest $request)- Activate a sessioncloseSession(CloseSessionRequest $request)- Close a session
For detailed information about request and response models, see the classes in the src/Model directory.
Testing
Unit Tests
Run the unit tests:
Or directly with PHPUnit:
Live Integration Tests
The library includes integration tests that demonstrate real usage against the public OPC Foundation WebAPI:
Or:
Enable HTTP debugging:
The integration tests serve as comprehensive usage examples and can be found in test/Integration/LiveApiTest.php.
Node ID Formats
OPC UA supports several node ID formats:
- Numeric:
i=2258(namespace 0, numeric ID 2258) - String:
s=MyNode(namespace 0, string identifier) - GUID:
g=09087e75-8e5e-499b-954f-f2a9603db28a - Opaque:
b=M/RbKBsRVkePCePcx24oRA==(base64 encoded) - Namespace URI:
nsu=urn:example:namespace;s=MyNode
Common OPC UA Node IDs
Here are some commonly used OPC UA node IDs:
i=84- Root folderi=85- Objects folderi=86- Types folderi=87- Views folderi=2253- Server objecti=2254- Server.ServerArrayi=2255- Server.NamespaceArrayi=2256- Server.ServerStatusi=2258- Server.ServerStatus.CurrentTimei=2259- Server.ServerStatus.State
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Issues: GitHub Issues
- Email: [email protected]
Credits
Developed and maintained by TechDock.
This library is built on the OpenAPI specification provided by the OPC Foundation. The OPC UA WebAPI specification (introduced in version 1.05.04) enables standardized RESTful API access to OPC UA servers, making OPC UA more accessible to modern web and cloud applications.
Related Resources
- OPC Foundation
- OPC UA Specification
- OPC UA WebAPI Swagger Documentation - Live interactive API documentation
- OPC UA WebAPI StarterKit - Official sample applications and OpenAPI definitions
- OPC UA and OpenAPI: Understanding the Integration - Comprehensive blog post explaining how OpenAPI simplifies OPC UA development
- OPC UA Part 6: NodeId String Format - Specification for the string representations used in this library
All versions of opcua-webapi-client with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0