Previous Topic

Book Contents

Book Index

Next Topic

Processing a Service Request

Preconditions:

  • A running Valuemation web application (required for using web services)
  • Prepared Web Service Client in Valuemation

Example: Processing a Service Request for the Ticket Creation using the JSON data format.

Processing a Service Request follows this pattern:

Help Image

Accepting a Request

To send a service requests from your client application which is accepted by Valuemation you have to set the following:

  1. Define the IP address of Valuemation and the service method ('execwf').

    The host and port are dependent on the current environment, the rest of the path is valid for all applications.

  2. Use the 'Post' method for the http request.
  3. Define the content type as the 'application/json'.

    Help Image

  4. Define the body with the corresponding parameters.

    Please see the following topics.

Logging in a User with Provided Credentials

The following parameters in the request body involve a successful user login into Valuemation:

  • username - the user assigned to the Web Service Client
  • password - the password which can be either encrypted or decrypted.
  • encrypted - specify 'Y' or 'N' depending on the password encryption.

{

"accessToken":"abc+-123!?",

"username": "wstest",

"password": "6AD6509DB447B03C1CAAF7D3C40DAE08",

"encrypted":"Y",

"service": "CreateTicket",

"params": {

"ticketclass": "Incident",

"tickettype": "Complaint",

"statementtype": "Information",

"tckShorttext": "Monitor is broken",

"description": "Only shows a black screen.",

"persnoReqBy": "P-90007"

}

}

Note: The password encryption is managed by the 'runCrypto' application which can be found in the root folder of the Valuemation installation.

Validating the Service Request

When Valuemation validates the service request, it determines the web service client by the provided 'access token' and checks for the correctly assigned user and the web service.

The following parameters are involved:

  • accessToken - the access token as defined in the Web Service Client.
  • username - the user assigned to the Web Service Client.
  • service - the service ID of the Web Service.

{

"accessToken":"abc+-123!?",

"username": "wstest",

"password": "6AD6509DB447B03C1CAAF7D3C40DAE08",

"encrypted":"Y",

"service": "CreateTicket",

"params": {

"ticketclass": "Incident",

"tickettype": "Complaint",

"statementtype": "Information",

"tckShorttext": "Monitor is broken",

"description": "Only shows a black screen.",

"persnoReqBy": "P-90007"

}

}

For reference, see the following matches between the parameters and the definitions in Valuemation:

Help Image

See also the Web Service Client in the Edit View topic.

Applying the Authorization Mode

In this step, Valuemation checks if the special 'Web Service' roles or the standard roles have to be used during the service execution. Note that this definition is not a part of the service request body but it is part of the web service assignment and the web service client context.

Help Image

See also the Web Service Authorization section.

Starting the Workflow Associated with the Service

Finally Valuemation starts the workflow associated with the Web Service. Once the workflow has been executed, it will send some responses.

See the Sending a Response topic.

Sending a Response

If the service request was processed successfully, the correct result would look as follows:

{

"result": {

"score": "success",

"data": {

"ticketno": "IN-0000070",

"id": "Ticket-216170#"

},

"id": "WS_REST_CreateTicket_0",

"locale": "en_US"

},

"returnCode": "00",

"timing": {

"total": 1275,

"authByLogin": 164

}

}

In case of the service request failure, variety of return codes can inform you about the exact cause of the problem.

See the Return Codes topic for details.

See Also

Processing a Service Request

Accepting a Request

Logging in a User with Provided Credentials

Validating the Service Request

Applying the Authorization Mode

Starting the Workflow Associated with the Service

Return Codes