Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:2500_config_apps:2000_add_edit_services [2026/07/07 04:47] aware_admindocs:2500_config_apps:2000_add_edit_services [2026/07/07 07:32] (current) aware_admin
Line 23: Line 23:
  
 <callout type="warning" icon="true" title="warning">Both REST-ful and SOAP services only work in production mode and are available as soon as the business space version is published</callout> <callout type="warning" icon="true" title="warning">Both REST-ful and SOAP services only work in production mode and are available as soon as the business space version is published</callout>
 +
 +===== Service Will be Protected by OAuth2.0 Protocol =====
 +
 +Tick this checkbox if you want to protect a service. If at least one service should be protected, you will need to deploy a special web application. This web application will manage scopes, clients, will issue access tokens and refresh tokens. See the [[setting_up_oauth_protection|OAuth Protection section]].
  
 ===== Service Reply ===== ===== Service Reply =====
Line 28: Line 32:
 Service reply defines a business object or an array of business objects sent by a service provider as a reply to the service request.  If you select the “Service will return object” radio button you will need to select the object that will be returned from the list of all objects. Your implementing process must populate the context with the instance(s) of the business object being returned. Tick the “Return multiple instances” checkbox to return an array of instances. Again your implementing process must populate the context with instances of the object to be returned. Service reply defines a business object or an array of business objects sent by a service provider as a reply to the service request.  If you select the “Service will return object” radio button you will need to select the object that will be returned from the list of all objects. Your implementing process must populate the context with the instance(s) of the business object being returned. Tick the “Return multiple instances” checkbox to return an array of instances. Again your implementing process must populate the context with instances of the object to be returned.
  
-===== Service will be protected by OAuth2.0 protocol =====+===== Exposed Objects and Attributes =====
  
-Tick this checkbox if you want to protect a service. If at least one service should be protectedyou will need to deploy a special web application. This web application will manage scopes, clients, will issue access tokens and refresh tokens. To deploy this web application: +An object returned by the service, as well as the object specified as input of the implementing process, may have attributes that the callers of the service do not need(want) to see. You can specify this by ticking only those objects and attributes that are relevant to the caller. All other attributes and objects will not be encoded in the service request and service reply.
-  - Go to the Edit menu of the Configuration Tool  +
-  - Select the entry with the name "SERVICE PROTECTION" +
-Note that thew deployment of the dynamic feature should only be done once+
  
-Your service documentation needs to convey to the callers of the service that before calling the service, they need to do the following: +===== Service Endpoints =====
-  - Obtain an access token by cand  +
-  - include the access token in the Authorization Bearer HTTP header, for example (<code>Authorization: Bearer <access token></code>).  +
-  - The name of the business space must be in the HTTP header called AW-DOMAIN, for example <code>AW-DOMAIN:CRM</code> +
-  - The name of the service to call must be in the header called AW-SERVICE for a REST-ful service (for example, <code>AW-SERVICE: AddCustomer</code>) and AW-SERVICE-SOAP for a SOAP service - for example <code>AW-SERVICE-SOAP: AddCustomer</code>.+
  
-The following properties can be specified in the Element Properties window:+Service endpoint is a URL that the caller should call for a particular service. These endpoints depend on whether this is a REST-ful or SOAP service and whether the service is protected. The following URL's should be used: 
 +  
 +For unprotected services: 
 +  - for any REST-ful unprotected service: <code>http(s)://YourServerName:yourPort/WebApplication/REST/BusinessSpace/ServiceName (where WebApplication is the name of your web application or a default value (AwareIM).</code> 
 +  - for the SOAP WSDL file: <code>http(s)://YourServer:YourPort/WebApplication/SOAP/BusinessSoace?WSDL</code> 
 +  - for SOAP service call: <code>http(s)://YourServer:YourPort/WebApplication/SOAP/BusinessSpace/ServiceName</code>
  
-===== Name =====+For protected services: 
 +  - for any Rest-ful service: <code>http(s)://YourServer:YourPort/CXF/services/serviceCall/api</code> 
 +  - for the SOAP WSDL file: <code>http(s)://YourServer:YourPort/WebApplication/SOAPP/BusinessSpace?WSDL</code> 
 +  - for SOAP Service call: <code>http(s)://YourServer:YourPort/CXF/services/serviceCall/api</code>
  
-Specify the name of the service uniquely identifying it within the business space version. The following restrictions apply:+<callout type="warning" icon="true" title="warning">Note that for protected services the name of the business space and the name of the service to call are specified in the special HTTP header see [[setting_up_oauth_protection|OAuth Protection]] </callout>
  
-  - The name of the service must be unique among the names of other services defined in the business space version.  +==== Reply Format ====
-  - The name must start with a character or underscore symbol; all other symbols must be characters (including underscore symbol) or digits. Space symbols are not allowed. +
- +
  
-===== Description =====+If a REST-ful service returns a reply, it can be either in the XML format (also Default) or in JSON format. The format can also vary depending on the URL used – the extension of the expected format can be specified in the URL itself. Choose the appropriate option here. A reply can also be just a string calculated by the process implementing the service. If that is the case, choose the "Calculated String" radio button.
  
