WSDL - Solicit-Response
1. What is Solicit-Response?
In a solicit-response operation, the service provider initiates the communication instead of the client.
-
The service provider sends a request to the service consumer.
-
The service consumer processes the request and sends a response back to the provider.
Analogy:
It’s like your bank calls you to verify a transaction, and you reply with confirmation.
2. Solicit-Response in WSDL
In a WSDL portType definition, a solicit-response operation has:
-
An
<output>
message first → sent by the service provider. -
An
<input>
message → sent back by the service consumer.
Example WSDL (Solicit-Response Operation)
<portType name="NotificationPortType">
<operation name="TransactionVerification">
<output message="tns:TransactionRequest"/>
<input message="tns:TransactionResponse"/>
</operation>
</portType>
-
Output message: Sent first by the service provider.
-
Input message: Sent later by the service consumer.
3. Solicit-Response SOAP Example
Step 1 — Service Provider Sends Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:txn="http://bank.example.com/transaction">
<soapenv:Header/>
<soapenv:Body>
<txn:TransactionRequest>
<txn:transactionID>56789</txn:transactionID>
<txn:amount>5000</txn:amount>
</txn:TransactionRequest>
</soapenv:Body>
</soapenv:Envelope>
Step 2 — Service Consumer Sends Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:txn="http://bank.example.com/transaction">
<soapenv:Header/>
<soapenv:Body>
<txn:TransactionResponse>
<txn:status>Approved</txn:status>
</txn:TransactionResponse>
</soapenv:Body>
</soapenv:Envelope>
4. Solicit-Response Workflow
-
Service Provider initiates communication → Sends a request.
-
Service Consumer receives request → Processes it.
-
Consumer sends back response → Confirms or denies the request.
-
Provider processes response.
5. Use Cases for Solicit-Response
This pattern is less common than request-response but useful when the server must start the interaction.
Examples
-
Bank fraud alerts → Bank requests confirmation of a transaction.
-
Shipment notifications → Logistics provider asks receiver for delivery confirmation.
-
Real-time event processing → Stock exchange pushes price updates to brokers.
6. Solicit-Response vs Request-Response
Feature | Solicit-Response | Request-Response |
---|---|---|
Who initiates | Service provider | Service consumer |
First message | Sent by provider | Sent by consumer |
Second message | Sent by consumer | Sent by provider |
WSDL Input | Comes second | Comes first |
WSDL Output | Comes first | Comes second |
Use cases | Alerts, notifications | Data fetching, API calls |
7. Real-Life Analogy
-
Solicit-Response:
A bank calls you asking, “Do you confirm this transaction?” → You reply yes or no. -
Request-Response:
You call the bank asking for your account balance → The bank responds.
8. Summary
-
Solicit-Response = Service provider initiates communication.
-
The provider sends a request, the consumer sends a response.
-
WSDL defines it with
<output>
first and<input>
second. -
Useful for alerts, notifications, and real-time systems.
-
Less common compared to request-response.