Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1824
  • Last Modified:

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?
0
Gary2Seven
Asked:
Gary2Seven
1 Solution
 
Gyanendra SinghArchitectCommented:
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now