从ASP.NET网站到WCF服务的客户端请求问题,不同的子域 [英] Problems with client-side request from ASP.NET sites to WCF service, different subdomains

查看:97
本文介绍了从ASP.NET网站到WCF服务的客户端请求问题,不同的子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个ASP.NET站点,它们托管在同一个域(不同的子域)上,并通过HTTPS进行工作.

我拥有WCF服务,该服务托管在同一域中.

我有用于会话的单独的状态服务器.

所有站点都使用无cookie会话(如果有人问为什么-我稍后会回复,但这是必须")

在我的站点上,我使用Telerik的网格组件(但实际上没关系),该组件从WCF服务中请求数据,并且必须填充此数据.

问题是:

1)我无法通过javascript向WCF服务发出POST请求:出于某种原因,它总是GET或OPTIONS(无论我使用Sys.Net.WebServiceProxy调用还是仅使用普通的jquery AJAX请求).即使我指示为COOKIE模式,也并非没有cookie,它都会发生.也许因为这个原因,我收到"405方法不允许"错误-为POST请求设置了WCF,但是该站点发送GET ...

2)我无法从我的网站检索SESSION!我尝试了发现的方法,但是WCF始终使用OWN会话,而不是连接"到现有的ASP.NET会话,尽管在ASP.NET兼容模式下也是如此.我需要SESSION在我的站点和WCF服务之间交换数据

3)我目前还不知道,鉴于上述问题,在上述数据之间交换数据时如何管理安全性...

4)我不完全知道WCF服务的web.config在我的情况下应该是什么样子,因为我已经看到了很多不同的变体,但都是一些简单的情况.

非常感谢您的帮助!我已经被困了2到3个星期,远远落后于计划,但是仍然无法正常工作...

I have several ASP.NET sites, hosted on the same domain (different subdomains) and working via HTTPS.

I have WCF service, hosted on the same domain.

I have a separate state server for sessions.

All sites use cookieless session (if someone asks why - i will reply later, but it''s a ''must'')

On my sites, I use grid components from Telerik (but actually it does not matter) that ask for data from WCF service and must be filled with this data.

The problems are:

1) I cannot manage to make POST request to WCF service from javascript: for some reason it''s always either GET or OPTIONS (no matter if I use Sys.Net.WebServiceProxy invoke or just a plain jquery AJAX request). It happens even if I indicate COOKIE mode, not cookieless. Maybe because of this I am getting "405 Method not allowed" error - WCF is set for POST request, but the site sends GET...

2) I cannot manage to retrieve SESSION from my websites! I tried approach, that I found, but WCF always uses OWN session, instead of ''connecting'' to existing ASP.NET session, despite on ASP.NET compatibility mode. I need SESSION to exchange data between my sites and WCF service

3) I don''t have idea currently, how to manage security when exchanging data between mentioned ones, in the light of above-mentioned problems...

4) I don''t know exactly, how web.config for WCF service should look like in my case, because I''ve seen tons of different variants, but all for some simple cases.

Would be really appreciated for the help! I''m stuck for 2 or 3 weeks already, far behind the plan, but nothing still works...

推荐答案

我最终将WCF服务移到了网络下,因此会有一个WCF服务PER网站
I ended up with moving WCF service under web, so will have a WCF service PER web site


这篇关于从ASP.NET网站到WCF服务的客户端请求问题,不同的子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