miércoles, 2 de julio de 2014

Call WebService and Send params VB6

' (This is Visual Basic 6 code.)
Private Sub Form_Load()
   
    ' Create the SoapClient.
    Dim SoapClient As MSSOAPLib30.SoapClient30
    Set SoapClient = New MSSOAPLib30.SoapClient30
   
    ' Use the Init method to generate a proxy 
    Dim WSDLPath As String
    WSDLPath = "http://localhost/VBCookbookWebServices/Recipe16-2.asmx?WSDL"
    Call SoapClient.MSSoapInit(WSDLPath)
   
    ' Call the GetDate web method to retrieve some information.
    MsgBox("Server returned: " & SoapClient.GetDate())
   
End Sub
'Other Function 
Public Function XVALIDATEQR(ByVal pRfce As String, ByVal pRfcr As String, ByVal pMonto As Double, ByVal pUUID As String) As Integer
    Dim vSOAPcnt As New SoapClient30
    Dim vResult As String
    Set vSOAPcnt = New SoapClient30
    
    Call vSOAPcnt.MSSoapInit("http://urlService.asmx?wsdl")
    vResult = vSOAPcnt.ExpImpresa(txtrfce.Text, txtrfcr.Text, txtmonto.Text, txtUUID.Text)
    
    MsgBox ("Server returned: " & vResult)
                     
End Function