ASP.NET XML Web Service返回错误的数据

时间:2012-09-19 10:27:39

标签: asp.net xml iis service web


我有一个在IIS 6上托管的XML Web服务,由asp.net framework 4编写

有时它返回错误的数据,我应该重新启动iis来解决这个问题

例如:

它应该返回这样的东西(正确):

 <?xml version="1.0" encoding="utf-8" ?> 
- <DataTable xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Food" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Food">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="ID" type="xs:int" minOccurs="0" /> 
  <xs:element name="STATUS" type="xs:int" minOccurs="0" /> 
  <xs:element name="CODE" type="xs:int" minOccurs="0" /> 
  <xs:element name="TITLE" type="xs:string" minOccurs="0" /> 
  <xs:element name="FULL_NAME" type="xs:string" minOccurs="0" /> 
  <xs:element name="TYPE" type="xs:int" minOccurs="0" /> 
  <xs:element name="UNIT" type="xs:int" minOccurs="0" /> 
  <xs:element name="PRICE" type="xs:int" minOccurs="0" /> 
  <xs:element name="BREAKFAST" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="LUNCH" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="DINNER" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="MINIBAR" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="TERIA" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="DESSERT" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="MAIN_FOOD" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="DESSERT1" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="DRINK" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="MISC" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="PRE_FOOD" type="xs:boolean" minOccurs="0" /> 
  <xs:element name="UNIT_NAME" type="xs:string" minOccurs="0" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>

但有时会返回此(错误答案):

    <?xml version="1.0" encoding="utf-8" ?> 
- <DataTable xmlns="http://tempuri.org/">
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Food" msdata:UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Food">
  <xs:complexType /> 
  </xs:element>
  </xs:choice>
  </xs:complexType>
  </xs:element>
  </xs:schema>
  <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" /> 
  </DataTable>

我该怎么办?

0 个答案:

没有答案