Results 1 to 10 of 10

Thread: How to use web services?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    How to use web services?

    Hi guys. Im planing to transfer 1 data entry in my database to the server using web services, is this possible? how to do it? i have no idea.

    The client computer and server are not connected on LAN, my data transfer is via net.

    Thanks

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: How to use web services?

    To consume a web service from a vb6 app, you could use the SOAP Toolkit 3.0

    The web service in the server can be developed using vb6 or vb.net

    JG

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: How to use web services?

    do you have samples?

    what im planing is my current vb6 application will send a delimited string to the web service then the web service will process this and save to the server database, then response if successful or failed.

  4. #4
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: How to use web services?


  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: How to use web services?

    Im not familiar with it, and i guess it will take some time for me create another module for soap. Is there a way that vb6 can call a asp classic web services?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: How to use web services?

    Code:
    <!--#include file="db.asp"-->
    <!--#include file="FUNCTIONS.asp"-->
    <&#37;
    
    Dim strValue
    dim aResult, mResult
    
    strValue = Request.Querystring("strValue")
    
    Select Case lcase(strValue)
    
    	Case "autosync"
    		aResult = LookUp("Status","MAINTENANCE","Code = 'AutoImport'")
    		mResult = Lookup("Status","MAINTENANCE","Code = 'ManualImport'")
    
    		If aResult = 1 or mResult = 1 then
    			response.write "RUNNING"
    		Else
    			response.write "OK"
    		End if
    		
    	Case "masterdatasync"
    		If LookUp("Status","MAINTENANCE","Code = 'MasterDataSync'") = 1 then
    			response.write "ON"
    		Else
    			response.write "OFF"
    		End if
    		
    	Case "productsync"
    		If LookUp("Status","MAINTENANCE","Code = 'ProductSync'") = 1 then
    			response.write "ON"
    		Else
    			response.write "OFF"
    		End if
    		
    End Select
    I have this asp file, how can i call it in my vb6 application?

  7. #7
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: How to use web services?

    Did you read the article inside the link in post #4 ?
    In a vb6 app, once referenced SOAP toolkit, with 3 lines max you can call the web service and recieve response

    JG

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How to use web services?

    "Web Service" can be a vague term.

    SOAP is just one form they can take. Using the SOAPClient30 in a mindless fashion can work but only when nothing but simple data types are involved, and it still requires a hosted WSDL at the server site.


    Using any of this in a copy/paste fashion is going to lead to lots of trial and error. You might try learning how it works first. For what you want the SOAP Toolkit is no help at all.

    You have a simple HTTP GET to do here passing your strValue as a query string. No SOAP at all, and not even REST. For this you could use the AsyncRead method in VB6, the INet control, an XMLHTTPRequest object, a WinHTTPRequest object, the list goes on and on.

    Example:
    Code:
    Private Function Request(ByVal URL As String, ByVal Value As String) As String
        With New WinHttp.WinHttpRequest
            .Open "GET", URL & "?strValue=" & Value, False
            .Send
            Request = .ResponseText
        End With
    End Function
    See: WinHttpRequest Object

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    398

    Re: How to use web services?

    How to add WinHttp.WinHttpRequest?

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: How to use web services?

    Microsoft WinHTTP Services, version 5.1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width