我有一个WCF
基于 Web 服务并托管在用c#
. 我想在我的GWT client side
.
请检查以下代码:
url = "localhost:8089/request"
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
Request response = builder.sendRequest(null, new RequestCallback() {
@override
public void onResponseReceived(Request request, Response response) {
Window.alert(response + " ");
}
});
每次我尝试运行代码时,它都会显示“ http://localhost:8089 is not allowed by Access-Control-Allow-Origin.
”
PS:我搜索了这个错误,但我不想禁用所有浏览器的网络安全。
是否有任何替代解决方案可以让response
服务器localhost
在同一台机器上的不同色情片上运行。这就是为什么我想在客户端调用一个 url。
请提出解决方案。
编辑
让我分点向您解释完整的场景:
GWT application is hosted on some server (www.abc.com)
WCF is a web service installed at each client.
A client open his/her browser and put the url (www.abc.com/page)
This page want to access the web services hosted on a client machine.