• 5401阅读
  • 1回复

关于QT  webservice 返回结果的问题 [复制链接]

上一主题 下一主题
离线mqw496
 
只看楼主 倒序阅读 楼主  发表于: 2010-01-27
请问大家 ,从webservice 返回来的数据如下 :

怎样获取里面的 xml数据信息。。


PHTTP/1.1 200 O
KDate: Tue, 26 Jan 2010 08:28:17 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 2977
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <getDomesticAirlinesTimeResponse xmlns="http://WebXml.com.cn/">
        <getDomesticAirlinesTimeResult>
             <xs:schema id="Airlines" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
                <xs:element name="Airlines" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
                   <xs:complexType>
                      <xs:choice minOccurs="0" maxOccurs="unbounded">
                         <xs:element name="AirlinesTime">
                           <xs:complexType>
                             <xs:sequence>
                                <xs:element name="Company" type="xs:string" minOccurs="0" />
                                <xs:element name="AirlineCode" type="xs:string" minOccurs="0" />
                                <xs:element name="StartDrome" type="xs:string" minOccurs="0" />
                                <xs:element name="ArriveDrome" type="xs:string" minOccurs="0" />
                                <xs:element name="StartTime" type="xs:string" minOccurs="0" />
                                <xs:element name="ArriveTime" type="xs:string" minOccurs="0" />
                                <xs:element name="Mode" type="xs:string" minOccurs="0" />
                                <xs:element name="AirlineStop" type="xs:string" minOccurs="0" />
                                <xs:element name="Week" type="xs:string" minOccurs="0" />
                             </xs:sequence>
                           </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">
                 <Airlines xmlns="">
                     <AirlinesTime diffgr:id="AirlinesTime1" msdata:rowOrder="0">
                        <Company>厦门航空有限公司</Company>
                        <AirlineCode>MF8217</AirlineCode>
                        <StartDrome>天河机场</StartDrome>
                        <ArriveDrome>咸阳机场</ArriveDrome>
                        <StartTime>09:35</StartTime>
                        <ArriveTime>10:50</ArriveTime>
                        <Mode>737</Mode>
                        <AirlineStop>0</AirlineStop>
                        <Week>123456日</Week>
                     </AirlinesTime>
                     <AirlinesTime diffgr:id="AirlinesTime2" msdata:rowOrder="1">
                        <Company>中国东方航空公司</Company>
                        <AirlineCode>MU2397</AirlineCode>
                        <StartDrome>天河机场</StartDrome>
                        <ArriveDrome>咸阳机场</ArriveDrome>
                        <StartTime>13:10</StartTime>
                        <ArriveTime>14:35</ArriveTime>
                        <Mode>738</Mode>
                        <AirlineStop>0</AirlineStop>
                        <Week>123456日</Week>
                     </AirlinesTime>
                </Airlines>
            </diffgr:diffgram>
        </getDomesticAirlinesTimeResult>
    </getDomesticAirlinesTimeResponse>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 400 Bad Request
Content-Type: text/html
Date: Tue, 26 Jan 2010 08:28:16 GMT
Connection: close
Content-Length: 35
<h1>Bad Request (Invalid Verb)</h1>
离线午小夜

只看该作者 1楼 发表于: 2010-01-27
have a look at QXmlStreamReader class.
[操作系统版本]  Windows XP;Linux Ubuntu;Linux Fedora;
[Qt SDK版本]    4.7.0
[SDK 发布日期]  2010.05
[IDE(集成开发环境)] QtCreator
个人网页:http://hi.baidu.com/午小夜
學歷:Royal Jalidon
快速回复
限100 字节
 
上一个 下一个