You can also define your hosted service web.config setting in Global.asax file. If you have defined setting in web.config then there is no need to do here.
i just do not understand what is relation between wcf and asp.net. suppose wcf is running in pc1 and 3rd party user calling my wcf service from his pc using aspx and jquery. by jquery user may call wcf but i do not know for that we need
to specify any setting for cross domain call for wcf service ?
just see the code cross domain related things setup in global.asax how it is possible ? how client can set the setting for wcf service ?
please help me to understand what is going on. thanks
The Cross-domain HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. Generally speaking, the default behavior of web browsers is to block cross-domain accesses if they feel that the types
of accesses are un-safe. To address this problem, we will need the WCF Service to explicitly tell the web browsers that cross-domain access is allowed. This can be done in the Global.asax.cs file. If your service is not configured correctly, the browser doesn’t
cooperate and you don’t see anything at all. This is by design.
wcf project has different template. when we use wcf service library and do host in IIS or out side of iis then there is no global.asax file. so tell me in this kind of situation how could i allow Cross-domain ?
where to set the entry for Cross-domain request when there is no global.asax file ?
Contributor
2231 Points
3706 Posts
Calling Cross Domain call for WCF Service using Jquery
Dec 02, 2016 01:01 PM|sudip_inn|LINK
just reading a write up on Calling Cross Domain WCF Service using Jquery from this url http://www.dotnettricks.com/learn/wcf/calling-cross-domain-wcf-service-using-jquery
see these code
Global.asax Code
You can also define your hosted service web.config setting in Global.asax file. If you have defined setting in web.config then there is no need to do here.
i just do not understand what is relation between wcf and asp.net. suppose wcf is running in pc1 and 3rd party user calling my wcf service from his pc using aspx and jquery. by jquery user may call wcf but i do not know for that we need to specify any setting for cross domain call for wcf service ?
just see the code cross domain related things setup in global.asax how it is possible ? how client can set the setting for wcf service ?
please help me to understand what is going on. thanks
All-Star
17652 Points
3510 Posts
Re: Calling Cross Domain call for WCF Service using Jquery
Dec 05, 2016 10:04 AM|Chris Zhao|LINK
Hi Sudip_inn,
The Cross-domain HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. Generally speaking, the default behavior of web browsers is to block cross-domain accesses if they feel that the types of accesses are un-safe. To address this problem, we will need the WCF Service to explicitly tell the web browsers that cross-domain access is allowed. This can be done in the Global.asax.cs file. If your service is not configured correctly, the browser doesn’t cooperate and you don’t see anything at all. This is by design.
Best Regards,
Chris
Contributor
2231 Points
3706 Posts
Re: Calling Cross Domain call for WCF Service using Jquery
Dec 06, 2016 07:46 AM|sudip_inn|LINK
wcf project has different template. when we use wcf service library and do host in IIS or out side of iis then there is no global.asax file. so tell me in this kind of situation how could i allow Cross-domain ?
where to set the entry for Cross-domain request when there is no global.asax file ?
All-Star
17652 Points
3510 Posts
Re: Calling Cross Domain call for WCF Service using Jquery
Dec 07, 2016 05:29 AM|Chris Zhao|LINK
Hi Sudip_inn,
You can enable CORS on a service hosted on IIS or IIS Express by adding the following configuration in the config file.
Best Regards,
Chris
Contributor
2231 Points
3706 Posts
Re: Calling Cross Domain call for WCF Service using Jquery
Dec 07, 2016 09:37 AM|sudip_inn|LINK
do i need to add it in app.config file or web.config file ?
when we self host wcf in windows service then how can we enable cors ?