[英]Get WCF webservice response as XML
I have created a simple WCF web service. 我创建了一个简单的WCF Web服务。 How can I view it's response as XML?
如何查看XML的响应?
Do I create a consuming client application and then output the results as XML somehow? 我要创建一个消耗性客户端应用程序,然后以某种方式将结果输出为XML吗?
You can also use the Wcf testing tool provided to you by visual studio. 您还可以使用Visual Studio提供的Wcf测试工具。 Its pretty straight forward to use.
它非常简单易用。
You can find it in C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE\\WcfTestClient 您可以在C:\\ Program Files \\ Microsoft Visual Studio 10.0 \\ Common7 \\ IDE \\ WcfTestClient中找到它
You may use WCF tracing utility - SvcTraceViewer.exe. 您可以使用WCF跟踪实用程序-SvcTraceViewer.exe。 Just configure tracer in your config file.
只需在配置文件中配置跟踪器。
Take a look at this source(at the bottom, system.diagnostics section): 看一下此源(在底部的system.diagnostics部分):
http://xenta.codeplex.com/SourceControl/changeset/view/068ddfd6bf36#trunk%2fSrc%2fHst%2fIisHost%2fWeb.config http://xenta.codeplex.com/SourceControl/changeset/view/068ddfd6bf36#trunk%2fSrc%2fHst%2fIisHost%2fWeb.config
This is how we use WCF tracing in our project. 这就是我们在项目中使用WCF跟踪的方式。
我建议您使用XMLSpy ,因为它提供了WSDL,SOAP,xsd的良好视图。
Below are all the things I'd suggest: 以下是我建议的所有内容:
Enable tracing on the service side, generate tracing logs, and analyze with SvcTraceViewer. 在服务端启用跟踪,生成跟踪日志,并使用SvcTraceViewer进行分析。 To do this, follow the instructions at this MSDN article on using the service trace viewer .
为此,请按照MSDN上有关使用服务跟踪查看器的文章中的说明进行操作。
Turn on debug exceptions. 打开调试异常。 This is done by turning in includeExceptionDetailInFaults, which you can do by following the instructions here .
这可以通过上载includeExceptionDetailInFaults来完成, 您可以按照此处的说明进行操作 。
Try this, and please report back! 试试看,请报告! :)
:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.