WSDL - Service Provider in WSDL

1. What is a Service Provider in WSDL?

A Service Provider is the organization, server, or application that offers a web service.

  • It creates the web service.

  • It describes the service using WSDL (Web Services Description Language).

  • It hosts the WSDL file so that clients (service consumers) can discover how to interact with the service.

In simple terms:
Service Provider = The one who builds and exposes the service.


2. Role of WSDL in Service Provider

The WSDL document is like a blueprint or contract between the provider and consumer.

The service provider publishes the WSDL file, which:

  • Describes what the service does.

  • Lists the operations (functions) available.

  • Explains the input and output data formats.

  • Defines the protocols and endpoints to access the service.

Without the WSDL, a consumer wouldn’t know how to use the service.


3. How the Service Provider Publishes WSDL

There are three common ways:

A. Hosting WSDL on a Web Server (Most Common)

  • The provider uploads the .wsdl file to a web server.

  • Example:

    http://example.com/services/CustomerService?wsdl
    
  • Clients can access this URL and download the WSDL.


B. Publishing WSDL via UDDI Registry (Less Common Today)

  • UDDI (Universal Description, Discovery, and Integration) was used to register services.

  • Steps:

    1. Provider registers service in UDDI.

    2. UDDI stores WSDL metadata.

    3. Consumers search UDDI to find services and download the WSDL.

  • Example: https://uddi.example.com/registry


C. Providing WSDL Dynamically via Service Endpoint

  • Some SOAP web services generate WSDL on the fly.

  • For example, in Java JAX-WS or .NET, when you hit the service URL with ?wsdl, the server responds with the WSDL automatically.

  • Example:

    http://localhost:8080/CustomerService?wsdl
    

4. Service Provider Example

Imagine a company called ABC Bank providing an AccountService web service.

Step 1 — Provider Creates the Service

  • Service: AccountService

  • Operation: getBalance(accountID)

  • Input: accountID

  • Output: balance

Step 2 — Provider Writes WSDL

<definitions name="AccountService"
    targetNamespace="http://abcbank.com/account"
    xmlns:tns="http://abcbank.com/account"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns="http://schemas.xmlsoap.org/wsdl/">

  <message name="GetBalanceRequest">
    <part name="accountID" type="xsd:int"/>
  </message>
  <message name="GetBalanceResponse">
    <part name="balance" type="xsd:decimal"/>
  </message>

  <portType name="AccountPortType">
    <operation name="GetBalance">
      <input message="tns:GetBalanceRequest"/>
      <output message="tns:GetBalanceResponse"/>
    </operation>
  </portType>

  <binding name="AccountBinding" type="tns:AccountPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  </binding>

  <service name="AccountService">
    <port name="AccountPort" binding="tns:AccountBinding">
      <soap:address location="http://abcbank.com/services/AccountService"/>
    </port>
  </service>

</definitions>

Step 3 — Provider Publishes WSDL

  • The WSDL file is hosted at:

    http://abcbank.com/services/AccountService?wsdl
    

Step 4 — Consumer Uses WSDL

  • A developer downloads the WSDL.

  • They use tools like SoapUI, Postman, or WSDL2Java to generate client code.

  • Now the consumer knows what operations exist and how to call them.


5. Service Provider in Web Services Architecture

Here’s the 3-role architecture:

Role Responsibility
Service Provider Creates and publishes WSDL, hosts the service
Service Registry Stores WSDL for discovery (optional, via UDDI)
Service Consumer Reads WSDL, generates code, and invokes service

Workflow:

  1. Provider → Publishes WSDL.

  2. Consumer → Reads WSDL.

  3. Consumer → Invokes the service endpoint using SOAP/HTTP.