【发布时间】:2011-05-06 17:21:29
【问题描述】:
我有一些 xml 数据。我制作了一个基于 asp.net soap 的 web 服务,它将 xml 作为字节缓冲区应用 xsl 转换并将其转换为 docx 文件。但是,当我使用响应对象返回 docx 文件时,我收到一个错误,客户端找到类型为 application/vnd-word 的响应,但它期待的是 text/xml。
xsl 转换后推送文档文件的服务片段
Context.Response.Clear();
Context.Response.ClearHeaders();
Context.Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Context.Response.AddHeader("Content-Disposition", "attachment; filename=" + "test.docx"); Context.Response.Flush();
Context.Response.End();
【问题讨论】:
标签: asp.net web-services docx