# Heartbeat services (HeartbeatWsV2) Provides a service method to ping our server. It is useful to test connectivity and authentication. * **Type**: SOAP * **Production WSDL**: https://services.generali.gr/soap/v2/heartbeat?wsdl * **Test WSDL**: https://services-test.generali.gr/soap/v2/heartbeat?wsdl ##ping Pings the server. ###Input Type | Description ---- | ----------- *(nothing)* | *---* ### Output Type | Description ---- | ----------- String | Up and running message ### Example 1 #### Input ``` <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://v2.soap.ws.api.gbox.generali.gr/"> <soapenv:Header/> <soapenv:Body> <v2:ping/> </soapenv:Body> </soapenv:Envelope> ``` #### Output ``` <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:pingResponse xmlns:ns2="http://v2.soap.ws.api.gbox.generali.gr/"> <return>Welcome ws-00000425Blvdz, we are up and running!</return> </ns2:pingResponse> </S:Body> </S:Envelope> ``` #### Client (Java) Example of a simple Java client. Notice the exact naming of the classes depends on your client generator and it could be slightly different than the following. ``` package examples; import gr.generali.gbox.api.ws.soap.HeartbeatWs; import gr.generali.gbox.api.ws.soap.HeartbeatLocator; import java.util.Map; import javax.xml.ws.BindingProvider; public class Example1 { public static void main(String[] args) { HeartbeatLocator locator = new HeartbeatLocator(); HeartbeatWs service = locator.getHeartbeatWsPort(); // Authentication Map<String, Object> context = ((BindingProvider)service).getRequestContext(); context.put(BindingProvider.USERNAME_PROPERTY, "ws-00000425Blvdz"); context.put(BindingProvider.PASSWORD_PROPERTY, "5wPkZtXu2g-test"); // Execution String message = service.ping(); // Result System.out.println(message); } } ``` Being the output: Welcome ws-00000425Blvdz, we are up and running!