Manage Service – Using Service Parameters
NetOcean supports several types of parameters to hold the values for composing service responses, template selection and data selection.
Note: In the header label for any service, the corresponding mode is displayed, which helps a user to identify which header belongs to which mode. For example, if a user is using the service in Normal mode, the header label displays “[Normal Mode]”. Whereas, if the user is using the service in RTC mode, the header label displays “[RTC Mode]”.
- On the Services menu, click the Manage menu item to get list of services. Then, click on the service to manage, the NetOcean – Edit Service page is displayed.
Sequence shows the order in which the conditions will be evaluated. Template with first matching condition is used for response. Default template (one without condition) is used if no other conditions match.
Note: With Template Ordering button, the user can change the sequence number of the templates in a virtual service. It helps the users to simulate their services as per priority.
- Then, click on Parameters Settings (
) menu > Service Parameters to view service parameters.
Note: The user can import parameters from another service by using the Import button.
- To add service parameters, click the Parameters Settings menu
> Add Parameters.
4. Using Service Parameter section, user can add the following parameters and can select the Data Source:
- Search Parameter
- Searchln Parameter
- Request parameters
- URL query parameters
- Scratch parameters
- Scratch Array
- Dataset
- Indexed dataset
- Data/time parameters
- Random number
- Random string
- Unique number
- Cookie parameter
- XML parameter
- Conditional Logic based parameter values
- Json parameter
5. Click the Service Parameter link to see list of all parameters. Using this window, user can do following tasks:
- Import: Import parameters specification in the tabular format for all parameters.
- Update: Update parameter specifications. Update displays edit window of the parameter.
- Delete: Delete a parameter.
Note: To add a parameter of a specific type, click on the parameter link of that parameter on the left pane.
All parameters are to be provided a unique name. Parameter Name should be started with a character, followed by characters, underscore and numbers. Special Characters are not allowed. Name should be of maximum 64 character.
Search Parameter
Search parameters are used to hold the values for composing service responses. The values for a search parameter can be assigned from the content of incoming service requests. The specific part of the request to be assigned is defined using the properties of Search parameter.
Steps to add Search Parameter
Go to Parameters Settings menu > Add Parameters > Search Parameter on the left pane. The Add Search Parameter window is displayed.
Following are the specifications of Search Parameter:
Parameter Details
- Parameter Name: Unique name for the parameter.
- Prefix: Expected prefix of value in incoming request.
- Suffix: Expected suffix of value in incoming request.
- Binary Data: Upon selecting this check box, user can search for a string using its ASCII code.
- Regular Expression: Upon selecting this check box, user can search for a string by providing a regular expression.
- Ignore Case for Prefix / Suffix: Upon selecting this check box, case is ignored for prefix and suffix.
Advance Settings
- Search: This specifies the scope of the search, that is, where to search for the data. The possible values are Body, Header, and URL.
- Occurrence Count: This property is used when the source value of a search parameter can occur multiple times in a request. It indicates which instance of the value should be extracted. The default index is 1.
- Prefix Matching Mode: This option is required if there are multiple prefixes and a single suffix in the request and the user wants to choose any prefix from those prefixes. The available options are Closest to Suffix, First in the Block, and Specified.
- Start Offset: This is required if only part of the delimited value needs to be assigned to the parameter. It defines the starting position of the portion which needs to be extracted. (0 indicates first character, 1 indicates second and so on) The offset value must be non-negative.
- Maximum Length: The length of a sub-string of the found value, from the specified offset, to search to the parameter. The default is 0, indicating until the end of the string.
- Transform: Specifies any built-in transforms which need to be applied to the extracted value before it is assigned to the parameter.
Sample Request
- Template Name: The user can view sample request contents of any template by selecting it from a drop-down list.
- Set Prefix: This button is to set the prefix by selecting it in the sample request content.
- Set Suffix: This button is to set the suffix by selecting it in the sample request content.
- Auto Wrap: It automatically wraps the sample request data of template for formatting.
Searchln
SearchIn Parameter serves a request of finding a text string in a page (with dynamic information) and saves it into a parameter. The request recorded by SearchIn parameter searches for the content between the specified boundaries (prefix and suffix) and saves the searched results in the response.
Specify the following properties for working with SearchIn parameter:
- Parameter Name: Unique name for the searchIn parameter.
- Prefix: The starting point from where the value is to be extracted in the request. If no prefix is provided, then start of the request is considered as prefix. Further, user can specify the binary data and regular expression in the prefix by specifying the corresponding values and selecting the ‘Binary Data’ and ‘Regular Expression’ check boxes respectively.
- Suffix: The ending point up to which the value is to be extracted in the request. If no suffix is provided, then end of the request is considered as the suffix. Further, user can specify the binary data and regular expression in the suffix by specifying the corresponding values and selecting the ‘Binary Data’ and ‘Regular Expression’ check boxes respectively. Note: In Prefix and Suffix, use \n, \r, and \t for new line, carriage return, and tab respectively. All other backslash (\) must be escaped using another backslash(\).
- Ignore Case for Prefix / Suffix: If user selects this, case will be ignored for prefix and suffix. Example: if prefix / suffix is set to <welcome> or <WELCOME> both cases will be applicable upon selecting this check box.
Search In: Specifies the scope of the searchIn i.e. in which parameter we have to apply the searchIn to search the delimited data.
Occurrence Count: This property is used to identify which instance(s) to capture when the matched value of a SearchIn parameter occurs multiple times in the request.
- Any: Randomly one of the occurrences is captured.
- All: All occurrences are captured.
- Specified: Particular instance is captured.
Prefix Matching Mode: This is required if there are multiple prefixes and a single suffix in the request and user wants to choose any prefix from those prefixes. (Default Settings- Closest to Suffix.) Usage of all the options is provided below:
- Closest to Suffix: Instance in which prefix is closest to the suffix is captured.
- First in the Block: The first instance within the block is captured.
- Specified: Only specified instance is captured.
Start Offset: This is required if only part of the delimited value needs to be assigned to the parameter. It defines the starting position of the portion, which needs to be extracted. The offset value must be non-negative.
Maximum Length: The length of a sub-string of the found value, from the specified offset, to search to the parameter.
Transform: Specifies any built-in transforms, which need to be applied to the extracted value before it is assigned to the parameter. There are following options within this:
- None: It represents the value as it is.
- Reverse: It reverses the extracted value.
- Upper Case: It transforms the extracted value in upper case.
- Lower Case: It transforms the extracted value in lower case.
- LTrim: It trims the white spaces (occurred at the left) from the extracted value.
- RTrim: It trims the white spaces (occurred at the right) from the extracted value.
- Trim: It trims the whitespaces (occurred at the left and right) from the extracted value.
Sample Request
- Template Name: Here, user can view sample request content of any template by selecting it from a dropdown list.
- Set Prefix: Clicking this button sets the prefix as selected in the sample request content.
- Set Suffix: Clicking this button sets the suffix as selected in the sample request content.
- Auto Wrap: It wraps the sample request data of template automatically. This feature is used for formatting purpose only.
Request Parameter
Request parameters are used to hold the values for composing service responses. The values for a request parameter can be assigned from the HTML Form (input elements) coming in the request.
Steps to Add Request Parameter
Go to Parameters Settings menu > Add Parameters > Request Parameter link on the left pane. The Add Request Parameter window is displayed.
Following are the specification of request parameter:
- Attribute Name: Attribute name for which the parameter is defined. This is the name of Form element coming in request. For example, to get the value of Request parameter ‘shippingMethod’ from request:
POST /checkout/shippingpayment?event=selectShippingMethod HTTP/1.1 Host: 11.16.152.115:3894 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.24) Gecko/20111103 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 16 Origin: https://localhost:9773 shippingMethod=US Then, Attribute Name is 'shippingMethod' and its value is 'US'.
Note: On selecting the ‘Parameter name is same as attribute name’ check box, the parameter name is considered same as the attribute name.
- Parameter Name: Name of parameter to be associated with an attribute name. This name must be unique among all parameters in the service. Example: “UserId”.
- Occurrence Count: This property is used when the source value of a Request parameter can occur multiple times in a request. It indicates which instance of the value should be extracted. The default index is 1. Select one of following:
- Index: Particular instance
- All: All occurrences
- Any: Randomly select one of the occurrence.
- Start offset: This is required if only part of the delimited value needs to be assigned to the parameter. The offset value must be non-negative. Only numbers are allowed and there is no limit. It defines the starting position of the portion which needs to be extracted means from where value of variable is started.
- Maximum length: Maximum length of the attribute value to be saved. A default value for the variable is 0. If the value is 0, then save complete attribute value.
- Decode: To decode when attribute value is extracted from the HTTP request. Decoding is done for URL style encoded value of the attribute. Example: %3D decode into =.
- Transform: Specifies any built-in transforms which need to be applied to the attribute value before it is assigned to the parameter. This is done after Decode, if decoding is to be done.
- Reverse: String fetched from request is reversed in the response file.
- None: No transformation is done.
- Encode in response Template: To encode request parameter if used in the response template.
- Do not encode: No need to encode value in response template
- Encode all characters: Encode all character of value in response template
- Encode specified characters: Encode only specified characters of value.
- Decode Attribute Value: To decode/do not decode the attribute value.
URL Query Parameter
URL Query parameters are used to hold the values for composing service responses. The value for a URL Query parameter can be assigned from the query string of URL of incoming service requests.
Steps to Add URL Query Parameter
Go to Parameters Settings menu > Add Parameters > URL Query Parameter link on the left pane. The Add URL Query Parameter window is displayed.
Following are the specification of Query parameter:
- Parameter Name: Unique name for this parameter. If this is the same as query name, select the Parameter name is same as query name check box. By default, it is selected.
- Query Name: Name of the parameter in the query string of a URL.
For example, if user needs the value of URL Query parameter 'Address' from URL http://www.abc.com/index.jsp?Name=cavisson&Address=US, then Query Name is 'Address' and its value is 'US'.
- Occurrence Count: This property is used when the source value of a Request parameter can occur multiple times in a request. It indicates which instance of the value should be extracted. The default index is 1. Select one of following:
- Index: Particular instance
- All: All occurrences
- Any: Randomly select one of the occurrence.
- Conversion: This field is used to specify the conversion – none/encode/decode.
Scratch Parameter
Scratch parameters (also called declare parameters) are used to set values in call back methods. These parameters are declared and then used in response and/or conditions.
Steps to Add Scratch Parameter
Go to Parameters Settings menu > Add Parameters > Scratch Parameter link on the left pane. The Add Scratch Parameter window is displayed.
Following are the specifications of scratch parameter:
- Parameter Name: Unique name for this parameter.
- Default Value: If nothing comes in scratch parameter value then default value comes in place of parameter name in response.
Scratch Array Parameter
Scratch array variable is used to declare a variable and its size. Sometimes multiple scratch parameters are required to store multiple parameter values so for this scratch array parameter is used.
Steps to Add Scratch Array Parameter
Go to Parameters Settings menu > Add Parameters > Scratch Array Parameter link on the left pane. The Add Scratch Array Parameter window is displayed.
Following are the specifications of scratch array parameter:
- Parameter Name: Unique name for this parameter. Parameter name must be start with Alpha.
- Size: It is the size of array.
- Default Value: If nothing comes in scratch parameter value then default value comes in place of parameter name in response.
Dataset Parameter
Datasets are used to source the values from text files. This is a very common method for getting data by instructing NetOcean to take values from an external file. Data is contained in a file – either an existing file or one that user created using this GUI. In Datasets multiple set names can be defined separated by “,”.
Steps to Add Dataset Parameter
Go to Parameters Settings menu > Add Parameters > Dataset Parameter link on the left pane. The Add Dataset Parameter window is displayed.
Following are the specification of Dataset parameter:
- Parameter Name(s): Unique name for this parameter. Multiple parameter names can be provided at the same time using comma as separator to populate multiple parameters with values from the Dataset. For example: Name, Address.
- Dataset File Name: Its name can be started with number, characters and no limit of max chars to be used for Data file name from where the values need to take.
- Dataset file Contents: Contents can be any combination of characters, numbers, special characters are also allowed. These contents can get from existing file from the server by specifying Dataset File name and click on View. User can also write in to this and upload it using Upload
- Header Line: In some situations, consider first few lines as headers. System does not consider these lines as data lines while picking data from file. By default, header line is 0.
- First Data Line: In some situations, user might want to start reading data from a particular line number. So, user can use this field to indicate which line it should consider as first Data Line. By default, first Data Line is 1.
- Column Delimiter: This field specifies which character in data file should be considered as column separator. By default, column delimiter is ‘,’. User can use special symbols as column delimiter.
- Fetch Parameters From Header: It is to get the parameter names form header line of dataset contents by splitting it by Column Delimiter. Header line is defined in text box by user.
Example: If header line is Name, AccountNo, CreditCardNo, Balance and column delimiter is “,” then parameters names is Name, AccountNo, CreditCardNo and Balance.
- Update Value On: There are two modes available:
- SESSION, value of the variable is initialized only once during a session at the time of first use & is not changed during the session. Means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
- USE, in this option value of the parameter is set every time it is used in the response template.
- Ignore Invalid Data Line: Selecting this check box provides a user the flexibility to ignore the invalid lines present in the file or to have an error in case of invalid line.
- Row Selection Mode: there are 2-modes are available
- Sequential: – to select rows sequentially from the beginning of file to the end of file.
- Random: – to select any row randomly from the file.
- Parameter value: In this field, multiple parameter values can be provided.
e.g. (Fn=<value> or<filename>) Where n specifies the index number to refer the parameter name, default value for parameter values is value. Example: If dataset contents are: /home/NetOcean/user1,LA /home/NetOcean/user2,CA /home/NetOcean/user3,NY
In parameter value, user provides F1=file,F2=value
It means first parameter value comes from file which is specified in first field and second parameter value is as specified in the second field. File can have any data (one or many lines) and the whole file content is the value of the first field. It is useful when parameter value can have multiple data lines or its data can have the file separator for example address.
Notes: A user cannot save a blank file or provide blank dataset contents. While doing so, an error message “Please enter dataset content” is displayed. FILE is a mandatory argument and data-file-name specifies the file name containing the list of values for the variable(s) being declared. Format of the value file is as follows:
- If there is only one variable being defined in the declaration, the file contains list of values with one value on a single line.
- If multiple variables are being defined, a value of all variables would be defined on a single line and the values would be separated by “,”. Effectively, each row contains a set of values for each variable declared. The order of values in a row should correspond to order of variable names in the declaration.
- If the file name is a relative path (not starting with /), it is assumed relative to service directory of the test script to which these variables belong.
Indexed Dataset Parameter
Indexed Dataset Parameters are specialized Dataset parameters where values provided in data files can be selected based on an index value. The index can be assigned from any other parameter e.g. a customer id from an incoming request can be used to select a row of values in the data file for discount codes. In Indexed Dataset parameters multiple parameter names can be defined separated by “,”.
Steps to Add Indexed Dataset Parameter
Go to Parameters Settings menu > Add Parameters > Indexed Dataset Parameter link on the left pane. The Add Indexed Dataset Parameter window is displayed.
Following are the properties of Indexed Dataset parameter:
- Index Parameter: It is the parameter name whose value specifies the value of indexed dataset parameter.
- Parameter Name(s): It should start with a character, next user can use Numbers, and underscore is also allowed. Max length of parameter name should be of 64 characters. Multiple parameter names can be provided at the same time, separated by a comma.
- Index Dataset File Name: Its name can be started with number, characters and no limit of max chars to be used for Data file name
- Index Dataset Contents: Contents can be any combination of characters, numbers, special characters are also allowed. These contents can be loaded from an existing file from the server by specifying Dataset File name and clicking on View. You can also enter data in this field and upload it using Upload button. To view the data in tabular format, click the Table Format check box.
- Default Value: If no value matches in file regarding the index value comes in request then default value serves for index parameter.
- Ignore Invalid Data Line: Selecting this check box provides a user the flexibility to ignore the invalid lines present in the file or to have an error in case of invalid line.
- Header Line: In some situations, consider first few lines as headers. System does not consider these lines as data lines while picking data from file. By default, header line is 0.
- First Data Line: In some situations, user might want to start reading data from a particular line number. So, user can use this field to indicate which line it should consider as first Data Line. By default, first Data Line is 1.
- Column Delimiter: This field specifies which character in data file should be considered as column separator. By default, column delimiter is ‘,’. User can use special symbols as column delimiter.
- Fetch Parameters From Header: It is to get the parameter names from header line of index dataset contents by splitting it by Column Delimiter. Header line is defined in text box by user. Example: If header line is Name, AccountNo, CreditCardNo, Balance and column delimiter is “,” then parameters names is Name, AccountNo, CreditCardNo and Balance.
- Parameter value: In this field, multiple parameter values can be provided.
e.g. (Fn=<value> or<filename>) Where n specifies the index number to refer the parameter name, default value for parameter values is value.
Example: If indexed dataset contents are 001/home/NetOcean/user1,LA 002/home/NetOcean/user2,CA 003/home/NetOcean/user3,NY
In parameter value, user provides F1=file,F2=value it means first parameter value comes from file path which is specified in content and second parameter value is itself. (LA/CA/NY)
Note: You cannot save a blank file or provide blank dataset contents. While doing so, an error message “Please enter dataset content” is displayed.
Date/Time Parameter
Date/Time replaces the parameter with the current date and/or time. To specify a date/time format, user can select a format from the format list or specify his/her own format.
Steps to Add Date/Time Parameter
Go to Parameters Settings menu > Add Parameters > Date Time Parameter link on the left pane. The Add Date/Time Parameter window is displayed.
Following are the properties of date/Time parameter:
- Parameter Name: This value must begin with a character. Numbers or underscores can be used for the rest of the name. Max length can be 64 characters.
- Format: Defines the format of date/time by selecting one from the available list of formats.
- Sample (Current Date/Time): Displays the current date and time of system in selected format.
- Offset: Offset in days from current day. It can be 0, positive number or negative number. If its value is positive, then it adds the number of days to the current day and use that date. If offset is negative, then the value of the parameter is OffSet number of days before to the current date.
- Update Value On: This property has two options:
- SESSION – Value of the parameter is initialized only once during a session at the time of first use and is not changed during the session. This means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
- USE – Value of the parameter is set every time it is used in the response template.
Random Number Parameter
Random Number replaces the parameter with a random number. User can set a range of numbers by specifying minimum and maximum values. User can use the Random Number parameter type to sample the system’s behavior within a possible range of values.
Steps to Add Random Number Parameter
Go to Parameters Settings menu > Add Parameters > Random Number Parameter link on the left pane. The Add Random Number Parameter window is displayed.
Following are the properties of random number parameter:
- Parameter Name: its value should be started with a char. Further number, underscore can also be used. Max length should be of 64 char.
- Minimum: It is the minimum number of digits used for range, should be number only. There is no limit of minimum number of digit.
- Maximum: It is the maximum number of digits used for range. No limit for maximum number of digits.
- Format: Select a Number format, indicating the length of the random number. Specify (%01lu or %lu) for one digit, %02lu for two digits, and so on.
- Update Value On: This property has two options:
- SESSION – Value of the variable is initialized only once during a session at the time of first use & is not changed during the session. Means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
- USE – Value of the parameter is set every time it is used in the response template.
Random String Parameter
Random String replaces the parameter with a random string. User can set a range for number of characters in string by specifying minimum and maximum values. User can use the Random String parameter type to sample the system’s behavior within a possible range of values.
Steps to Add Random String Parameter
Go to Parameters Settings menu > Add Parameters > Random String Parameter link on the left pane. The Add Random String Parameter window is displayed.
Following are the properties of random String parameter:
- Parameter Name: It defines the name of the parameter. User can use the Random String parameter type to sample the system’s behavior within a possible range of values.
- Minimum: It defines the minimum number of characters used in Random String.
- Maximum: It defines the maximum number of characters used in Random String.
- Character Set: It is to define characters to be used in Random String. Characters can be defined either individually i.e. age or range i.e. A-Z. Accepted character set are (a-z, A-Z, 0-9)
- Update Value On: This property has two options
- SESSION – Value of the variable is initialized only once during a session at the time of first use & is not changed during the session. Means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
- USE – Value of the parameter is set every time it is used in the response template.
Unique Number Parameter
Unique Number replaces the parameter with a unique number.
Steps to Add Unique Number Parameter
Go to Parameters Settings menu > Add Parameters > Unique Number Parameter link on the left pane. The Add Unique Number Parameter window is displayed.
Following are the properties of random String parameter:
- Parameter Name: Its value should be started with a char. Further number, underscore can also be used. Max length should be of 64 char.
- Format: It defines the format of unique number to be generated. Different formats are available in list. If user selects %03lu, it means random number should be of 3 digits, if number is of 2 digits then automatically in place of remaining digits ‘0’ be used.
- Update Value On: This property has two options:
- SESSION – Value of the variable is initialized only once during a session at the time of first use & is not changed during the session. Means the parameter is set once for each service request. It does not depend on how many times this parameter is used in response template.
- USE – Value of the parameter is set every time it is used in the response template.
Cookie Parameter
Cookie parameters are used to hold the values for composing service responses. The values for a cookie parameter can be assigned from the cookie coming in the request.
Steps to Add Cookie Parameter
Go to Parameters Settings menu > Add Parameters > Cookie Parameter link on the left pane. The Add Cookie Parameter window is displayed.
Following are the properties of Cookie parameter:
- Cookie Name: Cookie name for which the parameter is defined. It is optional. If not passed, then cookie name is same as cookie parameter name. More than one parameter can be defined for one cookie. This is meaning if user needs to apply different save offset, transformation etc. to get different values in different parameters.
- Parameter Name: Name of parameter to be associated with a cookie. This name must be unique among all parameters in the service. It must start with an alphabet and after alphabet, user can use number and underscore also. Maximum length should be of 64 characters. Example JSessionIdVar.
- Start Offset: This is required if only part of the cookie value needs to be assigned to the parameter. The offset value must be non-negative. Only numbers are allowed and there is no limit. It defines the starting position of the portion which needs to be extracted means from where value of variable is started. Offset can have any value >= 0;
0 indicates save from beginning of value. (Default) > 0 indicates save after this offset (Offset 0 mean 1st character)
- Maximum Length: Maximum length of the cookie value to be saved. It must be >= 0.
0 indicates that save complete cookie value. (Default). >0 indicates save up to this length.
- Decode Cookie value: To decode when cookie value is extracted from the HTTP request. Decoding is done for URL style encoded value of the cookie. Value is not case sensitive.
- Yes – value is decoded before saving in the parameter.
- No – not decoded
- Transform: Specifies any built-in transforms which need to be applied to the cookie value before it is assigned to the parameter. This is done after Decode if decoding is to be done.
- Reverse: If user uses reverse, then string fetched from request is reversed in the response file.
- None: No transformation is done. It displays string as it is without any modification.
- Encode in response template: To encode cookie parameter if used in the response template. Value is not case sensitive.
- None – No need to encode value in response template.
- All – Encode all character of value in response template.
- Specified – Encode only specified characters of value as defined by SpecifiedChars argument. Special characters to be encoded.
- Action On Not Found: The action to be taken if cookie name is not found in the HTTP request. No cookie value can be empty which a found case is.
- None – Do not log message
- Warning: Log message (Message is logged in error log)
Note: In case cookie is not found in HTTP request, then default value is used.
- Default Value: Default value of cookie parameter if cookie is not found in the request. It can be empty. Default value of DefaultValue is empty.
XML Parameter
XML variables are initialized as a result of searching a request for user specified criteria. Any pattern appearing within the XML node would be used to initialize the value of XML NO variable.
Steps to Add XML Parameter
Go to Parameters Settings menu > Add Parameters > XML Parameter link on the left pane. The Add XML Parameter window is displayed.
Following are the properties of XML parameter:
- Parameter name: This is the name of XML variable being defined. It’s a mandatory field. This name must be unique among all parameters in the service. It must start with an alphabet and after alphabet, user can use number and underscore also. Maximum length should be of 64 characters.
- XML Node Path: Specify the full path of the node which value user needs to fetch. For example, in below XML, user needs to get the value of node referringId then XML Node Path should be:
<soapenv:Envelope> <soapenv:Body><prepareOrder><in ><header><referringId>. Complete path of any node can be set using "Set XML Node Path" button that is explained below. <soapenv:Envelope xmlns:soapenv="http:////schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <prepareOrder xmlns="http://www.mst.macys.com/xsd/order"> <in> <header xmlns=""> <referringId>271</referringId> <partnerOrderId>2159013153</partnerOrderId> </header> </in> </prepareOrder> </soapenv:Body> </soapenv:Envelope>
- Occurrence Count: It is required if multiple occurrence found of specified node. User has three options for this.
- Index: By selecting this user can define which index of occurrence need to pick.
- All: If user selects this option then system takes all occurrence of the specified node.
- Any: It takes randomly any one occurrence out of all.
- Conversion: This option is used to encode search pattern. It has three options.
- None: In this option, no encoding is applied.
- HTMLToURL: It converts HTML-encoded data to a URL-encoded data.
- HTMLToText: It converts HTML-encoded data to plain text format.
- Value Type: It specifies that the value of parameter is node value or attribute value. It has two options.
- Node Value: In this options system gets the value of node. For example if XML Node Path is <soapenv:Envelope><soapenv:Body>
<in><header><referringId> with ‘Node Value’ option then it gets the value 271. - Attribute Value: In this option, system asks for the attribute name and get the value of specified attribute. For example if XML Node Path is <soapenv:Envelope><soapenv:Body><prepareOrder> with ‘Attribute Value’ option and Attribute name is ‘xmlns’ then it gets the value “http://www.mst.cavisson.com/xsd/order”.
- Node Value: In this options system gets the value of node. For example if XML Node Path is <soapenv:Envelope><soapenv:Body>
- Node selection criteria (Where Clause): Argument specifies the qualifiers/clauses. These are particularly useful when NODE occurs multiple times but may also be used to make sure that Node value is assigned only when certain condition is matched. When multiple WHERE arguments are present, all WHERE qualifiers/clauses should be satisfied WHERE argument has the form WHERE=type=value.
Two options are applicable for where clause
None: Nothing to node selection criteria.
Specified: Type can take following forms:
Node value like Natraj i.e.: WHERE=<>=”Natraj”
Attribute, attribute name in angular braces specify the attribute value.Value should be specified in double quotes. If the values contain a double quote (“).
- Sample Request for Template Name: Here user can view sample request contents of any template by selecting in to a dropdown. We are displaying the sample request here to help user to specify the node/attribute.
- Set XML Node Path: This button is to help user to get the complete path of the node and set in to XML Node Path by selecting any node. For example if user selects ‘partnerOrderId’ node and clicks on this button then complete path of this node ‘<soapenv:Envelope><soapenv:Body><prepareOrder><in><header>
<referringId>’ is automatically set in to XML Node Path.
- Set Attribute Name: This button is to set the attribute name by selecting it in the sample request content.
Conditional Logic
Conditional logic feature can be used to define the value of any parameter by any defined condition. It can have multiple conditions using ‘If’ and ‘Else If’.
Steps to conditional assignment of Parameter value
Go to Parameters Settings menu > Add Parameters > Conditional Logic link on the left pane. The Conditional Logic window is displayed.
Following are the properties of conditional logic:
- Condition: First add If or Else If or Else from this list then all other values is enabled. Condition can be added by clicking on Add Once any condition is added then it is disabled until other things added like Expression and Set Parameter.
- Select Expression: This section is to define the expression for condition. Expression can be any parameter value equals to/not equals to any other parameter value. Expression can also be compare between any parameter values with any constant defined value.
- Logical Operator: Multiple conditions also can apply using logical operator between them.
- AND: If AND operator is there in-between two conditions then whole condition is satisfied only when both condition is satisfied.
- OR: If OR operator is there in-between two conditions then whole condition is satisfied when any condition is satisfied.
- Set Parameter: This section is to define that value of which parameter is going to set through this condition. Value of parameter can be from these options.
- Constant: Here the value of parameter is a defined constant value.
- Random Value: In this option, system takes a range from and to. System picks a random number from this range and set this to parameter.
- Unique: In this option, system generates a unique number to set as parameter value.
- System Var: In this option, system provides a dropdown which contains all system variables. System variables are pre-defined variables and bundled with NetOcean product.
- Random Value From List: In this option, user can define multiple values separated by “,”. System takes any value randomly out of them.
- Other Var: In this option, system provides a dropdown list which contains already created variables in the service.
- Add: This button adds the selected section in Logical Block
- Reset: It resets all values
- Logical Block: It contains the final output of conditional logic which is going to be applied.
Example: If userID = "34567334" OR userID = "98273621" Set cardNo = "7268898672" Else If userID = "29384743" Set userID = Random(2000000000,2500000000) Else Set userID = Unique()
JSON Parameter
JSON variables are initialized as a result of searching a request for user specified criteria. Any pattern appearing within the JSON node would be used to initialize the value of JSON NO variable.
Steps to Add JSON Parameter:
Click Parameter Settings > Add Parameters > JSON Parameter link on the left pane. The Add JSON Parameter window is displayed.
Following are the properties of JSON parameter:
- Parameter name: This is the name of JSON variable being defined. It’s a mandatory field. This name must be unique among all parameters in the service. It must start with an alphabet and after alphabet, user can use number and underscore also. Maximum length should be of 64 characters.
- JSON Node Path: Specify the full path of the node which value user needs to fetch. For example, in below JSON, user needs to get the value of node email then JSON Node Path should be “root.email”.
Note: JSON path should start with “root.”.
Request of JSON :- { "expand" : "attributes", "link" : { "rel" : "self", "href" : "http://localhost:8095/crowd/rest/usermanagement/1/user?username=my_username" }, "name" : "my_username", "first-name" : "My", "last-name" : "Username", "display-name" : "My Username", "email" : "user@example.test", "password" : { "link" : { "rel" : "edit", "href" : "http://localhost:8095/crowd/rest/usermanagement/1/user/password?username=my_username" } }, "active" : true, "attributes" : { "link" : { "rel" : "self", "href" : "http://localhost:8095/crowd/rest/usermanagement/1/user/attribute?username=my_username" }, "attributes" : [] } }
- Occurrence Count: It is required if multiple occurrence found of specified node. User has three options for this.
- Index: By selecting this user can define which index of occurrence need to pick.
- All: If user selects this option then system takes all occurrence of the specified node.
- Any: It takes randomly any one occurrence out of all.
- Conversion: This option is used to encode search pattern. It has three options.
- None: In this option, no encoding is applied.
- HTMLToURL: It converts HTML-encoded data to a URL-encoded data.
- HTMLToText: It converts HTML-encoded data to plain text format.
- TextToUrl: It converts TEXT-encoded data to URL format.
- UrlToText: It converts URL-encoded data to plain text format.
- UrlToHtml: It converts URL-encoded data to HTML text format.
- TextToHtml: It converts Text data to HTML text format.
- TextToBase64: It converts Text data to Base64 format.
- Base64ToText: It converts Base64 data to Text format.
- Encoding Options: This field is used to encode special characters.
System Data Source
System data source is used to select one or more data sources to be used in service.
Steps to select data source
Go to Parameters Settings menu > System Parameters > System Data Source link on the left pane. The System Data Source window is displayed containing details, such as dataset name, key parameter, and parameter name. To add a data source click the Add button. The Indexed Data Source window is displayed.
User needs to provide the following details in this section:
- Dataset Name: It should start with a character, next user can use Numbers, and underscore is also allowed. Max length of dataset name should be of 64 characters.
- Key Parameter: It should start with a character, next user can use Numbers, and underscore is also allowed. Max length of key parameter should be of 64 characters.
- Parameter Name: It should start with a character, next user can use Numbers, and underscore is also allowed. Max length of parameter name should be of 64 characters. Multiple parameter names can be provided at the same time, separated by a comma.
- File Name: Its name can be started with number, characters and no limit of max chars to be used for Data file name.
- File Content: Contents can be any combination of characters, numbers, special characters are also allowed. These contents can be loaded from an existing file from the server by specifying Dataset File name and clicking on View. User can also enter data in this field and upload it using Upload button.
- Default Value(s): If anything not found for that parameter then it is parameterized with default value.
- Header Line: In some situations, consider first few lines as headers. System does not consider these lines as data lines while picking data from file. By default, header line is 0.
- First Data Line: In some situations, user might want to start reading data from a particular line number. So, user can use this field to indicate which line it should consider as first Data Line. By default, first Data Line is 1.
- Column Delimiter: This field specifies which character in data file should be considered as column separator. By default, column delimiter is ‘,’. User can use special symbols as column delimiter.
- Default Value: If no value matches in file regarding the index value comes in request then default value serves for index parameter.
- Fetch Parameters From Header: It is to get the parameter names from header line of index dataset contents by splitting it by Column Delimiter. Header line is defined in text box by user.
Example: If header line is Name, AccountNo, CreditCardNo, Balance and column delimiter is “,” then parameters names is Name, AccountNo, CreditCardNo and Balance.
- Parameter value: In this field, multiple parameter values can be provided. e.g. (Fn=<value> or<filename>). Where n specifies the index number to refer the parameter name, default value for parameter values is value.
- Persistence Mode: It specifies the operations on data on the occurrence of a change. User can have the following options:
- Do not persist data on any change
- Persist data source on every change
- Persist data source when controller stopped
Example: If indexed dataset contents are
001/home/NetOcean/user1,LA
002/home/NetOcean/user2,CA
003/home/NetOcean/user3,NY
In parameter value, user provides F1=file, F2=value
it means first parameter value comes from file path which is specified in content and second parameter value is itself. (LA/CA/NY)
System Defined Parameters
This section displays some system defined parameters. These parameters are defined by the system, user can only view these parameters. To view system defined parameters, go to Parameter Settings > System Parameters > System Defined Parameter.