Foxtable(狐表)用户栏目专家坐堂 → 请问,foxtable如何使用通过wsdl.exe生成的vb文件(接口服务文件)


  共有4940人关注过本帖树形打印复制链接

主题:请问,foxtable如何使用通过wsdl.exe生成的vb文件(接口服务文件)

帅哥哟,离线,有人找我吗?
yd0731
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
请问,foxtable如何使用通过wsdl.exe生成的vb文件(接口服务文件)  发帖心情 Post By:2013/12/24 12:08:00 [显示全部帖子]

请问各位老师,目前手上有别人开发好的myFirstProxyClass.vb(通过wsdl.exe生成的vb接口服务文件,目前没有参数需要输入),请问如何在foxtable中使用它来获取webserver提供的数据呢,请老师指点。
[此贴子已经被作者于2013-12-24 12:09:17编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 12:19:00 [显示全部帖子]

狐爸,这个跟我上次的发帖不一样,这个是已经生成了一个vb的接口文件(myFirstProxyClass.vb),这个文件在本地机器上面,现在是如何通过foxtable来使用这个本地的文件,而不是通过一个url地址去调用webserver服务获取数据。

 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 14:00:00 [显示全部帖子]

狐爸,以下代码是myFirstProxyClass.vb的内容,请问如何在全局代码中使用?

 

'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:2.0.50727.42
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'This source code was auto-generated by wsdl, Version=2.0.50727.1432.
'

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Web.Services.WebServiceBindingAttribute(Name:="CfgCompManagerServiceSOAP", [Namespace]:="http://service.lrd.org.cn"),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(getAllCfgCompResponse)),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(getAllCfgComp)),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(CfgComp))>  _
Partial Public Class CfgCompManagerService
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
   
    Private getAllCfgCompOperationCompleted As System.Threading.SendOrPostCallback
   
    '''<remarks/>
    Public Sub New()
        MyBase.New
        Me.Url = "http://localhost:8080/cfmSoa/ns"
    End Sub
   
    '''<remarks/>
    Public Event getAllCfgCompCompleted As getAllCfgCompCompletedEventHandler
   
    '''<remarks/>
    <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://service.lrd.org.cn/NewOperation", RequestNamespace:="http://service.lrd.org.cn", ResponseNamespace:="http://service.lrd.org.cn", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
    Public Function getAllCfgComp() As <System.Xml.Serialization.XmlElementAttribute("CfgComp", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> Object()
        Dim results() As Object = Me.Invoke("getAllCfgComp", New Object(-1) {})
        Return CType(results(0),Object())
    End Function
   
    '''<remarks/>
    Public Function BegingetAllCfgComp(ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
        Return Me.BeginInvoke("getAllCfgComp", New Object(-1) {}, callback, asyncState)
    End Function
   
    '''<remarks/>
    Public Function EndgetAllCfgComp(ByVal asyncResult As System.IAsyncResult) As Object()
        Dim results() As Object = Me.EndInvoke(asyncResult)
        Return CType(results(0),Object())
    End Function
   
    '''<remarks/>
    Public Overloads Sub getAllCfgCompAsync()
        Me.getAllCfgCompAsync(Nothing)
    End Sub
   
    '''<remarks/>
    Public Overloads Sub getAllCfgCompAsync(ByVal userState As Object)
        If (Me.getAllCfgCompOperationCompleted Is Nothing) Then
            Me.getAllCfgCompOperationCompleted = AddressOf Me.OngetAllCfgCompOperationCompleted
        End If
        Me.InvokeAsync("getAllCfgComp", New Object(-1) {}, Me.getAllCfgCompOperationCompleted, userState)
    End Sub
   
    Private Sub OngetAllCfgCompOperationCompleted(ByVal arg As Object)
        If (Not (Me.getAllCfgCompCompletedEvent) Is Nothing) Then
            Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
            RaiseEvent getAllCfgCompCompleted(Me, New getAllCfgCompCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
        End If
    End Sub
   
    '''<remarks/>
    Public Shadows Sub CancelAsync(ByVal userState As Object)
        MyBase.CancelAsync(userState)
    End Sub
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class getAllCfgCompResponse
   
    Private cfgCompField() As Object
   
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute("CfgComp", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
    Public Property CfgComp() As Object()
        Get
            Return Me.cfgCompField
        End Get
        Set
            Me.cfgCompField = value
        End Set
    End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class getAllCfgComp
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class CfgComp
   
    Private companyIdField As String
   
    Private tagSeqField As String
   
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="integer")>  _
    Public Property companyId() As String
        Get
            Return Me.companyIdField
        End Get
        Set
            Me.companyIdField = value
        End Set
    End Property
   
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="integer")>  _
    Public Property tagSeq() As String
        Get
            Return Me.tagSeqField
        End Get
        Set
            Me.tagSeqField = value
        End Set
    End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")>  _