-Specify any text that describes what the services does etc. Providing a description is not mandatory but is highly recommended. Any description if defined is included into the generated documentation for the business space version – see [[docs:2500_config_apps:3100_gen_doc]]+For SOAP services reply format is always XML
  
-===== Log ===== +==== Handing of Undefined Values ====
-If you tick the Save button AwareIM will capture all communication in a log. It will record the name of the service called, time of the communication, URL parameters, HTTP method, HTTP body etc +
-It will also record HTTP headers of the request and response. The log will be captured in the instance of the object that you specify (you also need to define the attributes in this object that will store the log, as well as the attribute storing the name of the service and timestamp (the latter two attributes are required, so that you can sort by time and service. +
-===== REST settings =====+
  
-If you ticked Rest support” checkbox in the editor you will need to provide the following details:+If values of the attributes of the returned object are undefined, you can choose how //**AwareIM**// will encode such values. By default //**AwareIM**// will skip undefined values (Do not encode” option), but you can also encode an empty value or a particular string. You can also specify different encoding options depending on the name of the attribute.
  
-==== Default URL mapping ====+===== Editing service properties in the Property Window =====
  
-Services exposed as REST will be called by other parties using a particular URL. If you choose the default option the default URL the other parties will have to use the default URL. It has the following format:+The following properties can be specified in the Element Properties window:
  
-http://ServerName:port/AwareIM/REST/BusinessSpace/ServiceName?parameters+===== Name =====
  
-for example:+Specify the name of the service uniquely identifying it within the business space version. The following restrictions apply:
  
-[[http://myserver.com:8080/AwareIM/REST/CRM/Service1?param1=value1&param2=value2|]]+  - The name of the service must be unique among the names of other services defined in the business space version 
 +  - The name must start with a character or underscore symbol; all other symbols must be characters (including underscore symbol) or digits. Space symbols are not allowed. 
 +  
 +===== Description =====
  
-==== URL must contain string ====+Specify any text that describes what the services does etc. Providing a description is not mandatory but is highly recommended. Any description if defined is included into the generated documentation for the business space version – see [[docs:2500_config_apps:3100_gen_doc]]. 
  
-If default URL cannot be used you can construct your own URL by choosing this option and providing your own custom stringFor example, if you provide the following string:+===== Service Log Settings ===== 
 +If you click on this property, the Service Log dialog will be displayed. If you tick "Save Communication In" checkbox the system will record the log of the communication. It will capture all communication in a log. It will record the name of the service called, time of the communication, URL parameters, HTTP method, HTTP body etc. It will also record HTTP headers of the request and responseThe log will be captured in the instance of the object that you specify (you also need to define the attributes in this object that will store the log, as well as the attribute storing the name of the service and timestamp (the latter two attributes are required, so that you can sort by time and service.
  
-someName1/someName2+===== Handling of HTTP headers ===== 
 +Values of HTTP headers of each service call can be stored in the object that is specified as the input of the process implementing the service. Enter the mapping between the name of the header and the attribute where the header value will be stored, in the dialog displayed when you edit this property.
  
-the following URL can be used: 
- 
-http://ServerName:port/AwareIM/someName1/someName2?parameters 
- 
-<callout type="primary" icon="true" title="note"> If you choose this option you must also provide a file called rest.props and put it in the AwareIM/CP/eclipse directory of your AwareIM installation. The file must have a string that specifies the name of the business space containing REST-ful services, for example DOMAIN=CRM</callout> 
 ==== Name mapping ==== ==== Name mapping ====
  
 If your REST-ful service is implemented by a process that takes some object as input (should only be one object) then values of attributes of this object have to be provided as parameters in the URL (see example above). The name of the parameters must match the names of the attributes of the object. If this, however, is impossible for whatever reason, then you need to provide a mapping between the names of the parameters (“External Name”) and the name of the corresponding attribute. You should only do it for those parameters that have different names to the names of the attributes.  If your REST-ful service is implemented by a process that takes some object as input (should only be one object) then values of attributes of this object have to be provided as parameters in the URL (see example above). The name of the parameters must match the names of the attributes of the object. If this, however, is impossible for whatever reason, then you need to provide a mapping between the names of the parameters (“External Name”) and the name of the corresponding attribute. You should only do it for those parameters that have different names to the names of the attributes. 
- 
-==== Reply Format ==== 
- 
-If a service returns a reply it can be either in the XML format (also Default) or in JSON format. The format can also vary depending on the URL used – the extension of the expected format can be specified in the URL itself. Choose the appropriate option here. 
- 
-==== REST Handing of Undefined Values ==== 
- 
-This only applies to services exposed as REST-ful services. If values of the attributes of the returned object are undefined, you can choose how //**AwareIM**// will encode such values. By default //**AwareIM**// will skip undefined values (“Do not encode” option), but you can also encode an empty value or a particular string. You can also specify different encoding options depending on the name of the attribute.