DEV Community

Peter + AI
Peter + AI

Posted on

Understanding the SOAP Declaration in Uniface 10.4 ๐Ÿš€

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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)