---
description: >-
  A web service is a server-side program that provides functionality that can be
  invoked and used at the programming level (interoperable architecture).
---

# Web Service

{% tabs %}
{% tab title="XML-RPC" %}
[Information](https://xmlrpc.com/spec.md).

Remote Procedure Call (RPC) protocol that uses XML (usually over HTTP) to invoke functionality. Composed of `<methodCall>`, `<methodName>` and `<params>`.

{% code overflow="wrap" %}
```xml
<!-- Content-Type: text/xml -->

<methodCall>
    <methodName>examples.getValue</methodName>
    <params>
       <param>
 	  <value>RandomValue</value>
       </param>
    </params>
 </methodCall>
```
{% endcode %}
{% endtab %}

{% tab title="JSON-RPC" %}
[Information](https://www.jsonrpc.org/specification).

Remote Procedure Call (RPC) protocol using JSON. Composed of `method`, `params`, `id`.

{% code overflow="wrap" %}
```json
// Content-Type: application/json-rpc

{"method": "sum", "params": {"a":3, "b":4}, "id":0}
```
{% endcode %}
{% endtab %}

{% tab title="SOAP" %}
[Information](https://www.w3schools.com/xml/xml_soap.asp).

Simple Object Access Protocol.\
Messaging protocol that uses XML and provides more functionality than XML-RPC. Composed of `<soap:Envelope>`, `<soap:Header>`, `<soap:Body>` and `<soap:Fault>`. Of which only Envelope and Body are mandatory.

[WSDL](https://www.w3.org/TR/wsdl/) (Web Services Definition Language) [`1.1`](https://www.w3.org/TR/2001/NOTE-wsdl-20010315)    [`2.0`](https://www.w3.org/TR/wsdl20-primer/) \
SOAP can optionally also provide a WSDL declaration that specifies how services can be used. Look for them with `?.wsdl`, `.wsdl`, `?.disk`, `.disk` or on [UDDI](https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/cy2a3ybs\(v=vs.100\)?redirectedfrom=MSDN): directory service for Public Web Service.

<pre class="language-xml" data-overflow="wrap"><code class="lang-xml"><strong>&#x3C;!-- 
</strong><strong>Content-Type: text/xml; charset = utf-8
</strong>[ SOAPAction: "OperationName" ] 
-->

&#x3C;?xml version="1.0"?> 
&#x3C;soap:Envelope
 xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
 soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
   &#x3C;soap:Header> ... &#x3C;/soap:Header>
   &#x3C;soap:Body> 
        ... 
       &#x3C;soap:Fault> ... &#x3C;/soap:Fault>
   &#x3C;/soap:Body>
&#x3C;/soap:Envelope>
</code></pre>
{% endtab %}

{% tab title="RESTful" %}
[Information](https://developer.ibm.com/articles/ws-restful/).

Representational State Transfer.\
It usually uses XML or JSON and relies on sets or principles to build a Web service. RESTful APIs are usually based on HTTP verbs to determine the actions to be taken.

**`POST /api/2.2/auth/signin HTTP/1.1`**

{% code overflow="wrap" %}
```xml
<!-- Content-Type:text/xml -->
<tsRequest>
  <credentials name="A" password="B"> … </credentials>
</tsRequest>
```
{% endcode %}

{% code overflow="wrap" %}
```json
// Content-Type:application/json
{ "credentials": 
    { "name": "A", "password": "B",  …  }
}
```
{% endcode %}
{% endtab %}
{% endtabs %}

Use **`Wsdler`** extension of BurpSuite.
