Dim OP As ServiceReference2.API 'ServiceReference2=服務名稱 API=介面
Dim EA As EndpointAddress = New EndpointAddress(New Uri("SVC網址"))
Dim BHB As BasicHttpBinding = New BasicHttpBinding
Dim CF As ChannelFactory(Of ServiceReference2.API) = New ChannelFactory(Of ServiceReference2.API)(BHB, EA)
OP = CF.CreateChannel()