Can someone explain this to me:
I builded an really simple wcf service for testing purposes.
Consuming service from powershell using New-WebServiceProxy I found this stange behaviour:
if in wcf service I have this kind of Contract returning an int
:
[OperationContract]
int GetDictionaryLength();
calling this method in powershell gives an error and the definition of the method is not what I would expect to see
PS C:ps> $a | Get-Member getdictionarylength | fl *
TypeName :
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,
PublicKeyToken=b77a5c561934e089
GetDictionaryLengthResultSpecified)
changing the contract like this:
[OperationContract]
string GetDictionaryLength();
do a great job called in powershell.
Why this?
WCF is in .net 4.0
Powershell is V2
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…