本文整理汇总了VB.NET中System.Web.Services.Protocols.SoapHeaderCollection类的典型用法代码示例。如果您正苦于以下问题:VB.NET SoapHeaderCollection类的具体用法?VB.NET SoapHeaderCollection怎么用?VB.NET SoapHeaderCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SoapHeaderCollection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MathSvc
<System.Web.Services.WebServiceBindingAttribute(Name := "MathSvcSoap", _
Namespace := "http://tempuri.org/")> _
Public Class MathSvc
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
Public mySoapHeaders() As SoapHeader
<SoapHeaderAttribute("mySoapHeaders", _
Direction := SoapHeaderDirection.In), _
System.Web.Services.Protocols.SoapDocumentMethodAttribute( _
"http://tempuri.org/Add", _
Use := System.Web.Services.Description.SoapBindingUse.Literal, _
ParameterStyle := System.Web.Services.Protocols.SoapParameterStyle.Wrapped), _
MySoapExtensionAttribute()> _
Public Function Add(xValue As System.Single, yValue As System.Single) _
As System.Single
Dim mySoapHeaderCollection As New SoapHeaderCollection()
Dim mySoapHeader As MySoapHeader
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This is the first SOAP header"
mySoapHeaderCollection.Add(mySoapHeader)
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This is the second SOAP header"
mySoapHeaderCollection.Add(mySoapHeader)
mySoapHeader = New MySoapHeader()
mySoapHeader.text = "This header is inserted before the first header"
mySoapHeaderCollection.Insert(0, mySoapHeader)
mySoapHeaders = New MySoapHeader(mySoapHeaderCollection.Count-1) {}
mySoapHeaderCollection.CopyTo(mySoapHeaders, 0)
Dim results() As Object = _
Me.Invoke("Add", New Object() {xValue, yValue})
Return CType(results(0), System.Single)
End Function 'Add
<System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
Me.Url = "http://localhost/MathSvc_SoapHeaderCollection.vb.asmx"
End Sub
Public Function BeginAdd(xValue As System.Single, yValue As System.Single, _
callback As System.AsyncCallback, asyncState As Object) _
As System.IAsyncResult
Return Me.BeginInvoke("Add", New Object() {xValue, yValue}, _
callback, asyncState)
End Function 'BeginAdd
Public Function EndAdd(asyncResult As System.IAsyncResult) As System.Single
Dim results As Object() = Me.EndInvoke(asyncResult)
Return CType(results(0), System.Single)
End Function 'EndAdd
End Class