public new InformationServiceDataReader ExecuteReader(CommandBehavior behavior) { //TODO: Check if the statement contains a RETURN clause string query = statement + " RETURN XML RAW"; var bag = new PropertyBag(); foreach (InformationServiceParameter parameter in parameters) { bag.Add(parameter.ParameterName, parameter.Value); } QueryXmlRequest queryRequest = new QueryXmlRequest(query, bag); Message message = null; using (new SwisSettingsContext { DataProviderTimeout = TimeSpan.FromSeconds(commandTimeout), ApplicationTag = ApplicationTag, AppendErrors = true }) { message = this.connection.Service.Query(queryRequest); } if (message != null) { if (message.IsFault) { CreateFaultException(message); } return(new InformationServiceDataReader(this, message.GetReaderAtBodyContents(), this.DateTimeMode)); } return(null); }
public XmlDictionaryReader GetXmlData(string statement, PropertyBag parameters) { QueryXmlRequest queryRequest = new QueryXmlRequest(statement, parameters); Message message = null; using (new SwisSettingsContext { DataProviderTimeout = TimeSpan.FromSeconds(commandTimeout), ApplicationTag = ApplicationTag }) { message = connection.Service.Query(queryRequest); } if (message != null) { if (message.IsFault) { CreateFaultException(message); } return(message.GetReaderAtBodyContents()); } return(null); }
private Message Query(QueryXmlRequest queryRequest) { return(connection.Service.Query(queryRequest)); }
public new InformationServiceDataReader ExecuteReader(CommandBehavior behavior) { //TODO: Check if the statement contains a RETURN clause string query = statement + " RETURN XML RAW"; var bag = new PropertyBag(); foreach (InformationServiceParameter parameter in Parameters) { bag.Add(parameter.ParameterName, parameter.Value); } QueryXmlRequest queryRequest = new QueryXmlRequest(query, bag); Message message = null; var swisSettingsContext = SwisSettingsContext.Current; if (swisSettingsContext != null) { var originalContextApplicationTag = swisSettingsContext.ApplicationTag; swisSettingsContext.AppendErrors = true; // we always want to add errors // only set its value if the ApplicationTag is not set. // If it is set in SwisSettingsContext, just use it if (string.IsNullOrEmpty(swisSettingsContext.ApplicationTag)) { swisSettingsContext.ApplicationTag = ApplicationTag; } try { // SwisSettingsContext.ApplicationTag is sent in request to SWIS server message = Query(queryRequest); } finally { // make sure we don't change the value by calling this function swisSettingsContext.ApplicationTag = originalContextApplicationTag; } } else { using (new SwisSettingsContext { DataProviderTimeout = TimeSpan.FromSeconds(CommandTimeout), ApplicationTag = ApplicationTag, AppendErrors = true }) { message = Query(queryRequest); } } if (message != null) { if (message.IsFault) { CreateFaultException(message); } return(new InformationServiceDataReader(this, message.GetReaderAtBodyContents(), DateTimeMode)); } return(null); }