WSDL - Service Registry
1. What is a Service Registry?
A Service Registry is a centralized directory or repository where Service Providers publish their WSDL documents and Service Consumers search for and discover available services.
Think of it like a phonebook for web services:
-
Service Providers → Publish their WSDL.
-
Service Consumers → Search the registry to find the WSDL and understand how to call the service.
2. Role of Service Registry in Web Services Architecture
In a WSDL-based SOA (Service-Oriented Architecture), the Service Registry acts as the middleman between providers and consumers.
Key Responsibilities
-
Stores WSDL Documents
-
Providers publish service descriptions (WSDL).
-
-
Supports Discovery
-
Consumers query the registry to find services.
-
-
Maintains Metadata
-
Stores details like:
-
Service name
-
Service operations
-
Endpoint URLs
-
Protocols used
-
Service version
-
-
-
Improves Reusability
-
One WSDL can be reused by multiple consumers.
-
-
Facilitates Loose Coupling
-
Consumers don’t need to know where the provider is — they just search for services dynamically.
-
3. How Service Registry Works
The process involves three main steps: Publish → Discover → Bind.
Step 1 — Publish (By Service Provider)
-
The Service Provider creates a WSDL.
-
Publishes the WSDL document to the Service Registry.
-
Example:
Service Name: CustomerService Endpoint: http://example.com/services/customer WSDL URL: http://example.com/services/customer?wsdl
Step 2 — Discover (By Service Consumer)
-
The Service Consumer queries the registry to find available services.
-
Searches by:
-
Service name
-
Category
-
Business name
-
Keywords
-
-
The registry returns WSDL URLs for matching services.
Step 3 — Bind (Consumer Uses WSDL)
-
The Service Consumer downloads the WSDL.
-
Generates client code using tools (
wsimport
,svcutil
, etc.). -
Invokes the service directly using the endpoint defined in the WSDL.
4. UDDI – The Standard Service Registry
Historically, UDDI (Universal Description, Discovery, and Integration) was the standard specification for service registries.
UDDI Components
-
White Pages → Business details (name, contact info)
-
Yellow Pages → Categorization of services (industry, type)
-
Green Pages → Technical details (WSDL URLs, bindings, endpoints)
UDDI Operations
Operation | Purpose |
---|---|
publish | Provider registers a WSDL |
find_service | Consumer searches for WSDL |
get_serviceDetail | Retrieves service metadata |
delete_service | Removes WSDL from registry |
Example UDDI Registries:
-
jUDDI (Apache project)
-
IBM WebSphere Service Registry
-
Oracle Service Registry
5. Example Scenario
Actors:
-
Provider → ABC Bank
-
Consumer → XYZ Corp
-
Registry → UDDI Directory
Step 1: ABC Bank Publishes WSDL
-
ABC Bank registers AccountService WSDL in the UDDI registry:
Service Name: AccountService WSDL URL: http://abcbank.com/ws/account?wsdl Endpoint: http://abcbank.com/ws/account
Step 2: XYZ Corp Searches UDDI
-
XYZ searches for “AccountService” in the registry.
-
The registry returns the WSDL URL and endpoint.
Step 3: XYZ Corp Generates Client Code
-
XYZ uses:
wsimport http://abcbank.com/ws/account?wsdl
-
Generates proxy classes.
-
Calls:
AccountService service = new AccountService(); AccountPort port = service.getAccountPort(); double balance = port.getBalance(101);
6. Service Registry Architecture
The architecture involves three main roles:
Role | Action |
---|---|
Service Provider | Publishes WSDL to registry |
Service Registry | Stores WSDL, allows discovery |
Service Consumer | Searches registry, downloads WSDL, and invokes service |
Workflow:
-
Provider → Publishes WSDL to registry.
-
Consumer → Searches registry.
-
Registry → Returns WSDL info.
-
Consumer → Generates client code & binds to provider.
7. Modern Alternatives to UDDI
While UDDI was the official standard, it is rarely used today.
Modern alternatives include:
-
API Gateways (e.g., Kong, Apigee, AWS API Gateway)
-
Service Discovery Tools (e.g., Consul, Eureka, Zookeeper)
-
Swagger / OpenAPI → REST-based WSDL equivalent
-
GraphQL Schema Registries
8. Real-Life Analogy
Think of a Service Registry like Google Play Store:
-
App Developer (Provider) → Uploads app → Publishes metadata.
-
Play Store (Registry) → Stores app info, categorizes it.
-
User (Consumer) → Searches app → Installs it.
Similarly:
-
Provider publishes WSDL → Registry stores it.
-
Consumer searches registry → Finds WSDL → Uses service.