<%@ LANGUAGE=VBScript ENABLESESSIONSTATE=True %> <% Option Explicit Rem ----------------------------------------------------------------------------------------- Rem - ************************************** IMPORTANT ************************************** Rem - Rem - If you are having problems getting this or other Web Services to work, the most likely Rem - cause is security settings. This Web Service runs in the security context of IIS - in Rem - other words, it does not have many rights. Make sure file permissions on this ASP file, Rem - XSpellChecker.dll, aspell-15.dll, pspell-15.dll and MSXML2.dll are set to Everyone. Rem - Rem - ************************************** IMPORTANT ************************************** Rem ----------------------------------------------------------------------------------------- Dim strCustomDictionary 'Path to a file containing the custom dictionary. Dim boolSpellCheckerAddToCustomDictionaryEnabled 'Enable the ability to add words to custom dictionary. Dim strLogFile 'Log file for errors or debug information. Can be a template like "%Y-%m-%d.log" where %Y is 4 digit year, %m is 2 digit month and %d is 2 digit day. This will produce a log file like "2003-12-29.log". Dim strConfigFile 'Path to a dictionary configuration file. Dim lngSuggestionCount 'Max number of suggestions per mispelled word. Set to -1 for unlimited. Dim boolDebug 'Used to turn debuging on or off. This is a boolean value. Dim strAuthorizationCode 'An authorization code used to restrict access to this Web Service. You get this code from your account on the xstandard.com Web site. Rem ----------------------------------------------------------------------------------------- Rem - ************************* OPTIONAL - CHANGE THESE SETTINGS **************************** Rem ----------------------------------------------------------------------------------------- If Len(Request.ServerVariables("HTTP_X_SPELL_CHECKER_LANG").Item) > 0 Then strCustomDictionary = Server.MapPath("custom." & Request.ServerVariables("HTTP_X_SPELL_CHECKER_LANG").Item & ".txt") ' Or hardcode the path like "C:\custom.txt" Else strCustomDictionary = Server.MapPath("\files") & "\" & Session("OfficePath") & "\" & Session("USER_ID") & "\custom.txt") ' Or hardcode the path like "C:\custom.txt" End If boolSpellCheckerAddToCustomDictionaryEnabled = True strLogFile = Server.MapPath("\files") & "\" & Session("OfficePath") & "\" & Session("USER_ID") & "\x%Y-%m-%d.log" ' Or hardcode the path like "C:\XStandard.log" strConfigFile = Server.MapPath("spellchecker.config") lngSuggestionCount = 10 boolDebug = False strAuthorizationCode = "" Rem ----------------------------------------------------------------------------------------- Rem - ************************* OPTIONAL - CHANGE THESE SETTINGS **************************** Rem ----------------------------------------------------------------------------------------- Rem ----------------------------------------------------------------------------------------- Rem - Purpose: Spell checker Web Service Rem - Rem - Input: SOAP Rem - Output: SOAP Rem - Rem - Note: This script requires the following dll's to be registered on the server: Rem - - XSpellChecker.dll - use for processing the SOAP message Rem - - aspell-15.dll - used for accessing the spell checker Rem - - pspell-15.dll - used for accessing the spell checker Rem - - MSXML4.dll - XML parser Rem - Rem - Rem - Copyright (c) 2003 Belus Technology Inc. All rights reserved. Rem ----------------------------------------------------------------------------------------- Rem ----------------------------------------------------------------------------------------- Rem - Declare Rem ----------------------------------------------------------------------------------------- Dim objSOAPServer Rem ----------------------------------------------------------------------------------------- Rem - Initialize Rem ----------------------------------------------------------------------------------------- Set objSOAPServer = Server.CreateObject("XSpellChecker.SOAPServer") objSOAPServer.LogFile = strLogFile objSOAPServer.SpellCheckerName = "General Spell Checker" objSOAPServer.SpellCheckerAddToCustomDictionaryEnabled = boolSpellCheckerAddToCustomDictionaryEnabled objSOAPServer.Debug = boolDebug objSOAPServer.CustomDictionary = strCustomDictionary objSOAPServer.ConfigFile = strConfigFile objSOAPServer.SuggestionCount = lngSuggestionCount Rem ----------------------------------------------------------------------------------------- Rem - Process SOAP message Rem ----------------------------------------------------------------------------------------- If Request.ServerVariables("REQUEST_METHOD").Item = "POST" Then 'Check authorization code If Len(strAuthorizationCode) > 0 Then If Len(Request.ServerVariables("HTTP_X_LICENSE_ID").Item) = 0 Then objSOAPServer.RaiseError "No authorization code set. Please contact your System Administrator." Else If Request.ServerVariables("HTTP_X_LICENSE_ID").Item <> strAuthorizationCode Then objSOAPServer.RaiseError "Invalid authorization code. Please contact your System Administrator." End If End If End If 'Process Request objSOAPServer.ProcessRequest Request If Len(CStr(Session("WEBGODLogin"))) = 0 Then If objSOAPServer.GetProperty("lang") = "it" Then objSOAPServer.RaiseError "Non possiedi le autorizzazioni necessarie per utilizzare il servizio." Else objSOAPServer.RaiseError "Please login to use this service." End If End If 'Process Response objSOAPServer.ProcessResponse Response Else Response.ContentType = "text/plain" Response.AddHeader "content-disposition", "inline; filename=xstandard.txt" If objSOAPServer.Test() Then Response.Write "Status: Ready" Else Response.Write "Status: Error - " & objSOAPServer.ErrorMessage End If End If Rem ----------------------------------------------------------------------------------------- Rem - Clean up Rem ----------------------------------------------------------------------------------------- Set objSOAPServer = Nothing %>