tags:

views:

353

answers:

1

Hi, I have a WCF service (XML+JSON) running on http://servicehost:8080/myService. My ASP.NET application with jQuery is running on http://webapp/Login.aspx

I want jQuery to use Ajax and call the URL http://servicehost:8080/myService. The browser does not allow this cross-host call, which is expected. Some of the posts on stackoverflow suggested using JSONP. Is that the only option?

Is there a way to define a proxy service on the http://webapp and have it access the remote WCF service?

Thanks

Abhi

A: 

Is there a way to define a proxy service on the http://webapp and have it access the remote WCF service?

Yes, and that's what I'd do. There are a lot of ways to do it. If you use a load-balancer or other front-end proxy software, you could route there. Also, you could proxy with IIS proxy server

http://windowsitpro.com/article/articleid/8322/extending-iis-with-proxy-server.html

There are third-party and open-source alternatives (e.g. Apache could be just your proxy)

Probably, you'd want to do something like that anyway -- not everyone can open up port 8080 (like inside of corporate firewalls).

Lou Franco