I'm working on a WCF Service. I have one service operation Function getValues(Optional verbose as Boolean) as List(of String)
.
This works:
' First, add a file reference that contains the iRM interface.
Dim ep3 As EndpointAddress
ep3 = New EndpointAddress("net.pipe://localhost/RM/RMPipe")
Dim netPipeRMClient As RMLib.iRM netPipeRMtClient = ChannelFactory(Of RMLib.iRM) _ .CreateChannel(New NetNamedPipeBinding, ep3)
dim foo as List(of String) = netPipeRMClient.getValues()
However, this does not work:
' Use Add Service Reference to get the client type... Dim ep3 As EndpointAddress
ep3 = New EndpointAddress("net.pipe://localhost/RM/RMPipe")
dim netPipeRMClient as RM.iRMClient = _
new RM.IRMClient(New NetPipeBinding, ep3)
Dim foo as List(of String) = netPipeRmClient.getValues()
On the last line, I get a compile-time error that says "Argument not specified for parameter verbose
".
The verbose
parameter was clearly defined to be optional in my method signature, but in my WCF service contract, it doesn't seem to be optional when I use the client created with "Add Service Reference".
Any ideas?