Jump to content

PHP-XML subnodes not being sent back to HTTPWebResponse


jwpryor

Recommended Posts

I have a php script. It generates xml.

When the php file is called with an HTTPWebResponse, only the first (wrap around) node is returned.

When the php file is called via a URL construct, all the nodes are returned.

I'm using output buffering to dynamically generate the length of the output.

ob_start();

print "xml...";

header('Content-Length: ' . ob_get_length());

ob_end_flush();

----------

For example:

 

When I use the HTTPWebResponse and viewed the Response Stream that I get back;

 

<?xml version="1.0"?>< FULLresult ></FULLresult >

 

and the Content-Length is = 44 (which IS the number of characters returned).

--------

But when I construct a URL and paste it into the browser I get back;

 

<?xml version="1.0" ?>

<FULLresult>

 

<Status>

<Result>Success</Result>

<Description>Enrolled</Description>

</Status>

</FULLresult >

 

 

So all the sub nodes below FULLresult are not visible to me in the HTTPWebResponse. The Content-Length should really be 100 something.

 

What would keep the HTTPWebResponse from receiving the subnodes?

---

Don't know if this helps, but this is also returned to the HTTPWebResponse

 

Headers {Connection: close

Date: Thu, 20 Nov 2008 19:57:25 GMT

Server: Microsoft-IIS/6.0

X-Powered-By: ASP.NET,PHP/5.2.4

cache-control: no-cache, must-revalidate

Pragma: no-cache

Content-type: text/xml

Last-Modified: Thu, 20 Nov 2008 19:45:07 GMT

Content-Length: 44

}

 

----

Thank you for any ideas about what the problem may be.

J

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.