This blog post was created with the assistance of AI to help explain Uniface documentation in simple terms. π€
What is the SOAP Declaration? π‘
In Uniface 10.4, the public soap declaration is a powerful keyword that makes your operations accessible to SOAP clients. Think of it as opening a door πͺ - without this declaration, external SOAP clients cannot access your operation, and they'll receive an "Access denied" error instead.
Key Terms Explained π
SOAP π§Ό
SOAP stands for Simple Object Access Protocol. It's a messaging protocol that allows different software applications to communicate with each other over the internet using XML messages. Think of it as a standardized way for programs to "talk" to each other, like having a common language for computers.
Service Component ποΈ
A Service Component in Uniface is a reusable piece of code that performs specific business functions. It can be activated by different types of clients, including web browsers and SOAP applications.
WSDL π
WSDL (Web Services Description Language) is an XML file that describes what your web service can do - like a menu π that tells clients what operations are available and how to use them. When you create a SOAP service in Uniface, it can generate a WSDL file automatically.
Basic Syntax and Usage π»
The basic syntax is simple:
operation OPERATION_NAME
public soap ; This line makes it accessible to SOAP clients
params
endparams
<... your code here ...>
end
Real Examples from Uniface 10.4 β¨
Simple SOAP Operation
Here's a basic example of making an operation available to SOAP clients:
operation SOAP_UPDATE
public soap ;- declare accessible via SOAP channel
params
endparams
<... do something ...>
end
This operation called "SOAP_UPDATE" can now be called by any SOAP client that knows how to reach your Uniface service.
Dual Access: SOAP and Web π
You can make an operation accessible to both SOAP clients and web browsers at the same time:
operation doSomething
public soap
public web
scope
input
output
endscope
< ... do something ...>
end
This flexibility means your operation can serve both traditional web requests and structured SOAP messages.
Where Can You Use It? π―
The public soap declaration can be used in three types of Uniface components:
- Service Components - Backend services that handle business logic π’
- Dynamic Server Pages (DSP) - Pages that generate content dynamically π
- Static Server Pages (SSP) - Pre-built pages with SOAP capabilities π
How It Works Behind the Scenes βοΈ
When you declare an operation as public soap, Uniface automatically:
- Includes the operation in the component's interface definition π
- Allows the service to be exported as a WSDL file for client discovery
- Handles SOAP message parsing and response formatting π
- Provides proper error handling with SoapFault messages when access is denied
Security Considerations π
Remember that operations without the public soap declaration are protected - SOAP clients cannot access them. This gives you control over which parts of your application are exposed to external systems, which is crucial for security π‘οΈ.
Integration with Enterprise Systems π
SOAP-based web services are particularly popular in enterprise and business-to-business applications. The SOAP protocol provides robust error reporting and standardized communication, making it ideal for mission-critical systems that need reliable data exchange.
Best Practices π‘
- Only declare operations as public soap that you actually want external clients to access π―
- Consider using both public soap and public web for maximum flexibility π
- Test your SOAP services thoroughly with different client applications π§ͺ
- Document your SOAP operations clearly for other developers π
Conclusion π
The public soap declaration in Uniface 10.4 is your gateway to creating robust, enterprise-ready web services. By simply adding this declaration to your operations, you open up powerful integration possibilities while maintaining security and control over your application's interface.
Whether you're building internal APIs or external partner integrations, understanding and using the SOAP declaration effectively can help you create more connected and interoperable applications πβ¨.
Top comments (0)