Пример #1
0
        /**
         * <summary>Build logininfo object for the web service.</summary>
         * <remarks>Note: this is the LoginInfo class that is used by the web service and not the loginInfo class that is used for modifying the
         * login information when filing the web service through the menu option.</remarks>
         * <returns>Returns an object of the class LoginInfo that will be filed to the XMLService web service.</returns>
         */
        private XMLService.LoginInfo buildLoginInfo()
        {
            var loginInfo = new XMLService.LoginInfo();

            loginInfo.systemCode = systemCode;
            loginInfo.userName   = userName;
            loginInfo.password   = password;

            return(loginInfo);
        }
Пример #2
0
 /**
  * <summary> This method will construct a SOAP message and send it to the web service. </summary>
  * <remarks> This web service does not seem to be enabled. It needs to be enabled before using otherwise,
  * this program will encounter an InvalidOperationException</remarks>
  * <param name="loginInfo">Web service LoginInfo class that contains the logon credentials necessary to file the web service.</param>
  * <param name="sql">The SQL query text to be interpreted by the Cache database.</param>
  * <param name="runtimeMode">This property will set the SQL runtime mode for the query to be executed. There are 3 modes to choose from 0,1,2.
  * 0 for LOGICAL mode also the DEFAULT. 1 for ODBC mode. 2 for DISPLAY mode.</param>
  * <returns>The web service response is returned by this method because this is the call that is made to the web service. This response will contain
  * the sql query results if no errors were encountered otherwise read the message part of the response to determine what error was detected.</returns>
  */
 private XMLService.XMLResponse submitSQL(XMLService.LoginInfo loginInfo, String sql, String runtimeMode)
 {
     try
     {
         var XMLServiceInstance = new XMLService.XMLService();
         return(XMLServiceInstance.XMLResultSet(loginInfo, sql, runtimeMode));
     }
     catch (InvalidOperationException e)
     {
         XMLService.XMLResponse err = new XMLService.XMLResponse();
         err.resultCode    = "-1";
         err.resultMessage = e.Message + newline + "A fatal exception was encountered, this is known to occur when the XMLService web service is not"
                             + " enabled in your system. Contact your Netsmart Representative for further information.";
         return(err);
     }
 }