Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF service method arguments, bool specified [duplicate]

Tags:

c#

wcf

Possible Duplicate:
WCF will not return an int

Trying to consume from my own WCF service like this:

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

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.

like image 801
framara Avatar asked Nov 15 '12 11:11

framara


Video Answer


1 Answers

Add XMLSerializerFormat to attributes on your service:

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

Heres why: http://nirajrules.wordpress.com/2009/08/26/wcf-serializers-xmlserializer-vs-datacontratserializer-vs-netdatacontractserializer/

like image 128
Chris Avatar answered Sep 21 '22 05:09

Chris