WCF服务方法参数,布尔指定 [英] WCF service method arguments, bool specified

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

问题描述

可能重复:结果
   WCF不会返回一个int

试图从我自己的WCF服务这样的消耗:

Trying to consume from my own WCF service like this:

[ServiceContract]
public interface IReturnService
{
    [OperationContract]
    bool GetTransactionList(int lRetailStoreID, int lWorkstationNmbr, int lTaNmbr);
}

但是,当我打电话从客户端的服务,我得到的,有没有方法误差 GetTransactionList 有3个参数,而不是我得到这个标题:

But when I'm calling the service from the client, I get the error that there's no method GetTransactionList with 3 arguments, instead I get this header:

myWCF.GetTransactionList(int lRetailStoreID, bool lRetailStoreIDSpecified, 
                         int lWorkstationNmbr, bool lWorkstationNmbrSpecified, 
                         int lTaNmbr, bool lTaNmbrSpecified, 
                         out bool GetTransactionListResult, 
                         out bool GetTransactionListResultSpecified)

任何人都知道为什么会出现这种情况,如何解决呢?让我知道是否需要更多的信息。

Anyone knows why is this happening and how to solve it? Let me know if more information is needed.

推荐答案

添加到XMLSerializerFormat属性您的服务:

Add XMLSerializerFormat to attributes on your service:

[ServiceContract]
[XmlSerializerFormat]
public interface IReturnService{
...

继承人原因:<一href=\"http://nirajrules.word$p$pss.com/2009/08/26/wcf-serializers-xmlserializer-vs-datacontratserializer-vs-netdatacontractserializer/\">http://nirajrules.word$p$pss.com/2009/08/26/wcf-serializers-xmlserializer-vs-datacontratserializer-vs-netdatacontractserializer/

这篇关于WCF服务方法参数,布尔指定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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