服务器端(包括设计器生成的代码)
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
' _
Public Class soapservice
Inherits System.Web.Services.WebService
Public Class MySoapHeader
Inherits SoapHeader
Public username As String
Public password As String
End Class
#Region " Web 服务设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Web 服务设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加您自己的初始化代码
End Sub
'Web 服务设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Web 服务设计器所必需的
'可以使用 Web 服务设计器修改此过程。
'不要使用代码编辑器修改它。
Private Sub InitializeComponent()
components = New System.ComponentModel.Container
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'CODEGEN: 此过程是 Web 服务设计器所必需的
'不要使用代码编辑器修改它。
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
#End Region
' Add a member variable of the type deriving from SoapHeader.
Public temp As New MySoapHeader
' Apply a SoapHeader attribute.
SoapHeader("temp")> _
Public Function HelloWorld() As String
If temp.username = "admin" Then
Return temp.username
Else : Return "user为空"
End If
End Function
End Class
客户端(不包括设计器)
Imports System.Web.Services.Protocols
Dim h As localhost.MySoapHeader
Dim myheader As localhost.MySoapHeader
Dim proxy As localhost.soapservice = New localhost.soapservice
h = New localhost.MySoapHeader
h.password = "1"
h.username = "admin"
proxy.MySoapHeaderValue = h
Dim results As String = proxy.HelloWorld
TextBox1.Text = results
TextBox2.Text = h.username巧 巧 读 书:http://www.qqread.com/safe-tech/j681179072.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- 路由安全配置专题 (11841篇文章)
- 系统安全设置 (23595篇文章)
- 配置安全的操作系统 (9862篇文章)
- 打造安全服务器 (13282篇文章)
- Cisco认证体系专题 (3150篇文章)
- MySQL安全 (9886篇文章)
- 电子邮件安全 (8401篇文章)
- SSH安全技术 (8236篇文章)
- 数据库安全技术专题 (13167篇文章)
- FreeBSD系统安全管理 (8813篇文章)
- 安全新威胁 电脑安全终极指南 (26次浏览)
- 六大预言:2008年网络安全趋势展望 (13次浏览)
- “利”字当头 纵观2007反病毒市场 (7次浏览)
- 下一代网络的安全技术 (7次浏览)
- VoIP是下一大安全隐患 (7次浏览)
- 五分之一Windows上应用程序无安全补丁 (7次浏览)
- 网络安全 浅谈防火墙的分类与应用 (6次浏览)
- 如何保证VoIP通讯更安全? (4次浏览)
- 谨防“Real蛀虫”病毒寄生视频文件传播 (3次浏览)
- 面临什么新威胁 PC安全终极指南 (2次浏览)



