喜悦国际村 » XML/HTML/CSS/Js » Asp,php给浏览器返回xml

页: [1]
gunking2005-5-10 08:35 PM
Asp,php给浏览器返回xml

救急     

当CLIENT使用POST请求TEST.ASP或者TEST.PHP时ASP,PHP直接给浏览器返回一个标准的XML的内容

比如下面的回话过程。PHP或者ASP如何实现

客户端发送的请求数据包:
POST /updates_ent/update.phtml HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel,

application/msword, application/x-shockwave-flash, */*
Content-Type: multipart/form-data; boundary=0a603b9e-312b-4657-a4e6-3e531f361f5d
User-Agent: qq
Host: [url]www.test.com[/url]
Content-Length: 933
Connection: Keep-Alive
Pragma: no-cache

--0a603b9e-312b-4657-a4e6-3e531f361f5d
Content-Disposition: form-data; name="XMLFile"; filename="947130ed-cd8b-4a89-809b-3166ca900db0.xml"
Content-Type: text/xml

<?xml version="1.0"?>
<FilesCatalog><MsgVersion>1</MsgVersion><Solutions><Solution><SolutionID>3</SolutionID><Files><File><Type>16</Type><DateTime>

2004-04-16 12:00:00</DateTime><NumPatches>0</NumPatches></File><File><Type>4</Type><DateTime>2004-07-01

00:00:00</DateTime><NumPatches>0</NumPatches></File><File><Type>2</Type><DateTime>2004-11-09

10:08:00</DateTime><NumPatches>0</NumPatches></File><File><Type>8</Type><DateTime>2004-08-16

09:43:09</DateTime><NumPatches>0</NumPatches></File><File><Type>32</Type><DateTime>2004-07-23

08:44:00</DateTime><NumPatches>0</NumPatches></File><File><Type>1</Type><DateTime>2004-11-21

08:14:19</DateTime><NumPatches>10</NumPatches></File></Files></Solution></Solutions></FilesCatalog>
--0a603b9e-312b-4657-a4e6-3e531f361f5d--

服务器返回的数据包:
HTTP/1.1 200 OK
Date: Mon, 14 Mar 2005 00:04:51 GMT
Server: Apache
X-Powered-By: PHP/4.2.3
Connection: close
Content-Type: text/html

<?xml version="1.0"?><FilesCatalog><MsgVersion>1</MsgVersion><ServerDateTime>2005-03-13

19:04:51</ServerDateTime><Files><File><Type>2</Type><DateTime>2005-03-01

14:00:00</DateTime><Patches></Patches><URL><CompleteURL>[url]http://www.test.com/sig.zip[/url]</CompleteURL></URL></File

><File><Type>8</Type><DateTime>2005-03-13

10:45:49</DateTime><Patches></Patches><URL><CompleteURL>[url]http:///www.test.com/pre.zip[/url]</CompleteURL></URL></File

><File><Type>32</Type><DateTime>2005-03-01

11:00:00</DateTime><Patches></Patches><URL><CompleteURL>[url]http://www.test.com/dat.zip[/url]</CompleteURL></URL></File>

<File><Type>1</Type><DateTime>2005-03-14

00:31:57</DateTime><Patches><PackedURL>[url]http://www.test.com/rche10.zip[/url]</PackedURL><Names><Name>081111.up</Name><Name>080437.up</Name><Name>220958.up</Name><Name>145625.up</Name><

Name>092948.up</Name><Name>175746.up</Name><Name>112617.up</Name><Name>PATCH_

172702.up</Name><Name>082805.up</Name><Name>192259.up</Name></Names></Patches><URL>

<CompleteURL>[url]http://www.test.com/av.zip[/url]</CompleteURL></URL></File></Files></FilesCatalog>


查看完整版本: Asp,php给浏览器返回xml


Powered by Discuz! Archiver 6.1.0  © 2001-2006 Comsenz Inc.
Processed in 0.005949 second(s), 2 queries