ASHX file and xml extension

  • Thread starter Thread starter sck10
  • Start date Start date
S

sck10

Hello,

I have a java applet that builds a graph using an xml file. I can create
the xml with the ashx file, however, the applet doesn't recognize the
extension. What I am doing now is streaming the data to text file, which I
don't prefer since I am creating files on the server. Is there a way to
generate the ashx file using an xml extension or something of this nature?
Any suggestions would be appreciated.

Thanks, sck10
 
Hello Steve,

As for the XML file extension issue, I think there are two things we can
check:

1. Whether the java applet always force the XML content url to be end with
a ".xml" extension, if this is the case, I'm afraid you have to provide
such a xml file(with .xml extension)

2. If the applet does not require that you must provide a fixed ".xml"
extension for the xml stream, then you should check the code you
programmatically streaming out the content. A simple code snippet that
render out XML content is like below:

=========================
protected void Button1_Click(object sender, EventArgs e)
{
Response.ClearHeaders();
Response.ClearContent();

Response.ContentType = "text/xml";
Response.Write(
@"<root>
<items>
<item id='1'/>
<item id='2'/>
</items>
</root>
");

Response.End();


}
=========================

Please feel free to let me know if there is anything I missed or anything
you unclear.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top