Can someone explain this to me:
I built a really simple wcf service for testing.
PowerShell consumer service using New-WebServiceProxy I found this weird behavior:
If in a wcf service I have a contract that returns an int
:
[OperationContract] int GetDictionaryLength();
calling this method in powershell gives an error, and the method definition is not what I would expect to see
PS C:\ps> $a | Get-Member getdictionarylength | fl *
Type: Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1_022s_pwdservice_svc_wsdl.PWDService
Name: GetDictionaryLength
MemberType: Method
Definition: System.Void GetDictionaryLength (System.Int32 &, mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 GetDictionaryLengthResult, System.Boolean &, mscorlib, Version = 4.0.0.0, Culture = neutral, PublicKeyToken563419thth )
amend the contract as follows:
[OperationContract] string GetDictionaryLength();
do a great job called powershell.
Why is this?
WCF is in .net 4.0 Powershell - V2
source share