简体   繁体   English

C#-Visual Studio,如何调试SoapHttpClientProtocol

[英]C# - Visual Studio, how to debug SoapHttpClientProtocol

I am trying to call an external web-service via some proxy code generated by Visual Studio (based on the WSDL from the service). 我试图通过Visual Studio生成的某些代理代码(基于该服务的WSDL)调用外部Web服务。 The result object I get back is null, even though I can see that the service does actually return a SOAP message (I can see that in Fiddler). 返回的结果对象为null,即使我可以看到该服务确实返回了SOAP消息(也可以在Fiddler中看到)。

It appears that the SOAP message is not able to be deserialized by the code generated by Visual Studio. 看来,Visual Studio生成的代码无法反序列化SOAP消息。 I have read that this can be due to a mismatch between what the service's WSDL tells us what to expect, and what the service actually returns. 我已经读到,这可能是由于服务的WSDL告诉我们的期望值与服务实际返回的值之间不匹配。

Is it possible to get the deserialization code to report what the problem is, throw an exception, or something, instead of just silently returning null? 是否有可能获得反序列化代码来报告问题是什么,引发异常或其他原因,而不仅仅是默默地返回null?

Thanks. 谢谢。

I'm not sure about the debugging, but one approach you can try is to create a simple web service which returns the structure you're expecting. 我不确定调试,但是您可以尝试的一种方法是创建一个简单的Web服务,该服务将返回您期望的结构。 Then you can compare the output from this service with the actual service to see if you see any problems. 然后,您可以将该服务的输出与实际服务进行比较,以查看是否存在任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM