views:

53

answers:

3

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

+2  A: 

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

Ben Robinson
+1  A: 

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).

Tuzo
A: 

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 M