开发者

Creating Platform Independent Web Services with Visual Studio

开发者 https://www.devze.com 2023-02-02 17:19 出处:网络
I am creating a web service in C# using Visual Studio 2010开发者_开发技巧. I believe doing so generates a SOAP service. But my real question is what kinds of things should I avoid to ensure this web s

I am creating a web service in C# using Visual Studio 2010开发者_开发技巧. I believe doing so generates a SOAP service. But my real question is what kinds of things should I avoid to ensure this web service is platform independent. I assume using parameters like DateTime would be bad, and returning types like DataSet or DataTable would also make non .NET clients unhappy.

Can someone shed some light on this?

Bonus: what is a good/quick/easy way to test a webservice to make sure it works outside of the .NET world?


I think a REST service.

Couple of links:

http://www.petefreitag.com/item/431.cfm

http://www.dotnetspark.com/kb/1408-creating-rest-service-step-by-step-tutorial.aspx

About testing you can read here: https://stackoverflow.com/questions/414875/best-tool-framework-for-testing-a-restful-service


DateTime is a part of SOAP. Datasets and datatables are more tricky; depending on client, it may come across as either XML or an ad-hoc dynamic data structure. PHP, if I recall correctly, does the latter.


In terms of simple data types you'd probably be best in sticking to what you can define with XML Schema. DateTime shouldn't be a problem, as long as it's formatted correctly. You can return complex data structures no problem, as long as you define it clearly. Just don't expect to be able top return an object serialized from asp.net and have someone able to plug it straight in when you return it to them :-)

If you haven't looked at WSDL then you might get something out of reading this: http://www.w3.org/TR/wsdl

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号