views:

108

answers:

1

I am working on creating a API (using WCF) that will expose some of the internal systems of an ecommerce company to the outside world. The target users of the API are mostly small businesses who may not have extensive develper resources. To ensure the evolution of the API in the future, i have decided that the input and output parameters of the API would be strings (xml doucment converted to string). This got me thinking of all the possible ways that once after receiving the strings into my methods and generating xml documents from them, how would i go about mapping this xml document to strongly typed objects that i have access to - these objects are used in the internal system that my api exposes.

What are the best practices in getting a xml document converted into strongly typed classes (keep in mind though, that i cannot directly convert the xml into objects as in some cases, i would have to add additional information in the api to build the objects that are needed by internal systems)

+1  A: 

WCF maps the request messages to objects automatically. You specify how it does that, with the DataContract attribute, and its friends.

You might want to read up on the basics, here.

Cheeso