VB6.0调用WebServices的简单示例
2007-08-30 14:36
176 查看
在.NET平台中期望值最高,广告做的最多的要算是WebServices了。WebServices是Web上的类,与Web应用程序不同的是,这个类不返回HTML页面,只以XML文档返回一个或几个值。因此,任何能够处理XML的应用程序都可以调用其方法和使用其结果。WebServices更多是Internet上的应用,不过小型企业内部系统开发使用WebServices,也有许多好处。个人认为,与COM+和DCOM相比,从布置到维护,WebServices更胜一筹。同时,从COM数据据传输转换到XML大大提高了应用程序的伸缩性和相互操作性,对不同的需求,可以用不同的语言开发相应的应用程序,并共享数据。 这里不深入探讨WebServices和XML,只示例通过VB6.0调用VS2005编译的WebServices。
作为VB6.0的程序员和爱好者,数据库开发中的ADO 2.0是再熟悉不过的了。不过.NET平台对ADO的结构体系作了扩展,增加了组件,解决了其不足,优化了性能,也就是ADO.NET。与熟悉的ADO相比,已经有太多的不同。那么,如何在VB6.0中通过WebServices获取记录集呢?示例如下:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'==================== WebServices的代码 ===================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'首先要在COM组件中添加ADO
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web.Services
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web.Services.Protocols
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Data
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Data.Odbc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Configuration.ConfigurationManager
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Xml
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports ADODB
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<WebService(Namespace :Namespace:="http://tempuri.org/")> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Class TESTClass TEST
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Inherits System.Web.Services.WebService
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'读取config中的连接字符串
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Function cnString()Function cnString() As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return ConnectionStrings("connToPgSql").ToString()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'ADO记录集转换为XML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Function RecordsetToXmlTest()Function RecordsetToXmlTest(ByVal Uid As String) As XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from where uid='" & Uid & "'"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As New Connection
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim rs As New Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim st As New Stream
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim xd As New XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.ConnectionString = cnString
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Open(sql, cn, CursorTypeEnum.adOpenForwardOnly, LockTypeEnum.adLockReadOnly, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Save(st, PersistFormatEnum.adPersistXML)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st.Flush()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st.Position = 0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
xd.LoadXml(st.ReadText(st.Size))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return xd
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
xd = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Class
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
''======================== VB6.0 的代码 ======================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'引用 Microsoft XML, v6.0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'引用 Microsoft ActiveX Data objects 2.x Library
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim rs As ADODB.Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim strURL As String, strRequest As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strURL = "http://localhost/BWR/TEST.asmx/RecordsetToXmlTest"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strRequest = "Uid=admin"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.Open "POST", strURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.send (strRequest)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'oXmlDoc.Save (App.Path & " s.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set rs = New ADODB.Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Open oXmlDoc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
While Not rs.EOF
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Debug.Print rs("uid") & rs("username") & rs("pwd")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.MoveNext
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Wend
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set XMLHTTP = Nohting
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set DOMDocument = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set rs = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
其实WebServices通过紧密集成XML而提供相互操作性,从上面的代码中也可以看出,WebServices是以XML文档返回ADO记录集的。所以我们可以完全放弃ADO,而是用ADO.NET相关对象,通过WebServices返回XML文档。下面的示例就是WebServices返回ADO.NET的DataSet:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'========================== WebServices代码 ============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'DataSet和XmlDataDocument是同步的,可以根据情况直接返回DataSet,XML包含的信息多
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function DataSetToXmlTest()Function DataSetToXmlTest() As XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from material"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As OdbcConnection = New OdbcConnection(cnString.ToString())
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim da As OdbcDataAdapter = New OdbcDataAdapter(sql, cn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim ds As New DataSet
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
da.Fill(ds, "material")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Close()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim xmlDoc As XmlDataDocument = New XmlDataDocument(ds)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return xmlDoc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'======================= VB6的代码 ============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim strWebserviceURL As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strWebserviceURL = "http://localhost/BWR/TEST.asmx/DataSetToXmlTest"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.Open "POST", strWebserviceURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.send
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'oXmlDoc.Save (App.Path & "ds.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'查询
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNode As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodes As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = oXmlDoc.documentElement.selectNodes("material[cat='VCD-S']")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'得到xml文档中cat="VCD-S"的所有集合
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNode In oXmlNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Debug.Print oXmlNode.Text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNode = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
对于WebServices返回常用的数据类型和数组,除了上面的调用方法之外,还可用Soap相关对象直接得到数据,下面是返回String数组的示例:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=============================== WebServices代码 ===============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function ArrayTest()Function ArrayTest(ByVal i As Short, ByVal j As Short) As String()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim s(2) As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s(1) = "A;" & (i + j)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s(2) = "B;" & (i - j)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return s
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=================================== VB 代码 =================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'引用 Microsoft Soap Type Library
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oSC As New SoapClient
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim s() As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim i As Integer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oSC.ClientProperty("ServerHTTPRequest") = True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oSC.mssoapinit ("http://localhost/BWR/TEST.asmx?WSDL")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
s = oSC.ArrayTest(9871, 250)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oSC = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For i = 0 To UBound(s)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Debug.Print s(i)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
让人惊喜的是WebServices可以自定义数据类型,如果是.NET平台,你可以在客户端直接声明WebServices中自定义的数据类型。VB6这样做当然是不行的了,不过你依然可以通过其返回的XML得到你想要的数据。下面的示例是,VB6调用WebServices通过ArrayLis返回的一个WebServices自定义数据类型的集合:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=============================== WebServices代码 ===============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'自定义结构
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Structure WSTypeStructure WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim CName As String '客户
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim PName As String '产品名称
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim Qty As Short '交易数量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim Price As Decimal '交易价格
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim SoDate As String '交易日期
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Structure
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'这个服务必须
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function GetWSType()Function GetWSType(ByVal cName As String, ByVal pName As String, _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ByVal Qty As Short, ByVal Price As Decimal, ByVal soDate As String) As WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim mWSType As New WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.CName = cName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.PName = pName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.Qty = Qty
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.Price = Price
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.SoDate = soDate
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return (WSType)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function GetTBWebInfo()Function GetTBWebInfo(ByVal soDate As Date) As ArrayList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from soitem where sodate='"& soDate &"'"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As OdbcConnection = New OdbcConnection(cnString.ToString())
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim da As OdbcDataAdapter = New OdbcDataAdapter(sql, cn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim ds As New DataSet
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim wt As WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim arr As New ArrayList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
da.Fill(ds, "soitem")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Close()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim r As DataRow
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
For Each r In ds.Tables(0).Rows
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wt = New WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wt= GetWSType( r.Item("cname"),r.Item("pname"), _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
r.Item("qty"),r.Item("price"),r.Item("soDate"))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
arr.Add(wt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return arr
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=================================== VB 代码 =================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNode As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodes As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodeChd As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodeChds As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim strWebserviceURL As String, strRequest As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim i As Integer, row As Integer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strWebserviceURL = "http://localhost/BWR/TBWeb.asmx/GetTBWebInfo"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strRequest = "strWeb=2007-08-30" '传递参数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.Open "POST", strWebserviceURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.send (strRequest)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'载入回转的xml(一个带有WS自定义类型的arraylist)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'oXmlDoc.Save (App.Path & "aTB.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'从xml中获取相关信息,并显示
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = oXmlDoc.documentElement.selectNodes("anyType")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
fg.Clear 'fg是表格控件
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Call Fg_Initialize
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNode In oXmlNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
i = 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChds = oXmlNode.childNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
With fg
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
.Rows = .Rows + 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
row = .Rows - 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNodeChd In oXmlNodeChds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
.TextMatrix(row, i) = oXmlNodeChd.Text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
i = i + 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
End With
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChd = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChds = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNode = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
以上是工作中遇到的问题,主要就是在传统POS机(800M的CPU,32M内存,WIN98系统)上,通过VB调用WebServices实现了,对FreeBSD平台下PostgreSQL数据库的读写,感觉挺好......
作为VB6.0的程序员和爱好者,数据库开发中的ADO 2.0是再熟悉不过的了。不过.NET平台对ADO的结构体系作了扩展,增加了组件,解决了其不足,优化了性能,也就是ADO.NET。与熟悉的ADO相比,已经有太多的不同。那么,如何在VB6.0中通过WebServices获取记录集呢?示例如下:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'==================== WebServices的代码 ===================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'首先要在COM组件中添加ADO
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web.Services
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Web.Services.Protocols
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Data
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Data.Odbc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Configuration.ConfigurationManager
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports System.Xml
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Imports ADODB
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<WebService(Namespace :Namespace:="http://tempuri.org/")> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Class TESTClass TEST
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Inherits System.Web.Services.WebService
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'读取config中的连接字符串
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Function cnString()Function cnString() As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return ConnectionStrings("connToPgSql").ToString()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'ADO记录集转换为XML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
Public Function RecordsetToXmlTest()Function RecordsetToXmlTest(ByVal Uid As String) As XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from where uid='" & Uid & "'"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As New Connection
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim rs As New Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim st As New Stream
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim xd As New XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.ConnectionString = cnString
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Open(sql, cn, CursorTypeEnum.adOpenForwardOnly, LockTypeEnum.adLockReadOnly, 1)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Save(st, PersistFormatEnum.adPersistXML)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st.Flush()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st.Position = 0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
xd.LoadXml(st.ReadText(st.Size))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return xd
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
st = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
xd = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
End Class
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
''======================== VB6.0 的代码 ======================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'引用 Microsoft XML, v6.0
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'引用 Microsoft ActiveX Data objects 2.x Library
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim rs As ADODB.Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim strURL As String, strRequest As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strURL = "http://localhost/BWR/TEST.asmx/RecordsetToXmlTest"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strRequest = "Uid=admin"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.Open "POST", strURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oHTTP.send (strRequest)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
'oXmlDoc.Save (App.Path & " s.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set rs = New ADODB.Recordset
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.Open oXmlDoc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
While Not rs.EOF
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Debug.Print rs("uid") & rs("username") & rs("pwd")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
rs.MoveNext
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Wend
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set XMLHTTP = Nohting
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set DOMDocument = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Set rs = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
其实WebServices通过紧密集成XML而提供相互操作性,从上面的代码中也可以看出,WebServices是以XML文档返回ADO记录集的。所以我们可以完全放弃ADO,而是用ADO.NET相关对象,通过WebServices返回XML文档。下面的示例就是WebServices返回ADO.NET的DataSet:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'========================== WebServices代码 ============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'DataSet和XmlDataDocument是同步的,可以根据情况直接返回DataSet,XML包含的信息多
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function DataSetToXmlTest()Function DataSetToXmlTest() As XmlDataDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from material"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As OdbcConnection = New OdbcConnection(cnString.ToString())
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim da As OdbcDataAdapter = New OdbcDataAdapter(sql, cn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim ds As New DataSet
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
da.Fill(ds, "material")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Close()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim xmlDoc As XmlDataDocument = New XmlDataDocument(ds)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return xmlDoc
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'======================= VB6的代码 ============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim strWebserviceURL As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strWebserviceURL = "http://localhost/BWR/TEST.asmx/DataSetToXmlTest"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.Open "POST", strWebserviceURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.send
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'oXmlDoc.Save (App.Path & "ds.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'查询
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNode As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodes As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = oXmlDoc.documentElement.selectNodes("material[cat='VCD-S']")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'得到xml文档中cat="VCD-S"的所有集合
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNode In oXmlNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Debug.Print oXmlNode.Text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNode = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
对于WebServices返回常用的数据类型和数组,除了上面的调用方法之外,还可用Soap相关对象直接得到数据,下面是返回String数组的示例:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=============================== WebServices代码 ===============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function ArrayTest()Function ArrayTest(ByVal i As Short, ByVal j As Short) As String()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim s(2) As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s(1) = "A;" & (i + j)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
s(2) = "B;" & (i - j)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return s
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=================================== VB 代码 =================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'引用 Microsoft Soap Type Library
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oSC As New SoapClient
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim s() As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim i As Integer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oSC.ClientProperty("ServerHTTPRequest") = True
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oSC.mssoapinit ("http://localhost/BWR/TEST.asmx?WSDL")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
s = oSC.ArrayTest(9871, 250)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oSC = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For i = 0 To UBound(s)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Debug.Print s(i)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
让人惊喜的是WebServices可以自定义数据类型,如果是.NET平台,你可以在客户端直接声明WebServices中自定义的数据类型。VB6这样做当然是不行的了,不过你依然可以通过其返回的XML得到你想要的数据。下面的示例是,VB6调用WebServices通过ArrayLis返回的一个WebServices自定义数据类型的集合:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=============================== WebServices代码 ===============================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'自定义结构
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Structure WSTypeStructure WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim CName As String '客户
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim PName As String '产品名称
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim Qty As Short '交易数量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim Price As Decimal '交易价格
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim SoDate As String '交易日期
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Structure
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'这个服务必须
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function GetWSType()Function GetWSType(ByVal cName As String, ByVal pName As String, _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
ByVal Qty As Short, ByVal Price As Decimal, ByVal soDate As String) As WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim mWSType As New WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.CName = cName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.PName = pName
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.Qty = Qty
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.Price = Price
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
mWSType.SoDate = soDate
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return (WSType)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<WebMethod()> _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
Public Function GetTBWebInfo()Function GetTBWebInfo(ByVal soDate As Date) As ArrayList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim sql As String = "select * from soitem where sodate='"& soDate &"'"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim cn As OdbcConnection = New OdbcConnection(cnString.ToString())
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim da As OdbcDataAdapter = New OdbcDataAdapter(sql, cn)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim ds As New DataSet
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim wt As WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim arr As New ArrayList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Open()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
da.Fill(ds, "soitem")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
cn.Close()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Dim r As DataRow
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
For Each r In ds.Tables(0).Rows
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wt = New WSType
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
wt= GetWSType( r.Item("cname"),r.Item("pname"), _
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
r.Item("qty"),r.Item("price"),r.Item("soDate"))
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
arr.Add(wt)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Return arr
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
End Function
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'=================================== VB 代码 =================================
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oHTTP As XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlDoc As DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNode As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodes As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodeChd As IXMLDOMNode
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim oXmlNodeChds As IXMLDOMNodeList
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim strWebserviceURL As String, strRequest As String
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Dim i As Integer, row As Integer
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strWebserviceURL = "http://localhost/BWR/TBWeb.asmx/GetTBWebInfo"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
strRequest = "strWeb=2007-08-30" '传递参数
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = New XMLHTTP
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.Open "POST", strWebserviceURL, False
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oHTTP.send (strRequest)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'载入回转的xml(一个带有WS自定义类型的arraylist)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = New DOMDocument
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
oXmlDoc.Load oHTTP.responseXML
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'oXmlDoc.Save (App.Path & "aTB.xml")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
'从xml中获取相关信息,并显示
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = oXmlDoc.documentElement.selectNodes("anyType")
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
fg.Clear 'fg是表格控件
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Call Fg_Initialize
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNode In oXmlNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
i = 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChds = oXmlNode.childNodes
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
With fg
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
.Rows = .Rows + 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
row = .Rows - 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
For Each oXmlNodeChd In oXmlNodeChds
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
.TextMatrix(row, i) = oXmlNodeChd.Text
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
i = i + 1
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
End With
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Next
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oHTTP = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlDoc = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChd = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodeChds = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNode = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
Set oXmlNodes = Nothing
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
以上是工作中遇到的问题,主要就是在传统POS机(800M的CPU,32M内存,WIN98系统)上,通过VB调用WebServices实现了,对FreeBSD平台下PostgreSQL数据库的读写,感觉挺好......
相关文章推荐
- Qt(C++)调用工业相机Basler的SDK简单使用示例
- C# 创建、部署和调用WebService的简单示例 webservice 可以用于分布式应用程序之间的交互,和不同程序之间的交互。 概念性的东西就不说太多,下面开始创建一个简单的webservi
- jsp页面获取服务器时间的简单调用示例
- JSP 调用 JAVA 方法修改数据库【简单示例】
- C# 创建、部署和调用WebService的简单示例
- 调用WebService---简单示例图解
- servlet简单示例+调用webservice服务
- 用jna实现调用c++的dll简单示例
- SharePoint 2013 调用WCF服务简单示例
- java 调用mysql的存储过程(简单示例)
- Webservice简单调用示例
- Java简单实现调用命令行并获取执行结果示例
- 一个简单的AXIS远程调用Web Service示例
- 使用Delphi调用WebServices接口的简单应用实例
- C#调用Python脚本的简单示例
- Java远程调用BPS流程实现流程运行简单示例
- C# 创建、部署和调用WebService简单示例
- jsp页面获取服务器时间的简单调用示例
- SilverLight4调用WCF简单示例
- VB.NET中的DLL编写和调用的简单示例