4

I have been provided to a wsdl file by another business to build webservice so that the other business can connect to service I build using the provided wsdl and xsd files. I am dot net developer using wcf. I want to know where to start having the wsdl and xsd files in hand.

Thanks

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
jama64
  • 93
  • 1
  • 3
  • 6

3 Answers3

6

Hopefully, the schemas and WSDL are .NET friendly. If you want to use WCF, you can generate your classes using SvcUtil.exe.

svcutil -noconfig -serializer:datacontractserializer -d:../
 -namespace:*,MyCompany.Services.ServiceName wsdl.wsdl Messages.xsd Data.xsd

The bad news is that svcutil actually generates the client side proxy so you have to manually go and remove the client and channel classes.

For a full description of this approach see Schema-based Development with Windows Communication Foundation.

In the article, they also talk about a Visual Studio add-in, WSCF.blue, that allows you to do Data contract generation (among other contract first development tasks).

Randy Levy
  • 22,566
  • 4
  • 68
  • 94
3

You can use the .net wsdl tool and xsd tool to auto generate your classes.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Ben Robinson
  • 21,601
  • 5
  • 62
  • 79
0

The quick and lazy way of doing it is simply to use add reference in VS (assuming .net3.5 +) or add web reference for .net 2; and allow VS to do the work.

http://www.eggheadcafe.com/tutorials/aspnet/a1647f10-9aa4-4b0c-bbd9-dfa51a9fab8e/adding-wcf-service-refere.aspx

As ( http://andrewtokeley.net/archive/2008/07/10/the-difference-between-ldquoadd-web-referencerdquo-and-ldquoadd-service-referencerdquo.aspx ) says its basically a wrapper for the functions the Tuzo and Ben added.

Makes life easier though and with the 'Add service wrapper' you can use the advanced settings to automatically generate ASync classes & Data Contracts.

Chris McKee
  • 4,298
  • 10
  • 48
  • 83