VS2008 create web service from a supplied WSDL (using

Posted on 2012-09-18
Last Modified: 2012-09-18
Hi All

I'm just getting into web services and struggling a fair amount.
I've been given a wsdl. I need to import into VS2008 and create a web service based on this wsdl.
I've read many articles but they all see to cover consuming services not creating them from wsdl.

I'm looking for step by step instructions to create the service.
I'm good with the hosting on iis and consuming services so just need to know how to create web service from the supplied wsdl.

Many Thanks
Question by:SamSherwin
    LVL 25

    Accepted Solution

    Ok, let's try:
    1.- Open Start Menu, Programs, Microsoft Visual Studio 2008, Visual Studio Tools, Visual Studio 2008 System symbol (I don't know if this is the exact text, my Visual Studio is in Spanish; is the one whose icon is a command line C:\).
    2.- In the command line, go to the directory in which the .wsdl file is.
    3.- Once in the directory, type this:

    wsdl.exe myfilename.wsdl /l:VB /serverInterface

    (Obviously, replace myfilename.wsdl with the real name of your .wsdl file).

    This action will generate a .vb file containing the Interface that you need to adjust to. Next, go to your Visual Studio project and import (add file) this .vb file. Open the file and take a look at the Interface name (the line "Public Interface XXXX").

    Add a new web service, in the web service code file, just below the

    Inherits System.Web.Services.WebService
    add this line;
    Implements XXXX 'Use the Interface name, the one in the "Public Interface XXXX"

    And that's all, your web service code file fills with all the method declarations that you need in your web service. Now, you need to make the code for each one of these methods.

    Hope that helps.

    Author Closing Comment


    That was a fantastic, clear step by step guide, just what I was looking for.

    Well Done and many thanks.

    Author Comment

    Hi Roland

    Could you explain this just a bit more please.

    Add a new web service, in the web service code file.

    I don't seem to have an option of adding a web service?

    LVL 25

    Expert Comment

    by:Luis Pérez
    In solution explorer, right click on your project's file (I guess it will be an web site or an web service project) and then go to add -> New item. IN the list of possible items to add, choose Web service. Then an .asmx file adds to your project, with a .asmx.vb associated file. Right-click the .asmx file and choose "View code" to view the code in the .asmx.vb file. In this .asmx.vb file is where you have to write "Implements XXXX".

    Hope that helps.

    Author Comment


    Thank again.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This video is a brief demonstration on how to use security groups and Network Access Control Lists (ACLs) in Amazon Web Services.  Security groups and Network ACLs are mechanisms you can use in AWS to control network traffic.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now