uCosminexus Service Platform, Basic Development Guide
You can create a service requester that sends a request for the service adapter's operating status from an application to the standard synchronous reception (Web Services).
To check the operating status of a service adapter, apart from invoking the service component that sends a request to the standard synchronous reception (Web Services), you must add a process for invoking the method for checking the operating status.
The following figure shows a procedure for creating a service requester that sends a request for checking the operating status of the service adapter from an application to the standard synchronous reception (Web Services):
Figure 8-11 Procedure for creating a service requester that sends a request for checking the operating status of the service adapter (Standard synchronous reception (Web Services and SOAP communication infrastructure))
The tasks in the individual steps are described below.
The WSDL acquisition method is the same as that used for creating an ordinary service requester that sends requests to the standard synchronous reception (Web Services).
Note that you need not use different WSDLs in the process for invoking the service component and in the process for checking the operating status.
For details about the WSDL acquisition method, 8.2.2 Acquiring the WSDL.
The stub creation method is the same as the one used for creating an ordinary service requester that sends requests to the standard synchronous reception (Web Services). That is, to create a stub, you use the WSDL2Java command provided by Cosminexus as a development support command.
For details about stub creation, see 8.2.3 Creating Stubs.
To generate an object for invoking a method of requesting for the service adapter's operating status (Web Services):
CSCMsgSyncServiceDeliveryWSImplServiceLocator locator = new CSCMsgSyncServiceDeliveryWSImplServiceLocator(); |
CSCMsgSyncServiceDeliveryWSImpl ws = null; try { ws = locator.getCSCMsgSyncServiceDeliveryWSImpl(); }catch (ServiceException e) { e.printStackTrace(); return; } |
String url = locator.getCSCMsgSyncServiceDeliveryWSImplAddress(); |
String result = ws.getServiceInfo( // Method invocation serviceName, // Service name clientID, // Client correlation ID "type=status"); // Option |
String result = ws.getServiceInfo( // Method invocation serviceName, // Service name clientID, // Client correlation ID "type=status,returnType=XML"); // Option |
Use the getServiceInfo method to request checking of the operating status of service adapters. The parameters that become the arguments of the method are different from those used in creating an ordinary service requester that sends requests to the standard synchronous reception (Web Services).
The following table shows the details of the parameters that are specified for a service requester that sends a request to a synchronous reception (Web Services) for the service adapter's operating status.
Table 8-7 Parameter details (Standard synchronous reception (Web Services) or service adapter operating status checking request)
Parameter name | Data type | Parameter (invokeBPXML) | Explanation |
---|---|---|---|
Service name (serviceName) |
java.lang.String | in0(type="xsd:string") | This is the service name of the request destination when the operating status of service adapter is checked. This parameter is required. For the service name of the request destination, specify the service adapter deployed on the HCSC server. |
Client correlation ID (clientID) |
java.lang.String | in1(type="xsd:string") | This is a correlation identifier for uniquely identifying the request message from the service requester. Specify alphanumeric characters, underscore (_), period (.), and hyphen (-) up to 255 characters. This parameter is used to map the request message from the service requester to the execution history, logs, and traces managed by the HCSC server. Therefore, specify a different ID for each request message sent to the HCSC server. To omit the client correlation ID, specify NULL. |
Option (option) |
java.lang.String | in2(type="xsd:string") | This is an option that is selected when acquiring the checked results of the operating status. The input format of an option is Key name=Value. Enclose the option within double quotation marks ("). When specifying multiple options, demarcate with a comma (,).#1
The following options can be specified:
|
The response message of the operating status check of service adapters is returned in the format specified in the parameter option.
The format and examples of response messages are described in the following points:
The information that can be acquired with a response message depends on the contents specified in the type option. The following information can be acquired with a response message:
Table 8-8 Information that can be acquired with a response message
Key or tag | Information contents | Response information based on the type option specification | |
---|---|---|---|
all | status | ||
HCSCServerName | HCSC server name | Y | Y |
ClusterName | Cluster name | Y | Y |
ServiceName | Service name | Y | -- |
ServiceStatus | Service adapter status | Y | Y |
ServiceKind | Service type | Y | -- |
ServiceProtocolKind | Adapter protocol type | Y | -- |
AdapterName | Adapter name | Y | -- |
AdapterLocalCall | Local key usage status | Y# | -- |
EntryTime | Adapter definition addition time | Y | -- |
ModifiedTime | Adapter definition update time | Y | -- |
The details of the acquired information are as follows:
YYYY/MM/DD hh:mm:ss.SSS
YYYY/MM/DD hh:mm:ss
Examples of response messages are described below.
<?xml version="1.0" encoding="UTF-8"?> <getServiceInfoResponse> <HCSCServerName>HCSC</HCSCServerName> <ClusterName>Cluster</ClusterName> <ServiceName>Service1</ServiceName> <ServiceStatus>Active</ServiceStatus> <ServiceKind>ServiceAdapter</ServiceKind> <ServiceProtocolKind>WebService</ServiceProtocolKind> <AdapterName>ad1</AdapterName><AdapterLocalCall/> <EntryTime>YYYY/MM/DD hh:mm:ss.SSS</EntryTime> <ModifiedTime>YYYY/MM/DD hh:mm:ss</ModifiedTime> </getServiceInfoResponse> |
{HCSCServerName=HCSC,ClusterName=Cluster,ServiceName=Service1,ServiceStatus=Active,ServiceKind=ServiceAdapter,ServiceProtocolKind=WebService,AdapterName=ad1,EntryTime=YYYY/MM/DD hh:mm:ss.SSS,ModifiedTime=YYYY/MM/DD hh:mm:ss} |
<?xml version="1.0" encoding="UTF-8"?> <getServiceInfoResponse> <HCSCServerName>HCSC</HCSCServerName> <ClusterName>Cluster</ClusterName> <ServiceName>Service1</ServiceName> <ServiceStatus>Active</ServiceStatus> <ServiceKind>ServiceAdapter</ServiceKind> <ServiceProtocolKind>WebService</ServiceProtocolKind> <AdapterName>ad1</AdapterName> <AdapterLocalCall/> <EntryTime>YYYY/MM/DD hh:mm:ss.SSS</EntryTime> <ModifiedTime>YYYY/MM/DD hh:mm:ss</ModifiedTime> </getServiceInfoResponse> |
When an error occurs while checking the operating status of the service adapter, catch the CSCMsgServerFaultException object and acquire the error information of SOAPFault.
For details about error information acquisition, see 8.2.8 Acquiring Error Information.
The main causes of occurrence of an error are as follows:
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.