Calling Cross Domain WCF Service using Jquery

There is no guarantee that the WCF services and client application will be hosted under same domain. When you try to call cross domain WCF service hosted in different domain using client script, it behaves differently on different browsers.

When you want to perform “POST” or “GET” request on cross domain WCF service or normal service using jquery/javascript or ajax, the browser actually sends an “OPTIONS” verb call to your WCF service that is not mention in your WCF method attribute. We mention there “POST” or “GET” to call a WCF service method and hence get error to call cross domain WCF service.In this case the client request headers method type is “OPTION” not “POST” and the response headers has content-type “text/html; charset=UTF-8” instead of “json;charset=UTF-8”.

To change these options we need to do some changes in web.config of hosted WCF service.

Ready to Build
Something
Extraordinary?

Join 300+ companies who trust us to turn their biggest ideas into market-leading solutions.

Our Global Team
500+ Engineers Worldwide
SOC 2 Certified

Get in Touch with Us

Our Global Team
500+ Engineers Worldwide
SOC 2 Certified

InApp India Office

121 Nila, Technopark Campus
Trivandrum, Kerala 695581
+91 (471) 277 -1800
mktg@inapp.com

InApp USA Office

999 Commercial St. Ste 210 Palo Alto, CA 94303
+1 (650) 283-7833
mktg@inapp.com

InApp Japan Office

6-12 Misuzugaoka, Aoba-ku
Yokohama,225-0016
+81-45-978-0788
mktg@inapp.com
Terms Of Use
© 2000-2026 InApp, All Rights Reserved