Ping a SOAP or REST Endpoint
To check if a SOAP or REST endpoint is up, specify a hop count of "0" in a Service Health Check request.
- If the service is available, the SOAP or REST endpoint will be hit and its Service Health Check response will be returned.
- If the service is unavailable, no response will be returned. The SOAP or REST Client will time out, awaiting a response.
Sample Response for SOAP/HTTP
Following response is seen for ping request in above example.
Similar response is seen for REST.
Sample Request and Response using SOAP Client
GET Method
You can ping SOAP endpoint over HTTP GET method.
http://<host>:<port>/<Context root>?ping
http://localhost:9895/helloWorldPT?ping
Sample response:
<HealthCheckResponse xmlns:ns2="http://www.tibco.com/healthcheck/" applicationName="jv.helloworld1.soa" correlationID="health-check-ping" status="Passed"> <Service bindingName="HelloWorld1SOAP" bindingType="SOAP" endTime="03 Aug 2018 15:17:00,464" endpointURI="urn:amx:DevEnvironment/jv.helloworld1.soa#service-binding(HelloWorldPT/HelloWorld1SOAP)___1.0.0.v2017-07-14-1247" environmentName="DevEnvironment" hostName="SystemHost" ipAddress="10.97.122.102" machineName="test-workstation" name="HelloWorldPT" nodeName="DevNode" portTypeName="HelloWorldPT" responseTime="4" startTime="03 Aug 2018 15:17:00,460" transportType="http" isSSLEnabled="false"/> </HealthCheckResponse>
POST Method
Sample Request
To check if SOAP endpoint is up, specify hop count "0" as shown in the following example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:heal="http://www.tibco.com/healthcheck/"> <soapenv:Header/> <soapenv:Body> <heal:HealthCheckRequest> <hops>0</hops> <!--Optional:--> <cache refreshCache="false" validityDurationInSecs="670"/> </heal:HealthCheckRequest> </soapenv:Body> </soapenv:Envelope>
Sample Response for SOAP/HTTP
The following response is seen for Ping request:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <HealthCheckResponse applicationName="jv.helloworld2.soa" correlationID="20e66b8a-f6de-46b6-b60a-b7c78ba23682" status="Passed"> <Service bindingName="HelloWorld2SOAP" bindingType="SOAP" endTime="09 Jun 2015 17:45:39,264" endpointURI="/helloWorldPT/" environmentName="DevEnvironment" hostName="SystemHost" ipAddress="127.0.1.1" isSSLEnabled="false" machineName="tsmith-HP-Z230-SFF-Workstation" name="HelloWorldPT" nodeName="DevNode" portTypeName="HelloWorldPT" responseTime="0" soapVersion="1.1" startTime="09 Jun 2015 17:45:39,264" transportType="HTTP"/> </HealthCheckResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Sample Response for SOAP/JMS
The following response is seen for Ping request:
<?xml version = "1.0" encoding = "UTF-8"?> <outputMessage> <ns2:HealthCheckResponse applicationName = "SOAPJMS" correlationID = "47271923-51ca-44a9-b161-0a6126720707" status = "Passed" xmlns:SOAP-ENV = "http:// schemas.xmlsoap.org/soap/envelope/" xmlns:ns2 = "http://www.tibco.com/healthcheck/"> <Service bindingName = "SOAPService_Binding1" bindingType = "JMS" correlationScheme = "MESSAGEID_TO_CORRELATIONID" deliveryMode = "PERSISTENT" destination = "soapjms.queue" endTime = "16 Nov 2015 00:34:08,555" environmentName = "DevEnvironment" hostName = "SystemHost" ipAddress = "127.0.1.1" jmsMsgId = "ID:EMS-SERVER.B135640392BA5F:4" machineName = "HP-Z230-SFF-Workstation" name = "Greetings" nodeName = "DevNode" portTypeName = "Greetings" replyTo = "Queue[soap.reply.queue]" responseTime = "1" soapJmsBindingSpec = "TIBCO" soapVersion = "1.1" startTime = "16 Nov 2015 00:34:08,554" transportType = "JMS"/> </ns2:HealthCheckResponse> </outputMessage>
Sample Request and Response using REST Client
GET Method
You can ping REST endpoint over HTTP GET method.
http://<host>:<port>/<Context root>?ping
http://test-workstation:9896/bookstore?ping
Sample Response:
Following response is seen for above ping request over HTTP GET:
<HealthCheckResponse xmlns:ns2="http://www.tibco.com/healthcheck/" applicationName="com.tibco.restbt.sample.bookstore" correlationID="health-check-ping" status="Passed"> <Service bindingName="RESTService_Binding1" bindingType="REST" endTime="03 Aug 2018 15:17:43,261" endpointURI="urn:amx:DevEnvironment/com.tibco.restbt.sample.bookstore#service-binding(BookStoreResource/RESTService_Binding1)___1.0.0.v2014-12-31-1101" environmentName="DevEnvironment" hostName="SystemHost" ipAddress="10.97.122.102" machineName="test-workstation" name="BookStoreResource" nodeName="DevNode" portTypeName="BookStoreResource" responseTime="3" startTime="03 Aug 2018 15:17:43,258" transportType="http" isSSLEnabled="false"/></HealthCheckResponse>
POST Method
HTTP Headers:
To make a request with XML, the appropriate HTTP headers are:
Accept:application/xml Content-Type:application/xml
Request:
To check REST Endpoint is up specify hop count "0" as shown in the following example:
<HealthCheckRequest xmlns="http://www.tibco.com/healthcheck/"> <hops>0</hops> </HealthCheckRequest>
Response:
The following response is seen for request in the above example:
<ns2:HealthCheckResponse applicationName="DeveloperREST_Bookstore_InternalClient" correlationID="65599531-4867-441f-97bf-4773dba229c7" status="Passed" xmlns:ns2="http://www.tibco.com/healthcheck/"> 15 Service Health Check Feature <Service bindingName="RESTService_Binding1" bindingType="REST" endTime="24 Jan 2018 11:27:14,905" endpointURI="urn:amx:DevEnvironment/ DeveloperREST_Bookstore_InternalClient#service-binding(BookStoreResource/ RESTService_Binding1)___1.0.0.v2018-01-23-1222" environmentName="DevEnvironment" hostName="SystemHost" ipAddress="127.0.0.1" isSSLEnabled="false" machineName= "test-workstation" name="BookStoreResource" nodeName="DevNode" portTypeName="BookStoreResource" responseTime="1" startTime="24 Jan 2018 11:27:14,904" transportType="HTTP"/> </ns2:HealthCheckResponse>