How can I add values to SOAP Header?

I need to add some values to the SOAP header before calling WebService.

How can I do this in VB.Net?
LVL 2
Gary2SevenAsked:
Who is Participating?
 
Gyanendra SinghConnect With a Mentor ArchitectCommented:
0
 
Gary2SevenAuthor Commented:
I'm sorry I don't quite get it.

I can see that I can define my own SoapHeader with additional settings;
Public Class mySoapHeader
  Inherits System.Web.Services.Protocols.SoapHeader
  Public Username As String = String.Empty
  Public Password As String = String.Empty
End Class

But how do I get my Webservice call to use that header instead of the default class?
Public WebServiceLink As WebService.HTNGListenerSoap = New WebService.HTNGListenerSoap

??? Somehow here, I need to get WebService to use my header and therefore have username/password in header?

WebServiceLink.ReceiveMessageAsync(XmlString)

0
All Courses

From novice to tech pro — start learning today.