Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 2 - Calling a Web Service using VB6 with SOAP ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Calling a Web Service using VB6 with SOAP 3.0
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 49
    2006-04-12

    Table of Contents:
  • Calling a Web Service using VB6 with SOAP 3.0
  • The web services used in the tutorial
  • Example 2: Calling a ColdFusion web service
  • Example 3: SOAP client calling the Enc/Denc web service

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Calling a Web Service using VB6 with SOAP 3.0 - The web services used in the tutorial


    (Page 2 of 4 )

    The following are the web services for which client applications call the services using VB 6.0 code. Herein two of the services considered in earlier tutorials will be used.

    The first service to be called is a web service created using ColdFusion. The details of this service are described in a tutorial that will appear in the future in DevArticles.com with the title Creating a Web Service with ColdFusion: the Basics. In brief, a registered CFC (ColdFusion Component)  which is based on a ColdFusion function shown below is implemented as the web service:

    <cfcomponent>
    <cffunction name="WelcomeMsg" access="remote" returntype="string" 
    output="no"> <cfargument name="name" type="string" required="yes"> <cfreturn "<h3><font color='blue'>Welcome to my Web Service Site
    </font></h3> " & arguments.name &"! " & "What would you like to do?"> </cffunction> </cfcomponent>

    In the above service the web service method name is WelcomeMsg(). It just takes one argument, which is a string. The service will return a html fragment after processing and adding some tags.

    The client coding with VB6, example 1: Calling a ColdFusion web service

    The first thing to do is create a standard EXE project. In this case a generic client is declared, and this is set using the CreateObject() function with the object Id being the MSSoapClient.

    Add a text box and a command button to your form. To the click event of the command button add the following code. This is the case of late binding, as no type library is referenced. You may check that in the object browser.

    Private Sub Command1_Click()
    Dim client
    Set client = CreateObject("MSSOAP.SoapClient30")
    oClient.MSSoapInit _ "http://localhost/CF_WebSvc/justFunction.cfc?wsdl"

    strg = (oClient.WelcomeMsg(Text1.Text))
    MsgBox (strg)

    If Err.Number = -2147024809 Then
    MsgBox "Invalid Web Service Request. Please check the Web Service URL"
    End If

    End Sub

    It is assumed that you have the service hosted on the localhost at the designated directory. Make sure that your web reference is showing a valid WSDL. The question is, how does one know that the client has a method called WelcomeMsg()? This is where the WSDL can be used to advantage as it will show both the request sent and the responses expected, as well as the methods called. Please review earlier tutorials.

    When you run the above code you should get the following response from the web service.

    More Visual Basic.NET Articles
    More By Jayaram Krishnaswamy


       · Web services in one form or another is here to stay. A number of easy to understand...
       · The article is good to begin with. Is SOAP a generic solution for communicating...
       · What kind of difficulty did you experience. Lots of time it is to do with the data...
       · It is possible to call a web service method using VB6 with SOAP 3.0.It is ok if...
       · Could you be little more specific? I am not sure what exactly you are trying to...
       · Hi, I am facing problem to "Calling Web Services in VB6"If any one already...
       · Could be more specific as to what kind of a problem?
       · code that can call web service
       · Your answer is very brief and I cannot fathom the exact problem you are having.The...
       · Does the client server need the MS SOAP Toolkit installing before you can use SOAP...
       · I have followed exaactly the same from the tutorial but it prompt an error. The...
       · Well, now i roughly know what caused this to happen. It only happen when i am using...
       · Hi,is it possible to pass some credential information like user name and...
       · Hi Jay,Im getting the follwoing error when trying to use VB 6.0 to access a...
       · If you receive this error message try the suggestion below:Connector:Connection...
       · how to call a web service created using vb.net.how to use the vb6 application to...
     

    VISUAL BASIC.NET ARTICLES

    - Creating and Drawing a Game Map in VB.NET
    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway