xml - 在浏览器中读取 wsdl 文件

标签 xml apache wsdl

当我尝试在浏览器 (http://localhost/something/file.wsdl) 中打开 WSDL 文件时, 我可以下载该文件。 但我不想下载,而是希望能够在浏览器中查看为 XML(字符串)?

谢谢

最佳答案

如果您的服务器没有为 WSDL 文件发送正确的内容类型,则可能会发生这种情况。

请求 WSDL 时,响应中应该有一个 HTTP header ,如下所示:

Content-type: text/xml

如果您看到一个下载弹出窗口,那么这可能被设置为其他内容,或者它完全丢失了。

如果您也将 Tomcat 与 Apache 一起使用,您可以在 web.xml 文件中设置类似这样的内容:

<mime-mapping>
  <extension>wsdl</extension>
  <mime-type>text/xml</mime-type>
</mime-mapping>

对于 Apache,请查看 mod_mime模块。

关于xml - 在浏览器中读取 wsdl 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5398167/

相关文章:

python - Python 中的 SOAP 后端

xml - xsl :copy-of just the content without the node

java - 使用 javax.xml.transform.Transformer 对 xml 属性进行排序以实现 pretty-print

node.js - 无法访问react和非node js后端(apache)服务器应用程序中的进程对象

c# - 连接到安全网络服务时出错!

java - Apache CXF,从 WSDL 文件生成 Web 服务

c# - 反序列化需要 XmlRoot 属性,但在 xml 文件中没有 root 属性

Common Lisp 的 XML 数据绑定(bind)

php - 在 PHP 中创建虚拟主机

php - Sphinx 搜索 Cron 问题