Reputation: 13256
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
Upvotes: 1
Views: 674
Reputation: 161773
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.
Upvotes: 1
Reputation: 40235
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
Upvotes: 1