strange behaviour calling method of wcf from powershell using new-webproxyservice

前端 未结 2 1629
自闭症患者
自闭症患者 2020-12-19 18:40

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

相关标签:
2条回答
  • 2020-12-19 19:20

    Experimenting with your answer, and then finally discover this answer, it seems all your problems will go away if you simply add [XmlSerializerFormat] to the operation contract, and the method signature will return to normal. At least my problems did when testing against a 2.0 .Net framework and powershell.

    0 讨论(0)
  • 2020-12-19 19:21

    finally I've discovered this:

    PS C:\ps> [int]$int = 0
    PS C:\ps> $bool = $true
    PS C:\ps> $a.DictionaryLength([ref]$int, [ref]$bool)
    PS C:\ps> $int
    61
    

    I've build a solution with .net 2.0 (powershell native framework) for a client application to consume my wfc (.net 4.0) and the definition for method DictionaryLegth() was:

    void myservice.DictionaryLength(out int DictyionaryLengthResult, out bool DictonaryLengthSpecified)
    
    0 讨论(0)
提交回复
热议问题