What is considered the best way to expose a type to another application over the web?
I know that this is possible by creating a type defined in a web service (WCF). Although, the consuming application wouldn’t actually be making any method/service calls. Would it still be advisable to do this? Is there a better alternative?
Edit 1:
There is a website that needs to invoke our PC application. We are using a custom registered protocol which will allow them to pass query-string parameters to us. Many of these parameters are currently defined as Enum types. My goal is to expose these types so that the calling website is able to serialize the data and pass it via the query string safely.
Edit 2: Would JSON be a good way to achieve this? I haven’t really delved into it too much but reading an overview seems like it would be a great alternative to what I’ve been rambling on about 😉
If you are asking about exposing complex types for webservices:
My webservices have either simple standard types linke integer or boolean or strings that contain xml for complex data.
the xml can be described by xsd-files to verify the content. There are also tools for many platforms that generate source code from xsd for the objectmodell. (i.e xsd.exe for Dotnet) there
I would use xsd.
If you want your api with structred types insted of xml you have to process yourself the article Contract-First Web Services my be helpful