Samuel Learning

  • 联系
  •  
  • 管理

文章分类(203)

  • 01 ASP/HTML(6)
  • 02 Script/CSS(16)
  • 03 C/C++
  • 04 XML(4)
  • 05 微软编程(26)
  • 06 J2EE(60)
  • 09 Linux(14)
  • 10 Database(27)
  • 11 报表打印
  • 12 打包安装(1)
  • 13 模式重构(2)
  • 14 系统架构
  • 15 敏捷开发(11)
  • 16 案例分析(30)
  • 17 Workflow(1)
  • 18 配置管理(1)
  • 19 项目管理
  • 20 英语(4)

新闻分类(52)

  • CXF学习
  • Hibernate学习(1)
  • iBatis学习(16)
  • Struts1学习(1)
  • Struts2学习(34)

.NET资源

  • adxmenu
  • C# Open Source
  • DNN Directory
  • M2Land
  • Windows Form FAQ
  • 中国DNN
  • 中国DNN联盟

Ajax

  • DoJo
  • GWT
  • JQuery
  • jquery autocomplete
  • jquery flexgrid
  • JQuery Form
  • jquery masked input
  • JQuery UI
  • jquery validation
  • Jquery 图表
  • jquery报表
  • jquery插件集合
  • Qooxdoo
  • Tibco GI
  • YUI
  • YUI-EXT
  • ZeroKode

Java开源

  • ABLE
  • Agile Tao
  • Ajax4JSF
  • Alfresco
  • AppFuse
  • Compiere
  • Equinox
  • Findbugs
  • Geronimo
  • Grails
  • Harmony
  • Hibernate论坛
  • JAG
  • Java开源大全
  • Java视线论坛
  • jBPM工作流
  • JSFTutorials
  • Nereide ERP
  • Ofbiz ERP
  • Opentaps ERP
  • operamasks
  • Petstore
  • Prototype.js
  • RIFE
  • Runa
  • SpringSide
  • Struts Menu
  • Sun Glassfish
  • Trails
  • YUI4JSF
  • 满江红

Mobile

  • Sencha

WEB资源

  • DHTML中心
  • DHTML参考手册
  • DHTML文档
  • EclipsePlugin
  • Firebug
  • GRO Clinux
  • jMaki
  • JSTL文档
  • LoadIcon
  • Openlaszlo
  • Struts Menu 展示
  • Web Test Tools
  • WebCtrs
  • Webdeveloper
  • 中国RIA开发者论坛

Workflow

  • E-Workflow
  • JBPM
  • OpenWFE
  • OSWorkflow
  • WFMC
  • Workflow Research

其他连接

  • confach
  • CPP
  • ejay
  • Giovanni
  • 丹佛
  • 交大e-learning
  • 交大研究生院
  • 可恶的猫
  • 天天@blog
  • 我的相册
  • 阿飞

大牛人

  • 32篇JBPM
  • David.Turing
  • HongSoft@业务集成
  • Joel
  • Koen Aers
  • Martinfowler
  • Raible Matt
  • Raible Wiki
  • Scott W.Ambler
  • Tom Baeyens
  • Uncle Bob
  • 一个世界在等待
  • 子在川上曰
  • 小布老师
  • 小明
  • 差沙
  • 徐昊
  • 江南白衣
  • 汪博士
  • 汪小金
  • 银狐999

开源软件

  • 2Bizbox ERP
  • CompiereCRM&ERP
  • EGW
  • Vtiger CRM
  • webERP

敏捷

  • Canoo
  • Cruisecontrol
  • DBUnit
  • EL4Ant
  • Extreme Programming
  • Fit
  • Fitnesse
  • JFrog
  • Liquibase
  • Maven
  • MockObjects
  • Selenium
  • Squish
  • xpairtise
  • XPlanner
  • XProgramming
  • 敏捷联盟

数据库

  • Oracle 中国
  • Oracle-ERP
  • Oracle在线社区

未归类

  • Aquarius Orm Studio
  • mambo建站系统
  • Oracle产品下载
  • 远程同步管理工具Capivara

经典框架

  • Apache Shale
  • formdef-struts
  • FreeMarker 主页
  • JBoss Seam
  • JSF 中心
  • JSF 入门应用
  • JSF中国
  • MyFaces官方
  • Spring 社区
  • Spring专业网站
  • Spring中文论坛
  • Spring参考手册
  • Spring官方网站
  • strecks-struts
  • Struts1
  • Struts2
  • Struts-layout
  • StrutsWiKi
  • Tapestry WIKI
  • Tapestry 官方
  • Tapestry4开发指南
  • Tapestry中文文档
  • Webwork2文档
  • Wicket

网络教程

  • Laliluna
  • RoseIndia
  • Sang Shin
  • Visualbuilder

著名站点

  • Buildix
  • Dev2Dev
  • IBM dev中国
  • InfoQ
  • ITPub
  • Java Eye
  • Java Research
  • JavaRead
  • JavaWorldTW
  • Matrix
  • PHP100
  • PHPX
  • SpringSideWiKi
  • TheServerSide
  • TWPHP
  • 中国工作流论坛

