> ' Add the HTTP header > Public Function AddHTTPHeader() As Boolean > Dim lcName As String = "" > Dim lcValue As String = "" > Dim loObject(2) As Object > Dim loHttpRequestMessageProperty As System.ServiceModel.Channels.HttpRequestMessageProperty = New System.ServiceModel.Channels.HttpRequestMessageProperty() > > ' Reset the values > lSuccess = False > > ' If we have at least one HTTP header > If oHTTPHeader.Count > 0 Then > > ' For each header > For Each loObject In oHTTPHeader > > ' Initialization > lcName = loObject(1) > lcValue = loObject(2) > > ' Add the header > loHttpRequestMessageProperty.Headers(lcName) = lcValue > > Next > > ' Set the header > OperationContext.Current.OutgoingMessageProperties(System.ServiceModel.Channels.HttpRequestMessageProperty.Name) = _ > loHttpRequestMessageProperty > > End If > > lSuccess = True > > Return lSuccess > End Function >>
> ' Add the HTTP header > Public Function AddHTTPHeader() As Boolean > Dim lcName As String = "" > Dim lcValue As String = "" > Dim loObject(2) As Object > > ' Reset the values > lSuccess = False > > Using loHttpRequestMessageProperty = New System.ServiceModel.Channels.HttpRequestMessageProperty() > > ' If we have at least one HTTP header > If oHTTPHeader.Count > 0 Then > > ' For each header > For Each loObject In oHTTPHeader > > ' Initialization > lcName = loObject(1) > lcValue = loObject(2) > > ' Add the header > loHttpRequestMessageProperty.Headers(lcName) = lcValue > > Next > > ' Set the header > OperationContext.Current.OutgoingMessageProperties(System.ServiceModel.Channels.HttpRequestMessageProperty.Name) = _ > loHttpRequestMessageProperty > > End If > > End Using > > lSuccess = True > > Return lSuccess > End Function >>