views:

228

answers:

2

I have to implement a SOAP web service that conforms to a (large) standard schema for the travel industry. Here's an example .XSD file:

http://www.opentravel.org/2008B/OTA_HotelAvailRQ.xsd

I think that rules out simply putting a [WebMethod] attribute to a method. How do you recommend implementing an existing schema using C#?

PS: I'm using WCF, C# 3 and the server has .NET 3.5 installed.

Thanks

+1  A: 

Have you tried loading the schema using xsd.exe from the Visual Studio Command Line? This generates a file of clr objects.

http://msdn.microsoft.com/en-us/library/x6c1kb0s(VS.71).aspx

bendewey
Yes it generates the classes but the SOAP Envelop it's different.
Julio César
Do you have access to a WSDL?
bendewey
+1  A: 

You could create the classes with XSD.EXE, and return them from your WCF service (you meant [OperationContract], not [WebMethod]). But you have to configure to use the XML Serializer, not the Data Contract Serializer.

John Saunders