Public Delegate Sub getAllCfgCompCompletedEventHandler(ByVal sender As Object, ByVal e As getAllCfgCompCompletedEventArgs)

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code")>  _
Partial Public Class getAllCfgCompCompletedEventArgs
    Inherits System.ComponentModel.AsyncCompletedEventArgs
   
    Private results() As Object
   
    Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
        MyBase.New(exception, cancelled, userState)
        Me.results = results
    End Sub
   
    '''<remarks/>
    Public ReadOnly Property Result() As Object()
        Get
            Me.RaiseExceptionIfNecessary
            Return CType(Me.results(0),Object())
        End Get
    End Property
End Class

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:myfirstproxyclass.rar

[此贴子已经被作者于2013-12-24 14:15:53编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 14:24:00 [显示全部帖子]

求教老师

 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 14:34:00 [显示全部帖子]

wsdl的地址为:http://1xx.xxx.xx.165:8080/cfmSoa/ns?wsdl
--------------------------------------------------通过浏览器打开该地址后为

  <?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.lrd.org.cn" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="CfgCompManagerService" targetNamespace="http://service.lrd.org.cn">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.lrd.org.cn" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://service.lrd.org.cn">
  <xsd:include schemaLocation="http://1xx.xxx.xx:8080/cfmSoa/ns?xsd=CfgComp.xsd" />
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="getAllCfgComp">
  <wsdl:part element="tns:getAllCfgComp" name="parameters" />
  </wsdl:message>
+ <wsdl:message name="getAllCfgCompResponse">
  <wsdl:part element="tns:getAllCfgCompResponse" name="parameters" />
  </wsdl:message>
- <wsdl:portType name="ICfgCompManagerService">
- <wsdl:operation name="getAllCfgComp">
  <wsdl:input message="tns:getAllCfgComp" />
  <wsdl:output message="tns:getAllCfgCompResponse" />
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="CfgCompManagerServiceSOAP" type="tns:ICfgCompManagerService">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getAllCfgComp">
  <soap:operation soapAction="http://service.lrd.org.cn/NewOperation" />
- <wsdl:input>
  <soap:body use="literal" />
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" />
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="CfgCompManagerService">
- <wsdl:port binding="tns:CfgCompManagerServiceSOAP" name="CfgCompManagerServicePort">
  <soap:address location="http://1xx.xxx.xx:8080/cfmSoa/ns" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

 

 

 

----------------------------------------------------

通过soapui工具查询上面的wsdl提供的webserver服务后,得到下面的结果:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:getAllCfgCompResponse xmlns:ns2="http://service.lrd.org.cn">
         <CfgComp>
            <companyId>8634</companyId>
            <tagSeq>10000002</tagSeq>
         </CfgComp>
         <CfgComp>
            <companyId>8630</companyId>
            <tagSeq>10000001</tagSeq>
         </CfgComp>
      </ns2:getAllCfgCompResponse>
   </soap:Body>
</soap:Envelope>

目前是不知道如何通过foxtable来获取到上面的数据,比如要得到<companyId>8634</companyId>,<tagSeq>10000002</tagSeq>中间的8634和10000002


 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 14:52:00 [显示全部帖子]

以下是引用Bin在2013-12-24 14:30:00的发言:

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Web.Services.WebServiceBindingAttribute(Name:="CfgCompManagerServiceSOAP", [Namespace]:="http://service.lrd.org.cn"),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(getAllCfgCompResponse)),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(getAllCfgComp)),  _
 System.Xml.Serialization.XmlIncludeAttribute(GetType(CfgComp))>  _
Partial Public Class CfgCompManagerService
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
    
    Private getAllCfgCompOperationCompleted As System.Threading.SendOrPostCallback
    
    '''<remarks/>
    Public Sub New()
        MyBase.New
        Me.Url = "http://localhost:8080/cfmSoa/ns"
    End Sub
    
    '''<remarks/>
    Public Event getAllCfgCompCompleted As getAllCfgCompCompletedEventHandler
    
    '''<remarks/>
    <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://service.lrd.org.cn/NewOperation", RequestNamespace:="http://service.lrd.org.cn", ResponseNamespace:="http://service.lrd.org.cn", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)>  _
    Public Function getAllCfgComp() As <System.Xml.Serialization.XmlElementAttribute("CfgComp", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> Object()
        Dim results() As Object = Me.Invoke("getAllCfgComp", New Object(-1) {})
        Return CType(results(0),Object())
    End Function
    
    '''<remarks/>
    Public Function BegingetAllCfgComp(ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
        Return Me.BeginInvoke("getAllCfgComp", New Object(-1) {}, callback, asyncState)
    End Function
    
    '''<remarks/>
    Public Function EndgetAllCfgComp(ByVal asyncResult As System.IAsyncResult) As Object()
        Dim results() As Object = Me.EndInvoke(asyncResult)
        Return CType(results(0),Object())
    End Function
    
    '''<remarks/>
    Public Overloads Sub getAllCfgCompAsync()
        Me.getAllCfgCompAsync(Nothing)
    End Sub
    
    '''<remarks/>
    Public Overloads Sub getAllCfgCompAsync(ByVal userState As Object)
        If (Me.getAllCfgCompOperationCompleted Is Nothing) Then
            Me.getAllCfgCompOperationCompleted = AddressOf Me.OngetAllCfgCompOperationCompleted
        End If
        Me.InvokeAsync("getAllCfgComp", New Object(-1) {}, Me.getAllCfgCompOperationCompleted, userState)
    End Sub
    
    Private Sub OngetAllCfgCompOperationCompleted(ByVal arg As Object)
        If (Not (Me.getAllCfgCompCompletedEvent) Is Nothing) Then
            Dim invokeArgs As System.Web.Services.Protocols.InvokeCompletedEventArgs = CType(arg,System.Web.Services.Protocols.InvokeCompletedEventArgs)
            RaiseEvent getAllCfgCompCompleted(Me, New getAllCfgCompCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState))
        End If
    End Sub
    
    '''<remarks/>
    Public Shadows Sub CancelAsync(ByVal userState As Object)
        MyBase.CancelAsync(userState)
    End Sub
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class getAllCfgCompResponse
    
    Private cfgCompField() As Object
    
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute("CfgComp", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>  _
    Public Property CfgComp() As Object()
        Get
            Return Me.cfgCompField
        End Get
        Set
            Me.cfgCompField = value
        End Set
    End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class getAllCfgComp
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.SerializableAttribute(),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code"),  _
 System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://service.lrd.org.cn")>  _
Partial Public Class CfgComp
    
    Private companyIdField As String
    
    Private tagSeqField As String
    
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="integer")>  _
    Public Property companyId() As String
        Get
            Return Me.companyIdField
        End Get
        Set
            Me.companyIdField = value
        End Set
    End Property
    
    '''<remarks/>
    <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="integer")>  _
    Public Property tagSeq() As String
        Get
            Return Me.tagSeqField
        End Get
        Set
            Me.tagSeqField = value
        End Set
    End Property
