WSDL - One-way” operation in WSDL and SOAP web services

1. What is a One-Way Operation?

In WSDL and SOAP web services, a one-way operation is when the client (service consumer) sends a request to the service provider, but the provider does not send any response back.

  • The client does not wait for a reply.

  • The provider does not return any data or acknowledgment.

  • It is like fire-and-forget communication.

Analogy:
It’s like dropping a letter in a mailbox without expecting a reply.


2. One-Way in WSDL

In a WSDL portType definition, a one-way operation has only an <input> message and no <output>.

Example WSDL (One-Way Operation)

<portType name="NotificationServicePortType">
  <operation name="SendNotification">
    <input message="tns:SendNotificationRequest"/>
  </operation>
</portType>
  • Input message: SendNotificationRequest

  • No output message defined → The client sends the request and doesn’t expect a response.


3. One-Way SOAP Request Example

SOAP Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:ns="http://example.com/notification">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:SendNotificationRequest>
         <ns:message>Hello, this is a one-way message!</ns:message>
      </ns:SendNotificationRequest>
   </soapenv:Body>
</soapenv:Envelope>

SOAP Response

  • No SOAP response body is returned.

  • In some cases, the server might return an HTTP 202 Accepted status, meaning the request was received, but there’s no message sent back.


4. Use Cases for One-Way Operations

One-way operations are useful when the client doesn’t need a response or when processing takes a long time.

Common Scenarios

  • Logging services → Client sends log messages; no reply required.

  • Notification services → Send SMS, emails, or alerts.

  • Telemetry data collection → Client sends sensor data to the server.

  • Asynchronous processing → Request is queued, but no immediate result is sent.


5. One-Way vs Request-Response

Feature One-Way Operation Request-Response Operation
Request Sent by client Sent by client
Response No response returned Response returned by server
WSDL Input Yes Yes
WSDL Output No Yes
Example Use Notifications, logging Fetching data, calculations
HTTP Status Often 202 Accepted Usually 200 OK

6. Real-Life Analogy

  • One-Way:
    You drop a letter into a suggestion box → You don’t expect a reply.

  • Request-Response:
    You send an email asking for information → You expect a reply.


7. Summary

  • A one-way operation = fire-and-forget communication.

  • The client sends a request but does not wait for a response.

  • WSDL defines it with only <input> and no <output>.

  • Best for notifications, logging, telemetry, and asynchronous systems.