title: Unable to read header information in vb.net web service
body: <p>I am unable to read the header that is being passed into my web service. I am using curl to call my web service which returns without errors but the header value passed in is blank.</p>
  
  <pre><code>curl command with return message:
  C:\curl&gt;curl -X POST -H "Token: 123" -d '' http://localhost/Service.asm
  x/GoCardLessWebHook
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;string xmlns="http://MyGoCardLessAPI.org/"&gt;200 OK - &lt;/string&gt;
  </code></pre>
  
  <p>Here is the Web Service code:</p>
  
  <pre><code>Public Class clsSoapHeader
      Inherits SoapHeader
      Public Token As String
  End Class
  
  
  
  &lt;WebService(Namespace:="http://MyGoCardLessAPI.org/")&gt; _
  &lt;WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&gt; _
  &lt;Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()&gt; _
  &lt;System.Web.Script.Services.ScriptService()&gt;
  Public Class Service
  
      Inherits System.Web.Services.WebService
  
      Public GoCardLessHeaders As New clsSoapHeader
  
      &lt;WebMethod(), _
      SoapHeader("GoCardLessHeaders", Direction:=SoapHeaderDirection.InOut)&gt; _
      Public Function GoCardLessWebHook() As String
  
          Dim sTemp As String = "Unknown"
  
          sTemp = GoCardLessHeaders.Token
  
  
          Return "200 OK - " &amp; sTemp
  
      End Function
  </code></pre>