All the examples show how to have a soapheader (such as authorisation)
consumed by the webservice, but not how to construct one if it is not in the
wsdl.
The WebService I am trying to call requires a soap header, but I cant find
how to write the header into the request using VB.Net. I can find out how to
process it at the client, but not generate it.
I created a new project with a web reference generated by VisualStudio
pointed at the wsdl. The PlaceOrder method needs the header, but I cant
work out how to insert it.
Please help, or if anyone has sample code ...
Thanks (Snip of source code)
'This source code was auto-generated by Microsoft.VSDesigner, Version
1.1.4322.2032.
<System.Diagnostics.DebuggerStepThroughAttribute() ,
System.ComponentModel.DesignerCategoryAttribute("c ode"),
System.Web.Services.WebServiceBindingAttribute(Nam e:="PlaceOrderSoapBinding",
[Namespace]:="http://www.compname.com/wsdl/")> _
Public Class RemoteAPI Inherits
System.Web.Services.Protocols.SoapHttpClientProtoc ol
<System.Web.Services.Protocols.SoapRpcMethodAttrib ute("http://www.compname.com/action/PlaceOrder",
RequestNamespace:="http://www.compname.com/message/",
ResponseNamespace:="http://www.compname.com/message/")> _
Public Function PlaceOrder(ByVal Order As Order) As
<System.Xml.Serialization.SoapElementAttribute("Or derReply")> OrderReply
Dim results() As Object = Me.Invoke("PlaceOrder", New Object() {Order})
Return CType(results(0), OrderReply)
End Function