文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>VB6调用WebService、WCF

VB6调用WebService、WCF

时间:2011-01-31  来源:☆Keep★Moving☆

 

 

 '当调用WCF 时候,要注意一些事项.由于WCF对外公布的都是接口,如果WCF里定义了多个接口,VB6.0如果没对全部实现的话是会报错的.我仲未知点解决...WCF定义返回的是Class类,VB6.0那接收时也会出错.

Jason個邊抄過來的調用WCF

VB6.0 Call WCF

Sub CallWCFService_TypedContract()
  
  Dim strMonikerString As String
  Dim serviceMoniker As Object
  
  '---------------------------------------------------------------
  ' Typed Contract service moniker example
  '---------------------------------------------------------------
  ' Create a service moniker object using a strongly typed contract
  ' This references the address, a standard binding type and the
  ' locally registered COM-visible contract ID
  
  monikerString = "service:address='http://localhost/WCFServiceMoniker/Service1.svc'"
  monikerString = monikerString + ", binding=wsHttpBinding"
  monikerString = monikerString + ", contract={4FBDA94E-8B89-32EC-BC28-2A0A5E9B7C74}"
  
  ' Create the service moniker object
  Set serviceMoniker = GetObject(monikerString)
  
  ' Call the service operations using the moniker object
  MsgBox serviceMoniker.SayHello("I am LazyBee, My blog is http://lazybee.cnblogs.com/ ")
  
  Set serviceMoniker = Nothing
End Sub

相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载