Calling a SOAP service
Send the SOAP request as a POST to the root address of your own Security Server. Unlike REST, the consumer and the service are specified in the SOAP header, not in the address.
http://<your-security-server>:8080/
https://<your-security-server>:8443/Mandatory headers
| Element | Value |
|---|---|
xrd:client | The calling subsystem |
xrd:service | The service to call |
xrd:id | A unique request identifier (UUID) |
xrd:protocolVersion | 4.0 |
You may additionally supply xrd:userId (end user) and xrd:issue (basis for the request).
Namespaces:
| Prefix | URI |
|---|---|
xrd | http://x-road.eu/xsd/xroad.xsd |
id | http://x-road.eu/xsd/identifiers |
Example request
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xrd="http://x-road.eu/xsd/xroad.xsd"
xmlns:id="http://x-road.eu/xsd/identifiers">
<soapenv:Header>
<xrd:client id:objectType="SUBSYSTEM">
<id:xRoadInstance>GRG</id:xRoadInstance>
<id:memberClass>COM</id:memberClass>
<id:memberCode>1234567</id:memberCode>
<id:subsystemCode>ZEEL</id:subsystemCode>
</xrd:client>
<xrd:service id:objectType="SERVICE">
<id:xRoadInstance>GRG</id:xRoadInstance>
<id:memberClass>GOV</id:memberClass>
<id:memberCode>7654321</id:memberCode>
<id:subsystemCode>LAVLAGAA</id:subsystemCode>
<id:serviceCode>orlogo</id:serviceCode>
<id:serviceVersion>v1</id:serviceVersion>
</xrd:service>
<xrd:id>29f4d011-ef25-4f18-bfd0-3a2f0e1c7b1a</xrd:id>
<xrd:userId>MN/AA00112233</xrd:userId>
<xrd:protocolVersion>4.0</xrd:protocolVersion>
</soapenv:Header>
<soapenv:Body>
<!-- the request element specified in the service's WSDL -->
</soapenv:Body>
</soapenv:Envelope>curl -X POST \
-H "Content-Type: text/xml; charset=utf-8" \
--data-binary @request.xml \
"https://ss.example.internal:8443/"id:serviceVersion is optional. If the provider has registered the service with a version, it must match exactly.
Response
In the SOAP header of the response, the request's xrd:client, xrd:service and xrd:id are returned unchanged, and xrd:requestHash is added.
Errors
Errors arrive as a SOAP Fault. The faultcode has the same value as the REST type:
<soapenv:Fault>
<faultcode>Server.ServerProxy.AccessDenied</faultcode>
<faultstring>Request is not allowed: SERVICE:GRG/GOV/7654321/LAVLAGAA/orlogo.v1</faultstring>
<faultactor></faultactor>
<detail><faultDetail xmlns="">0f1c2d3e-…</faultDetail></detail>
</soapenv:Fault>The faultcode of an X-Road Fault starts with Server. or Client. and is separated by dots. The service's own Faults arrive in whatever form the provider has defined. Values: Error reference.
Obtaining the WSDL
You can download a service's WSDL through the metadata services without asking the provider.
Full protocol specification: X-Road Message Protocol v4.0