WCF hizmetim için istemci olarak bir hizmet monikeri başarıyla oluşturdum. Ama ben moniker üzerinde herhangi bir yöntem arayamıyorum.Otomasyon Hata WCF mex'te Moniker ile yöntemi çağırırken Excel 1.
Public Function TestMethod(ByVal TestValue As String) As String Implements ICustomerService.TestMethod
Return "You said.... " & TestValue
End Function
ardından kod Excel'de Moniker oluşturur: aşağıdaki gibi WCF hizmeti sonunda
Ben, TestMethod adlı bir kukla yöntem var.Public Sub WCFMexMonkierDemo()
' Create a string for the service moniker including the content of the WSDL contract file
Dim mexMonikerString As String
mexMonikerString = "service:mexAddress='http://localhost/CustomerService.svc/mex'" & _
", address='http://localhost/CustomerService.svc'" & _
", binding=CustomerServices.CustomerService" & _
", bindingNamespace='http://tempuri.org/'" & _
", contract=ICustomerService" & _
", contractNamespace='http://tempuri.org/'"
' Create the service moniker object
Dim mexMoniker, result
Set mexMoniker = GetObject(mexMonikerString)
result = mexMoniker.TestMethod("client call") '<-- error on this line
'Set result = mexMoniker.TestMethod("client call")
MsgBox result
Set mexMoniker = Nothing
Set result = Nothing
End Sub
Yukarıdaki kod lakap başarıyla oluşturuldu ima GetObject
çağrı kadar çalışır. Ama herhangi bir yöntemi çağırmaya çalıştığım anda hata alıyorum.
WCF yöntemi
Microsoft WCF test istemcisi ve diğer WCF müşterilerle mükemmel ok çalışır. Bu yüzden servisin kendisinde bir problem olmadığını biliyorum.