End Class

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")>  _
Public Delegate Sub getAllCfgCompCompletedEventHandler(ByVal sender As Object, ByVal e As getAllCfgCompCompletedEventArgs)

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432"),  _
 System.Diagnostics.DebuggerStepThroughAttribute(),  _
 System.ComponentModel.DesignerCategoryAttribute("code")>  _
Partial Public Class getAllCfgCompCompletedEventArgs
    Inherits System.ComponentModel.AsyncCompletedEventArgs
    
    Private results() As Object
    
    Friend Sub New(ByVal results() As Object, ByVal exception As System.Exception, ByVal cancelled As Boolean, ByVal userState As Object)
        MyBase.New(exception, cancelled, userState)
        Me.results = results
    End Sub
    
    '''<remarks/>
    Public ReadOnly Property Result() As Object()
        Get
            Me.RaiseExceptionIfNecessary
            Return CType(Me.results(0),Object())
        End Get
    End Property


这一段复制到全局代码,对应的DLL引用好.


图片点击可在新窗口打开查看此主题相关图片如下:无标题.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:无标题1.jpg
图片点击可在新窗口打开查看
有点甜老师,有报错信息,还有需要引用dll文件,是指上面图片的dll文件吗(System.Data.dll和System.XML.dll 两个foxtable还像已经引用了,是不是将System.dll和System.Web.Services.dll补上引用就可以了)?
[此贴子已经被作者于2013-12-24 14:56:09编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
yd0731
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:290 积分:2086 威望:0 精华:0 注册:2013/11/23 10:11:00
  发帖心情 Post By:2013/12/24 15:15:00 [显示全部帖子]

继续等待

 回到顶部