Custom Webservice in Name Import
Purpose
It is possible to extend the name to structure conversion, for instance to support corporate IDs such as ABC0001234, or to make use of common name dictionaries in addition to the default one. By creating a webservice to do so, an organization can allow all its members to make use of the extended conversions.
Configuration
To start making use of a webservice, you need to know the URL of the service, which can be provided to you by your organization. In MarvinSketch or MarvinView, open the Edit/Preferences dialog from the menu bar, chose the Save/Load tab, then enter the URL in the "Name import service URL" field.
When using the applet, the author of the page must configure the namingWebServiceURL parameter, as documented in the applet configuration page.
It is sometimes desirable to configure a custom webservice without manually using MarvinSketch, for instance for automated installation or for a server running JChem Webservices. In such case, the configuration can be done by including a line of the form nameIOServiceURL = [URL] in the file marvin.properties inside the
The ChemAxon configuration folder is a location on disk where configuration is stored for various ChemAxon products.
The location of this folder depends on the operating system used:
-
Windows Vista or above: C:\Users\USERNAME\chemaxon
-
Windows XP: C:\Documents and Settings\USERNAME\chemaxon
-
Linux: /home/USERNAME/.chemaxon
-
OS X: /Users/USERNAME/.chemaxon
.
For instance:
nameIOServiceURL = http://company.com/ws/n2s?input=
It is also possible to configure the webservice by setting the Java system property chemaxon.naming.n2s.webservice. In custom applications, this can be done by setting that property on the java command line, or using the System.setProperty method in custom code before starting to use the ChemAxon API.
Writing a webservice
By default, the request URL is constructed by appending the input name to the configured URL. The URL could for instance be http://company.com/ws/n2s?input= or https://company.com/ws/n2s/.
If the name should be in the middle of the URL instead of the end, this can be done by using the special marker [NAME] at the desired location of the URL. For instance, if the URL is configured to https://company.com/ws/n2s/[NAME]/option, then when querying the name "cxn123" the URL used will be https://company.com/ws/n2s/cxn123/option.
The webservice can respond to the request with a plain text response containing the structure in any format recognized by marvin, for instance SMILES, InChI, MOL, SD file or mrv. It should respond with a 404 HTTP error if the input is not recognized as a known structure.