The following sections describe security, services, and CORS support.
The Service Base URL, which is set in the Service Hosting tab of the JIA Configuration Screen, defines the URL access to the service of a JIA project. In addition to a base URL, the Service Base URL can contain a namespace and a sessionId. The sessionId is included in the URL if it is used in the Init method of the service.
For example: http://<host:port>/<namespace>/<sessionId>
This section is relevant to the Windows 7 OS. When JIA starts, it hosts a WCF service. When running JIA with elevated privileges (such as administrator credentials), there are generally no security issues. However, when running JIA with regular privileges, the following error might display: Your process does not have access rights to this namespace. To fix this error, run the following command line once as an administrator with your user, proper URL (found in JIA logs) and desired port number: When running this command line, take the following issues into consideration: •The user that runs this command must have administrative privileges. •The communication channel (the URL) can be opened up only to a single user (as in the example above) or to one user group per project.
•If a user already exists (e.g., http://+:Services in the command line above), delete it, using |
Exposed operations are required to allow external communication with JIA. To expose functions, it is necessary to implement the IService interface: Appropriate attributes should be added to the functions, for example:
If exposed operations are meant for WorkSpace, the following attribute should also be added:
It is possible to expose more than one Service Contract, but each one should implement the IService interface. Exposed operations should be marked as virtual methods. This ensures that the underlining code can handle all exceptions thrown while executing the operation, and display these exceptions in the system tray. |
Browser security protocol prevents a web page from making AJAX requests to another domain. This restriction is called the same-origin policy. Cross Origin Resource Sharing (CORS) is a W3C standard that allows a server to relax the same-origin policy. Using CORS, a server can explicitly allow some cross-origin requests while rejecting others. The CORS standard can be used in your JIA project to allow other sites to call your web APIs. To configure service methods to support cross domain calls, in the service.cs file under the interface, add the CorsEnabled tag to each service for which cross domain calls should be supported. For example:
|