jQuery .ajax() POST Request throws 405 (Method Not Allowed) on RESTful WCF

Your code is actually attempting to make a Cross-domain (CORS) request, not an ordinary POST. That is: Modern browsers will only allow Ajax calls to services in the same domain as the HTML page. Example: A page in http://www.example.com/myPage.html can only directly request services that are in http://www.example.com, like http://www.example.com/testservice/etc. If the service is in …

Read more

Can you call a webservice from TSQL code?

Yes , you can create like this CREATE PROCEDURE CALLWEBSERVICE(@Para1 ,@Para2) AS BEGIN Declare @Object as Int; Declare @ResponseText as Varchar(8000); Exec sp_OACreate ‘MSXML2.XMLHTTP’, @Object OUT; Exec sp_OAMethod @Object, ‘open’, NULL, ‘get’, ‘http://www.webservicex.com/stockquote.asmx/GetQuote?symbol=MSFT’,’false’ Exec sp_OAMethod @Object, ‘send’ Exec sp_OAMethod @Object, ‘responseText’, @ResponseText OUTPUT Select @ResponseText Exec sp_OADestroy @Object END

Why do people want to deliver both Json and XML as output to their REST interfaces?

A completely different reason than what’s been said so far — REST interfaces are about Resources, and each Resource has an identifier, which are URLs. Just because you want the Resource in a different serialization, be it XML, JSON, HTML, or something else, we’re still describing the same Resource. So, instead of giving a different …

Read more