[quoted text, click to view] "Jim" <Jim@discussions.microsoft.com> wrote in message
news:E9F9D5B5-81DD-46C2-8B48-0EBF51EA0366@microsoft.com...
> Does anyone know why Response.AddHeader "Refresh" does not work when
> Response.ContentType = "text/xml"?
>
> The code is very short:
> <%
> Response.ContentType = "text/xml"
> Response.AddHeader "Refresh", "5;URL=http://localhost/ReturnXML2.asp"
> %>
> <CiscoIPPhoneImage>
> <LocationX>-1</LocationX>
> <LocationY>-1</LocationY>
> <Width>125</Width>
> <Height>23</Height>
> <Data>Hex GUID goes here</Data>
> <Title>The XYZ Company</Title>
> </CiscoIPPhoneImage>
>
> If I change the contentType to "text/plain", the page does
refresh/redirect
> but not when the ContentType is XML. It needs to be in XML for Cisco Call
> Manager.
>
> There is documentation out there that makes it seem like executing the
above
> code is no problem but I can't get it to refresh/redirect. Can anyone shed
> any light?
>
The refresh header is a directive to the HTML browser (that browsers aren't
obligated to implement) it isn't a header defined by the HTTP protocol.
When using text/plain the browser assumes responsibility for rendering the
content (IE treats it as HTML). Since the content it is rendering has a
refresh header attached it puts it into action.
However when the content is text/xml the browser isn't actually rendering
the XML. It uses the <?xml-stylesheet processing instruction in the xml
document to transform the XML to content it should render. If that PI isn't
present is uses a default transform. After the transform the content it is
actually rendering no long has a refresh header associated with it so
nothing happens.
Cisco call manager that consumes your XML content would have to be coded to
honor the refresh header.
--
Anthony Jones - MVP ASP/ASP.NET