Web Service接口数据交换标准--返回值

本节对返回值标准进行了详细说明,包括返回值相关类型和返回值数据标准。

返回值相关类:

TXmlReturn

     public class TXmlReturn

     {

         private int frno;

         private string frmsg;

         private ArrayList fdatalist;

         private TStrList fhead;

         private string fxml;

         private TStrList fcolumnlist;

         private DataTable fdatatable;

 

         ///

         /// 构造函数

         ///

         /// <param name="rxml">需要解析的已编码数据param>

         public TXmlReturn( string rxml ){}

 

         ///

         /// 将已编码数据进行解码

         ///

         private void decodeReturn(){}}

 

         ///

         /// 填充列列表

         ///

         private void fillFColumnList(){}

 

         ///

         /// 填充数据列表

         ///

         private void fillFDataList(){}

 

         ///

         /// 将数据还原为DataTable类型

         ///

         private void decodeToDataTable(){}

 

         ///

         /// 根据数据类型字符串返回系统类型

         ///

         /// <param name="typestr">param>

         ///

         private System.Type getTypeByTypeString(string typestr){}

 

         ///

         /// DataTable类型数据返回值

         ///

         public DataTable rdatatable{get;}

 

         ///

         /// 返回状态码

         ///

         public int rno{get;}

 

         ///

         /// 返回的状态信息

         ///

         public string rmsg{get;}

 

         ///

         /// 返回的数据头部,如果为DataTable序列化数据,则无此项

         ///

         public TStrList rhead{get;}

 

         ///

         /// 数据列表,每一项为TStrList类型

         ///

         public ArrayList rdata{get;}

 

         ///

         /// 列列表

         ///

         public TStrList rcolumnlist{get;}

 

         ///

         /// 数据记录条数

         ///

         public int DataRowCount{get;}

 

         ///

         /// 数据列数

         ///

         public int DataColumnCount{get;}

     }

该类对TReturnManager返回的数据进行解析,将字符串型数据还原为包含返回状态码,返回状态信息,返回状态数据的原始数据。

返回值标准

返回数据形式由TReturnManagerXML_TYPE_SCHEMA常量决定,标准如下:

XML_TYPE_SCHEMA = trueDataTable序列化的传输方式

§         使用标准XML格式

§         分为状态、dataSchemadata三个节点

§         状态为必须具备的节点,其他两个节点可选

 

示例为:

xml version="1.0" encoding="UTF-8" ?>

<return rno="0" rmsg="成功">

     <dataSchema>

         <xs:schema id="NewDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

              <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="zh-CN">

                   <xs:complexType>

                       <xs:choice maxOccurs="unbounded">

                            <xs:element name="Table1">

                                 <xs:complexType>

                                     <xs:sequence>

                                          <xs:element name="id" type="xs:string" minOccurs="0" />

                                          <xs:element name="password" type="xs:string" minOccurs="0" />

                                          <xs:element name="sex" type="xs:string" minOccurs="0" />

                                          <xs:element name="name" type="xs:string" minOccurs="0" />

                                     xs:sequence>

                                 xs:complexType>

                            xs:element>

                       xs:choice>

                   xs:complexType>

              xs:element>

         xs:schema>

     dataSchema>

     <data>

         <NewDataSet>

              <Table1>

                   <id>123456id>

                   <passwo

你可能感兴趣的:(Web Service接口数据交换标准--返回值)