5.2.6 Add descriptions of X-Road headers

5.2.6 Add descriptions of X-Road headers

In order to add X-Road header fields, it is easier to use XML source code editor, therefore we switch WSDL editor to the source code view (‘source’).

Add the definition of X-Road namespace: xmlns:xrd=http://x-road.eu/xsd/xroad.xsd to the attributes of the label wsdl:definitions in WSDL.


Add a message (message) to WSDL, where X-Road header fields are defined.

(Its location is in WSDL after the label </wsdl:types>)

  <wsdl:message name="xrdheader">

<wsdl:part name="client" element="xrd:client" />

<wsdl:part name="service" element="xrd:service" />

<wsdl:part name="userId" element="xrd:userId" />

<wsdl:part name="id" element="xrd:id" />

<wsdl:part name="protocolVersion" element="xrd:protocolVersion" />

  </wsdl:message>

 

Add descriptions of X-Road header in WSDL under elements binding/operation/input and binding/operation/output:

<wsdl:input>

  <soap:body use="literal"/>

  <soap:header message="tns:xrdheader" part="client" use="literal"/>

  <soap:header message="tns:xrdheader" part="service" use="literal"/>

  <soap:header message="tns:xrdheader" part="userId" use="literal"/>

  <soap:header message="tns:xrdheader" part="id" use="literal"/>

  <soap:header message="tns:xrdheader" part="protocolVersion" use="literal"/>

</wsdl:input>

 

Add the version number of X-Road service in WSDL under elements binding/operation:

<xrd:version>v1</xrd:version>

 

Add X-Road-specific human-readable descriptions with annotation/appinfo/xrd:title elements to the defined data types, as in the example below:

<xsd:element name="phone" type="xsd:string" maxOccurs="unbounded" minOccurs="0">

<xsd:annotation>

      <xsd:appinfo>

            <xrd:title xml:lang="et">Telefon</xrd:title>

      </xsd:appinfo>

</xsd:annotation>

</xsd:element>

 

Add a human-readable description of the dataservice to the element portType/operation/documentation/xrd:title in WSDL.

 

<wsdl:portType name="persons_register">

  <wsdl:operation name="personList">

    <wsdl:documentation>

<xrd:title xml:lang="et">Isikute nimekirja küsimine nime järgi</xrd:title>

    </wsdl:documentation>

 

Now, WSDL of X-Road dataservice is completed, all obligatory X-Road elements have been added.

Last modified: Monday, 23 October 2017, 4:45 PM