如何使用参数不足的WCF服务? [英] How to Consume WCF service with insufficient parameters?

查看:93
本文介绍了如何使用参数不足的WCF服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WCF服务中操作契约期望两个输入参数,但我想只发送一个参数值,所以没有问题WCF处理这个错误参数的默认值,但服务消耗应用程序(客户端代理)不允许我构建应用程序如何解决它?

解决方案

您不能为WCF方法使用可选参数,但您可以使用NULL值而不是它。这是一个解释相同的链接: -



http://stackoverflow.com/questions/22963789/can-you-use-optional-parameters-in-a-wcf-service-method

In WCF Service The Operation contract expecting two input parameter, but I want to send only one parameter value so no problem WCF handle this with default value for the missed parameter ,but the service consumed application(Client Proxy) not allowing me to build the application how to resolve it?

解决方案

You can not use optional parameters for WCF methods but you can use NULL values instead of that. Here is a link explaining the same :-

http://stackoverflow.com/questions/22963789/can-you-use-optional-parameters-in-a-wcf-service-method


这篇关于如何使用参数不足的WCF服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