Creating & Registering Your Web Service


The web service is configured in Microsoft's Internet Information Services Manager.
In order to make your data accessible to the internet, a web service must be created. Start by downloading this .zip file. Copy the folder named "Web App" to your "C:\inetpub\wwwroot\" directory. Rename the "Web App" folder to something consistent with the data your are publishing (i.e. "CharlesRiver"). Open the Internet Information Services (IIS) Manager. Expand the Sites element on the left, right click "Application Pools" and select "Add Application Pool". Add a name for the application pool and make sure that ".NET Framework v2.0.50727" is selected under .NET Framework Version and that the Managed pipeline mode is set to "Classic". Check "Start application pool immediately".

Note: If you are using other HydroServer applications (i.e. HydroServer Website, Time Series Analyst) you will require a separate application pool that uses the "Integrated" Managed Pipeline.
Also, note that if you are creating multiple instances of the WaterOneFlow web services on your server because you want to publish multiple ODM databases, you may reuse 1 Application Pool. Click OK to close the Add Application window.

Now, we will add the WaterOneFlow Web Services in the Default IIS Website. Expand the Sites folder on the left side of IIS, right click on "Default Website", and select "Add Application". In the "Add Application" window create an Alias that describes your service as the alias will become a part of the URL. Click the Select button and select the Application pool that you just created. Click OK to return to the "Add Application" window and click the "..." button next to the Physical Path form. Navigate to the directory where your web service application files are (i.e. C:\inetpub\wwwroot\).

The next step is to connect your application to your database. Select your application in the Connections window on the left of the IIS Manager and double click the "Connection Strings" icon under the "ASP.NET" group. Double click the "ODDB" line. In the form that appears, enter the location of your server and name of your database. Then, click the radio button next to "Specify Credentials", click "Set..."  and enter the credentials for your read only login. Click OK to close the "Specify Credentials" window and again to close the "Edit Connection String" window.

The last step we have in IIS is to define a few application settings. Select your application in the tree view of IIS (on the left side of the IIS Manager) and double click the "Application Settings" icon under "ASP.NET".
There are a number of fields that should be populated.

  • Contact Email: This is the email for a person that is in charge of the web service.
  • defaultSpatialReferenceSystemSRSID: This is the ID for the Spatial Reference System used by your ODM database for the latitude and longitude coordinates of monitoring sites. The default value of "4326" specifies that your latitude and longitude coordinates have a datum of WGS84. Refer to the Sites and SpatialReferences tables in your ODM database for help in setting this value. Other commonly used values include "4267" for NAD27 and "4269" for NAD83.
  • GetValuesName: This text will be dispalyed at the top of the web page that opens your users naivagte to the URL of your web service. You should remove the part that says "[YOUR DATASET]" and replace it with something that describes your ODM database. Example: "Little Bear River Observations". 
  • Network: This is a short, unique name for the "network" of monitoring sites that is stored in your ODM database. It should be a single word and should not include any special characters. Example: "LittleBearRiver". 
  • serviceDescriptionPage: This is the name of an HTML page that you can create for describing your data. The default value for this setting is "BasicData.htm". You can create an HTML page called "BasicaData.htm" that describes the data stred on your ODM database and place it in the main web service application directory. When you do this, the WaterOneFlow web service 
  • vocabulary: This is a short name for the "vocabulary" that is being used to describe the variables in your observation network. It should be a single word and not include any special characters. The vocabulary is a short identifier for the vocabulary used to describe the variables in your observations network. For example, if I have a variable called “Texonium” with a unique code of “TXN”, I’d like to know if “TXN” is a term that the EPA uses, or perhaps the USGS uses, or perhaps I just made it up and it’s my own vocabulary. The Vocabulary doesn’t have to be the same as the Network. For example, suppose I like the way the USGS describes variables within their NWIS system, and I’ve used the same variable codes in my own ODM database. My Network prefix might be “MyNetwork,” but my Vocabulary prefix could be “NWIS,” indicating that I have adopted the NWIS vocabulary. The syntax for using Vocabulary when calling a WaterOneFlow web service is “Vocabulary:VariableCode”, where VariableCode is the unique identifier for the variable of interest, and Vocabulary refers to the Vocabulary prefix identifying the system to which that given VariableCode belongs. The web service methods affected by Vocabulary are GetVariableInfo/GetVariableInfoObject, and GetValues/GetValuesObject.
Registering Your Web Service with HIS Central

The final step in publishing a data source in the CUAHSI HIS Catalog is to register your newly created web service with the central metadata catalog - HIS Central. To do this, visit the HIS Central website and click Register in the upper right of the page if you do not already have a registered account, or click Login if you have already registered.
Once logged in, you will see the option to "Add Data Service" on the navigation bar.  Click this to go to the registration page. You will be prompted for three things:
  • Service Title: This will appear atop the webpage associated with your service.
  • Network Name: This is a unique code associated with your service. The Network Name used when configuring your web service is appropriate. This value is unique across the system.
  • Service WSDL: The full web URL to your web service WSDL. This value is unique across the system.  
Congratulations! You have now registered your data with the CUAHSI HIS catalog. We just have a couple more steps to ensure that your data is discoverable.

The final step to ensuring your data is discoverable is to tag your variables to a hierarchy of ontological concepts. 
The final step in registering your data service is to tag the variables in your database to concepts in the CUAHSI HIS Ontology. The Java application for tagging variables is currently functional in Internet Explorer; please be sure to complete this step in IE. This ensures your data is discoverable when searches are performed in clients like HydroDesktop. Visit your the description page for your service, which  is accessible by clicking "My Data Services" and clicking "Details" for the respective service. Click the Edit Details button to modify Service Details such as Contact Information, Abstract, Description, and Citation. On the bottom left-hand side of this page you will see a button for Tag Variables. Click this to launch HydroTagger- the java based application for tagging your variables to the CUAHSI HIS Ontology.
When the application starts, you will see the list of variables in your database on the left towards the bottom of the web page. As you tag the variables, they will move to the right side of "variable", "mapping", and "search" forms.
To tag variables:
  1. Click Select to activitate a specific variable; you should see your variable appear in the "Variable" form.
  2. Either navigate to the desired concept through the Star Tree or search for the concept with the "Search" form. Note: A successful search will highlight the concept and its parent concepts in the Star Tree.
  3. Double click the concept in the Star Tree; the concept should be added to the "Mapping" field.
  4. Click "Map!"
Repeat this process as necessary depending on the number of variables in your database. When finished, you can either press the back button your browser to return to your Service Details page or close your browser.

Great job! If you made it this far, you have successfully registered your web service with the CUAHSI HIS Central Catalog and ensured your data is discoverable in HydroDesktop by tagging your variables to the ontology. Currently, the Central Catalog metadata harvester crawls every Saturday. After your database has been harvested, you will be able to find your data while searching in HydroDesktop.