本文整理汇总了VB.NET中System.ServiceModel.Channels.AddressHeader.CreateAddressHeader方法的典型用法代码示例。如果您正苦于以下问题:VB.NET AddressHeader.CreateAddressHeader方法的具体用法?VB.NET AddressHeader.CreateAddressHeader怎么用?VB.NET AddressHeader.CreateAddressHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ServiceModel.Channels.AddressHeader
的用法示例。
在下文中一共展示了AddressHeader.CreateAddressHeader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: addressHeaders
' Create address headers for special services and add them to an array
Dim addressHeader1 As AddressHeader = AddressHeader.CreateAddressHeader("specialservice1", "http://localhost:8000/service", 1)
Dim addressHeader2 As AddressHeader = AddressHeader.CreateAddressHeader("specialservice2", "http://localhost:8000/service", 2)
Dim addressHeaders() As AddressHeader = { addressHeader1, addressHeader2 }
' Endpoint address constructor with URI and address headers
Dim endpointAddressWithHeaders As New EndpointAddress(New Uri("http://localhost/silverlightsamples/service1"), addressHeaders)
' Confirm adddressHeader1 is in endpointAddressWithHeaders - boolHeaders returns True.
Dim addressHeaderCollection As AddressHeaderCollection = endpointAddressWithHeaders.Headers
Dim boolHeaders As Boolean = addressHeaderCollection.Contains(addressHeader1)
示例2: DataContractSerializer
'Create address headers with XmlObjectSerializer specified
Dim serializer As XmlObjectSerializer = New DataContractSerializer(GetType(Integer))
Dim addressHeaderWithObjSer As AddressHeader = AddressHeader.CreateAddressHeader("MyServiceName", "http://localhost:8000/service", 1, serializer)
Dim value As Integer = addressHeaderWithObjSer.GetValue(Of Integer)()