'Call WebService. Install soaptoolkit30.exe and reference Microsoft soap Type Library V3.0 in the project.
Sub callwebservice ()
Dim m_spclient as new soapclient30 'soapclient30 Object Instantiation
M_spclient.mssoapinit "http: // localhost/mciswebservice/vbtest. asmx? WSDL "'reference WebService
Msgbox m_spclient.helloworld 'calls the WebService Method
End sub
'Http calls to WCF
Sub callhttpwcfservice ()
Dim mexmonikerstring as string dim mexservicemoniker as object 'your 'mex service moniker example 'Then 'create a string for the service moniker specifying the address' to retrieve the service metadata from mamemonikerstring = "service: mexico address = 'HTTP: // localhost: 55242/service1.s VC/MEX '"mmonikerstring = mmonikerstring +", address = 'HTTP: // localhost: 55242/service1.svc' "mmonikerstring = mmonikerstring +", binding = require, bindingnamespace = 'HTTP: // tempuri.org/'"mexmonikerstring = mexmonikerstring +", contract = iservice1, contractnamespace = 'HTTP: // tempuri.org/' "'create the service moniker object set Signature = GetObject (mmormonikerstring) 'Call the service operations using the moniker object msgbox Mexico servicemoniker. sayhello ("China! ") Set mexservicemoniker = nothing
End sub
'Tcp call to WCF
Sub calltcpwcfservice ()
Dim mexmonikerstring as string
Dim mexservicemoniker as object
'Create a string for the service moniker specifying the address
'To retrieve the service metadata from
Mexico monikerstring = "service: Mexico address = 'HTTP: // 192.168.1.110: 12345/binding/MEX '"
Mexmonikerstring = mexmonikerstring + ", address = 'Net. TCP: // 192.168.1.110: 54321/binding/hello '"
Mexmonikerstring = mexmonikerstring + ", binding = 'nettcpbinding _ ihel', bindingnamespace = 'HTTP: // tempuri.org /'"
Mexmonikerstring = mexmonikerstring + ", contract = ihello, contractnamespace = 'HTTP: // tempuri.org /'"
'Create the service moniker object
Set mexservicemoniker = GetObject (mexmonikerstring)
'Call the service operations using the moniker object
Msgbox mexservicemoniker. sayhello ("China! ")
Set mexservicemoniker = nothing
End sub