项目管理

  • 管理人网

最新评论

View Post

.Net,ASP,VB调用webservice的示例

1.service文件代码:
Imports System.Web.Services

<System.Web.Services.WebService(Namespace :Namespace := "http://tempuri.org/VSService/Service1")> _
Public Class Service1Class Service1
    
Inherits System.Web.Services.WebService

#Region 
" Web Services Designer Generated Code "

    Public Sub New()Sub New()
        
MyBase.New()

        
'This call is required by the Web Services Designer.
        InitializeComponent()

        
'Add your own initialization code after the InitializeComponent() call

    
End Sub


    
'Required by the Web Services Designer
    Private components As System.ComponentModel.IContainer

    
'NOTE: The following procedure is required by the Web Services Designer
    'It can be modified using the Web Services Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()Sub InitializeComponent()
        components 
= New System.ComponentModel.Container()
    
End Sub


    
Protected Overloads Overrides Sub Dispose()Sub Dispose(ByVal disposing As Boolean)
        
'CODEGEN: This procedure is required by the Web Services Designer
        'Do not modify it using the code editor.
        If disposing Then
            
If Not (components Is Nothing) Then
                components.Dispose()
            
End If
        
End If
        
MyBase.Dispose(disposing)
    
End Sub


#
End Region

    
' WEB SERVICE EXAMPLE
    ' The HelloWorld() example service returns the string Hello World.
    ' To build, uncomment the following lines then save and build the project.
    ' To test this web service, ensure that the .asmx file is the start page
    ' and press F5.
    '
    '<WebMethod()> _
    'Public Function HelloWorld() As String
    '   Return "Hello World"
  'End Function

  
<WebMethod()> Public Function add()Function add(ByVal a As Integer, ByVal b As Integer) As String
    add 
= CStr(a + b)
  
End Function

End Class

2. asp.net调用,添加Web References。
Dim s As String
 
Dim t As New mingservice.Service1
 ResultAdd.Text 
= t.add(CInt(Param1.Text), CInt(Param2.Text))

3.  VB6调用,安装SoapToolkit20.exe。添加References:C:\Program Files\Common Files\MSSoap\Binaries\MSSOAP1.dll.
Dim sc As New MSSOAPLib.SoapClient
sc.mssoapinit 
"http://192.168.0.8/VSService/Service1.asmx?WSDL"
Text3.Text = sc.Add(CInt(Text1.Text), CInt(Text2.Text))

4.ASP调用,安装SoapToolkit20.exe。添加References:C:\Program Files\Common Files\MSSoap\Binaries\MSSOAP1.dll.
<%
Dim t1,t2,t3,SSO
t1 
= Request.Form("text1")
t2 
= Request.Form("text2")
SET  SSO = Server.CreateObject("MSSOAP.SoapClient")  
SSO.ClientProperty(
"ServerHTTPRequest")  =  True  
Call  SSO.mssoapinit("http://192.168.0.8/VSService/Service1.asmx?WSDL")  
t3
=SSO.add(CInt(t1),CInt(t2))  
%>
<form action="http.asp" METHOD="POST">
  
<div align="center" >
  
<input type="text" name="text1" value="0">
  
<input type="text" name="text2" value="0">
  
<input type="text" name="text3" value="<%=t3%>">
  
</div>
<br>
 
<div align="center" ><input type="submit" name="Submit" value="Ìá½»"></div>
</form>

5. ASP HTTP请求:

 

<%
Dim t1,t2,t3
t1 
= Request.Form("text1")
t2 
= Request.Form("text2")
url 
= "http://192.168.0.8/VSService/Service1.asmx/add"
SoapRequest="a="&t1&"&b="&t2&""
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open 
"POST",url,false
xmlhttp.setRequestHeader 
"Content-Type", "application/x-www-form-urlencoded"
xmlhttp.setRequestHeader "HOST","192.168.0.8"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.Send(SoapRequest) 
If xmlhttp.Status = 200 Then
 
Set xmlDOC = server.CreateObject("MSXML.DOMDocument")
 xmlDOC.load(xmlhttp.responseXML) 
 t3
=xmlDOC.childNodes(1).Text
 
Set xmlDOC = nothing
Else
 Response.Write xmlhttp.Status
&"&nbsp;"
 Response.Write xmlhttp.StatusText
End if
Set xmlhttp = Nothing
%>
<form action="http.asp" METHOD="POST">
  
<div align="center" >
  
<input type="text" name="text1" value="0">
  
<input type="text" name="text2" value="0">
  
<input type="text" name="text3" value="<%=t3%>">
  
</div>
<br>
 
<div align="center" ><input type="submit" name="Submit" value="提交"></div>
</form>

posted on 2005-07-13 01:42 MingIsMe 阅读(3422) 评论(0)  编辑  收藏 所属分类: 01 ASP/HTML

 
Powered by:
BlogJava
Copyright © MingIsMe