How to create a webservice from a given WSDL in VS2010

Posted on 2012-08-16
Last Modified: 2012-08-21

I've been given a (set of) wsdl file(s) with about 40 xsd files, which are included in the wsdl (and xsd, complete tree-structure).

I need to create a webservice so the other party can send standardised messages to consume my webservice.

I'm using Visual Studio 2010 with

I've been trying to use wsdl.exe and svcutil.exe to create the classes I need, but both keep giving error messages. From what I've read, I should use svcutil. But somehow svcutil has problems with the load of xsd-files, I've already added all subdirectories with *.xsd to the command, so it looks like:

svcutil /t:code "D:\service.wsdl" "D:\xsd\folder1\*.xsd" "D:\xsd\folder2\*.xsd" /l:vb 

Open in new window

Instead of /t:code I also used /mc and /dataContractOnly, but to no avail.

Any suggestions?
Question by:DBIC
    LVL 83

    Expert Comment

    Usually WSDL files are given by the vendor of the webservices to the consumer not the other way round and those exes are used to generate the client side proxies for consuming those services not to generate the service itself.

    Author Comment

    I know, but this is really the other way round. They have their own services which send out messages, which should be consumed by their customers. The customer (for whom we are building the webservice) receives the messages and then can handle the contents as he wishes (for example import in a customer specific application).

    So I need to create the webservice with standard interface, based on the wsdl and xsd files.

    Accepted Solution

    I got it to work. Wrote out all paths to all 62 individual xsd files, excluded 1 that caused errors and tried again. Finally the vb files were created. I tried the /mc and /t:code options. /dataContractOnly still gave errors.
    Now I'll have to figure out the differences between the generated vb-files and decide which one to use... And see if I can split the code into several files, because one vb-file with over 32000 lines is a bit big to handle.

    But the main thing of this question is solved.

    Author Closing Comment

    Figured out how to do it myself, as stated in my solution.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 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

    20 Experts available now in Live!

    Get 1:1 Help Now