user203687
user203687

Reputation: 7237

Can a WCF operation contract return a boolean value?

Is the following signature correct (in VB)?

<OperationContract()>
Function Validate(Byval Param As Integer) As Boolean

I heard that "Operation contracts" cannot return boolean values. Is it true or it is a blunder? Of course, I did not test it yet.

Upvotes: 0

Views: 4476

Answers (3)

dsum
dsum

Reputation: 1493

According to this document and the example provided:

http://msdn.microsoft.com/en-us/library/ms730255.aspx

if you are using a MessageContract parameter, then you CAN NOT return boolean.

Upvotes: 4

SaravananArumugam
SaravananArumugam

Reputation: 3720

Operation Contracts can return almost all types, including boolean, void.

Upvotes: 2

RQDQ
RQDQ

Reputation: 15569

Yes, you can return a boolean.

Upvotes: 2

Related Questions