Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 30, 2012 04:33 AM by panesofglass
Dec 23, 2012 07:49 AM|LINK
Is it possible to hae out parameters in web API action? If yes, then how to make a call to this action?
Dec 23, 2012 12:38 PM|LINK
WebAPI isn't about objects and methods -- it's about HTTP. HTTP has a request and a response. So the way to think about this is that you can send a request and you can get back a response.
Dec 23, 2012 12:44 PM|LINK
Well said dear! I got your point... So, in wcf which uses SOAP, has more options... we can define out parameters which it adds in response automatically... What would you say about this? Asking from general concept clarifcation....
Dec 23, 2012 12:58 PM|LINK
I'd almost say the same thing about SOAP -- it's a messaging protocol. The main difference is that WebAPI is closer to the protocol than WCF.
I'd suggest going thru the tutorials: http://www.asp.net/web-api
Dec 23, 2012 01:00 PM|LINK
Thanks a lot for your kind response! :)
Dec 23, 2012 03:19 PM|LINK
Dec 23, 2012 03:38 PM|LINK
Actually, I have some services which are exposed by WCF on SOAP. Now, I am providng the REST interface for same services. We were using some out parameters of basic types (i.e. string, int etc.) in some methods and when I tried the same method signature
in Web API, it was failing while making a call. So, I just wanted to confirm is there any way to do so or is it incorrect in REST world...
Dec 30, 2012 04:33 AM|LINK
I imagine the corollary in the Web API world would be to return a Tuple containing the multiple values you want to return. That's about as much as I can offer, as I've never used out parameters in WCF and don't understand exactly how that would correctly
format a response.