Using a custom webservice to extend name to structure
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.
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 the structure in any format recognized by marvin,
for instance smiles, InChI, SD file or mrv. It should respond with a 404 HTTP error if the input is
not recognized as a known structure.