%XML.DataSet
class %XML.DataSet extends %Library.ResultSet, %CSP.Page, %XML.Adaptor
%XML.DataSet extends the %ResultSet class to be SOAP enabled in order to act as the return value of a WebService method. The %XML.DataSet returns the result set as a .NET DataSet. The %XML.DataSet only needs to be instantiated using %New() and then returned as the result of a WebService. The Execute method should not be called. The values of the result set will automatically be retrieved by the WebService mechanism and formatted in XML as a .NET DataSet. If arguments must be passed to the query for its proper execution, then the SetArgs() method may be used. The query for the DataSet may be specified either at runtime or at compile time as parameters of a subclass of %XML.DataSet. If the query is specified at runtime, then a .NET untyped DataSet is returned by the SOAP support. If the query is specified by a compile time parameter, then a .NET typed DataSet is returned by the SOAP support.If you use this class as the value returned by a web method, note that this class is designed to work only with SoapBindingStyle=document and SoapBodyUse=literal, so be sure to set those keywords.
Untyped DataSet
You can return a %XML.DataSet object as an untyped DataSet from a WebService as follows:
ClassMethod GetByName(prefix As %String) As %XML.DataSet [ WebMethod ] { // Return the results of the Person class' ByName query. Set result=##class(%XML.DataSet).%New("Sample.Person:ByName") Do result.SetArgs(prefix) Quit result }
Note you can bind a %XML.DataSet object to a query by either
a) setting the ClassName and QueryName
properties or b) passing a string containing the class name and query name (separated
by a :) to the
Dynamic SQL
You can use the %XML.DataSet class to execute dynamic SQL queries
using the system-provided
ClassMethod GetBySalary(salary As %Integer) As %XML.DataSet [ WebMethod ] { Set result=##class(%XML.DataSet).%New() Do result.Prepare("SELECT ID, Name, Salary FROM Employee WHERE Salary > ?") Do result.SetArgs(salary) Quit result }
Typed DataSet
To return a typed DataSet, create a subclass of %XML.DataSet with the NAMESPACE, CLASS and QUERY parameters specified. Assume that the subclass is called MyTypedDataSet, then the following code returns a typed DataSet:
ClassMethod GetByName(prefix As %String) As MyTypedDataSet [ WebMethod ] { // Return the results of the Person class' ByName query. Set result=##class(MyTypedDataSet).%New() Do result.SetArgs(prefix) Quit result }
Property Inventory
Method Inventory
- Close()
- GetColumnCount()
- GetColumnHeader()
- GetColumnName()
- GetColumnType()
- GetObject()
- Next()
- ResetXML()
- RunPropertyMethod()
- SetArgs()
- WriteSchema()
- WriteXML()
- XMLDTD()
- XMLSchema()
Parameters
Properties
Methods
Inherited Members
Inherited Properties
- %Message
- %Metadata
- %PrivateTables
- %ROWCOUNT
- %ROWID
- %ResultColumnCount
- %SQLCODE
- ClassName
- Data
- QueryName
- RuntimeMode
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %CloseCursor()
- %ConstructClone()
- %CreateSnapshot()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %Display()
- %DisplayFormatted()
- %Execute()
- %Extends()
- %Get()
- %GetData()
- %GetMetadata()
- %GetParameter()
- %IsA()
- %IsModified()
- %MetadataGet()
- %New()
- %Next()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %Prepare()
- %PrepareMetaData()
- %Print()
- %RemoveFromSaveSet()
- %ResultColumnCountGet()
- %SendDelimitedRows()
- %SendODBC()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- ClassNameSet()
- ContainsId()
- ConvertParameter()
- Decrypt()
- Encrypt()
- EscapeHTML()
- EscapeURL()
- Execute()
- Get()
- GetColumnExtInfo()
- GetData()
- GetDataByName()
- GetExtent()
- GetODBCInfo()
- GetParamCount()
- GetParamName()
- GetStatementType()
- HyperEventCall()
- HyperEventHead()
- Include()
- InsertHiddenField()
- InsertHiddenFields()
- IsPrivate()
- Link()
- OnHTTPHeader()
- OnPageError()
- OnPostHTTP()
- OnPostHyperEvent()
- OnPreHTTP()
- OnPreHyperEvent()
- Page()
- Prepare()
- QueryIsValid()
- QuoteJS()
- RewriteURL()
- RunQuery()
- RuntimeModeGet()
- RuntimeModeSet()
- SetIdInfo()
- ShowError()
- StartTimer()
- StopTimer()
- Test()
- ThrowError()
- UnescapeHTML()
- UnescapeURL()
- XMLExport()
- XMLExportToStream()
- XMLExportToString()
- XMLNew()