[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2718
  • Last Modified:

VS2008 create web service from a supplied WSDL (using vb.net)

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
0
SamSherwin
Asked:
SamSherwin
  • 3
  • 2
1 Solution
 
Luis PérezSoftware Architect in .NetCommented:
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.
0
 
SamSherwinAuthor Commented:
Roland

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

Well Done and many thanks.
0
 
SamSherwinAuthor Commented:
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?

Thanks
0
 
Luis PérezSoftware Architect in .NetCommented:
In solution explorer, right click on your project's file (I guess it will be an ASP.net web site or an ASP.net 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.
0
 
SamSherwinAuthor Commented:
Brilliant

Thank again.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now