Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Message request header

All header content is under traceHeader element that contains traceIdentifier element with tracing information of incoming message.

TraceIndentifier parameters

ParameterTypeDescriptionMandatory
applicationIDstringIdentification of source application.Y
timestampdateTimeTimestamp of sent request.Y
correlationIDstring

Used to track calls from the service consumer to the API.
This parameter is free text, unique value (e.g. UUID), generated by the caller.
It is the responsibility of the application to generate a unique value and pass it during each call to the API.
Unique identifier (at least for specific application) serves for pairing asynchronous request/response messages.

Y
processIDstring

Used to track calls connected to one process (e.g. one process is "creating new customer" and it means calling creating customer, then activating him etc.)

This parameter is free text, unique value (e.g. UUID), generated by the caller.
It is the responsibility of the application to generate a unique value and pass it to all calls of one process.

N

 

SOAP example:

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://cleverbssopenhubframework.cleverlance.comorg/ws/Common-v1" xmlns:hel="http://cleverbusopenhubframework.cleverlance.comorg/ws/HelloService-v1">
   <soapenv:Header>
      <com:traceHeader>
         <com:traceIdentifier>
            <com:applicationID>APPL001</com:applicationID>
            <com:timestamp>2013-05-21T10:33:58.147+02:00</com:timestamp>
            <com:correlationID>${=java.util.UUID.randomUUID()}</com:correlationID>
            <!--Optional:-->
            <com:processID>process001</com:processID>
         </com:traceIdentifier>
      </com:traceHeader>
   </soapenv:Header>
   <soapenv:Body>
      <hel:asyncHelloRequest>
         <hel:name>CleverBusname>OpenHub team</hel:name>
      </hel:asyncHelloRequest>
   </soapenv:Body>
</soapenv:Envelope>

Validation of trace identifier from trace header

...

...

Since version 0.4

It's good practice to use validation functionality of allowed values in applicationID. This value is used for example in GUI Admin, auto confirmation delegation etc. For that we only have to register custom implementation of ExternalSystemIdentifierValidator interface. We can have an unlimited number of these implementations.

...

Code Block
languagexml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring xml:lang="en">
				E120: the trace identifier does not contain allowed values (ValidationIntegrationException: the trace identifier 
				'applicationID=ERP,timestamp=2013-09-27T10:23:34.698+02:00,correlationID=da793349-b486-489a-9180-200789b7007f,processID=process123' is not allowed)
         </faultstring>
         <detail>
            <errorCode xmlns="http://cleverbusopenhubframework.cleverlance.comorg">E120</errorCode>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...

Code Block
languagexml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <asyncHelloResponse xmlns="http://cleverbusopenhubframework.cleverlance.comorg/ws/HelloService-v1" xmlns:ns2="http://cleverbssopenhubframework.cleverlance.comorg/ws/Common-v1">
         <confirmAsyncHello>
            <ns2:status>FAIL</ns2:status>
            <ns2:additionalInfo>
				E120: the trace identifier does not contain allowed values (ValidationIntegrationException: the trace identifier 
				'applicationID=ERP,timestamp=2013-09-27T10:23:34.698+02:00,correlationID=da793349-b486-489a-9180-200789b7007f,processID=process123' is not allowed)
			</ns2:additionalInfo>
         </confirmAsyncHello>
      </asyncHelloResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...

Code Block
languagexml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <asyncHelloResponse xmlns="http://cleverbusopenhubframework.cleverlance.comorg/ws/HelloService-v1" xmlns:ns2="http://cleverbssopenhubframework.cleverlance.comorg/ws/Common-v1">
         <confirmAsyncHello>
            <ns2:status>OK</ns2:status>
         </confirmAsyncHello>
      </asyncHelloResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...

Code Block
languagexml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <asyncHelloResponse xmlns="http://cleverbusopenhubframework.cleverlance.comorg/ws/HelloService-v1" xmlns:ns2="http://cleverbssopenhubframework.cleverlance.comorg/ws/Common-v1">
         <confirmAsyncHello>
            <ns2:status>FAIL</ns2:status>
            <ns2:additionalInfo>E106: error during saving asynchronous message into storage (RuntimeException: some error)</ns2:additionalInfo>
         </confirmAsyncHello>
      </asyncHelloResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...

Info

It's good practice to use specific response for one request and not one common response for all requests: asyncHelloResponse -> asyncHelloRequest

 

If error occurred during incoming message processing (ThrottlingExceededException and StoppingException at this moment) then fault response is generated (identical for synchronnous message). Fault response contains error description and error code for clear indentification.

...

Code Block
languagexml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Server</faultcode>
         <faultstring xml:lang="en">E117: Access is denied - there is no required authorization role (AccessDeniedException: Access is denied)</faultstring>
         <detail>
            <errorCode xmlns="http://cleverbusopenhubframework.cleverlance.comorg">E117</errorCode>
         </detail>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

...