WCF 参数未传递
我调用以下本地 WCF 客户端服务。
var Key = 1000;
FormServiceClient formService = new FormServiceClient("WSHttpBinding_IFormService");
我称
formService.GetCaseData(Key);
Key 值未通过我的 asp.net 应用程序传递到服务中。 如果我使用 WCF 测试客户端,那么工作就没有问题。
当我走到这一步时--> formService.GetCaseData(Key); Key 参数的值为 1000。 一旦我到达服务端,它的值为 0。
我注意到,如果我调用一个返回简单 POCO 类的方法,它就可以正常工作。我正在尝试返回一个实体域对象。这可能是问题所在吗?
I call the following local WCF Client service.
var Key = 1000;
FormServiceClient formService = new FormServiceClient("WSHttpBinding_IFormService");
And I call
formService.GetCaseData(Key);
The Key value is not getting passed into the service via my asp.net application.
If I used WCF Test Client then there is no problem working.
When I hit this step--> formService.GetCaseData(Key);
The Key parameter has a value of 1000.
Once I get to the Service side, it has a value of 0.
I noticed that if I call an method that returns a simple POCO class it works fine. I am trying to return an Entity Domain object. Could this be the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到过同样的问题。尽管我还没有找到解决方案,但阅读本文的任何人可能都想取消单击“仅显示我的代码”。如果这样做,您可能会看到 System.Runtime.Fx.Async.Thunk.UnhandledExceptionFrame(AsyncResult) 或类似的内容。如果是这种情况,并且您将 ASP.NET 与 .NET 4.0+ 一起使用,则问题可能是 WCF 和 ASP 之间的同步冲突,该冲突仅在调试时发生,并且仅在通过接口传递数据时发生。但是我知道这个问题没有解决方案。
I have experienced the same problem. Although I have not yet found a solution, anyone reading this may want to unclick 'show my code only'. If you do you may see a System.Runtime.Fx.Async.Thunk.UnhandledExceptionFrame(AsyncResult) or something similar. If this is the case, and you are using ASP.NET with .NET 4.0+ the problem is likely a synchornization conflict between WCF and ASP that occurs only in debugging, and only when passing data through interfaces. However I know of no solutions to this problem.