Connecting Tech Pros Worldwide Forums | Help | Site Map

Ajax calls web service in wcf(windows service)

=?Utf-8?B?QmlsbHkgWmhhbmc=?=
Guest
 
Posts: n/a
#1: Jul 30 '08
我们现在遇到一个问题,通过wcf创建 webservice,选择windows
service作为宿主,采用java作为客户端调 用成功,但是*法使用asp.net ajax调用。
我们参考了http://msdn.microsoft.com/zh-cn/libr...应的sample
code,但是发现这些sample基本上都需要 iis上部署一个svc文件,但是*据当前 业务需求,我们*法部署iis服务器。
是否有windows service host的wcf service与asp.net ajax协作的解决方案?谢谢。


Steven Cheng [MSFT]
Guest
 
Posts: n/a
#2: Jul 30 '08

re: Ajax calls web service in wcf(windows service)


Hi Billy,

The thread content is displayed as garbo code, have you verified that all
the contents are posted via UTF8 or other unicode format? You can try first
paste them into a notepad with unicode encoding and repost the content
again to see whether it works.

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>Subject: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 01:57:01 -0700
Quote:
>
>我们现在遇到一个问题,通过wcf创建 webservice,选择windo
ws
Quote:
>service作为宿主,采用java作为客户端 用成功,但是*法
用asp.net ajax调用?
我们参考了http://msdn.microsoft.com/zh-cn/libr...0.aspx的资
,并且下载了相应的sample
Quote:
>code,但是发现这些sample基本上都需要 在iis上部署一个svc
件,但是*据当前业务需求,我们* 部署iis服务器?
是否有windows service host的wcf service与asp.net
ajax协作的解决方案?谢谢?
Quote:
>
=?Utf-8?B?QmlsbHkgWmhhbmc=?=
Guest
 
Posts: n/a
#3: Jul 30 '08

re: Ajax calls web service in wcf(windows service)


I wrote it in Chinese, could you read Chinese in your tool?

"Steven Cheng [MSFT]" wrote:
Quote:
Hi Billy,
>
The thread content is displayed as garbo code, have you verified that all
the contents are posted via UTF8 or other unicode format? You can try first
paste them into a notepad with unicode encoding and repost the content
again to see whether it works.
>
Sincerely,
>
Steven Cheng
Microsoft MSDN Online Support Lead
>
>
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
--------------------
>
Quote:
From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
Subject: Ajax calls web service in wcf(windows service)
Date: Wed, 30 Jul 2008 01:57:01 -0700
>
Quote:

æˆ‘ä»¬çŽ°åœ¨é‡åˆ°ä¸€ä¸ é—®é¢˜ï¼Œé€šè¿‡wcf创建 çš„webservice,选择windo
ws
Quote:
serviceä½œä¸ºå®¿ä¸»ï¼Œé‡‡ç” ¨java作为客户端调用 ˆå*Ÿï¼Œä½*æ˜¯æ— æ³•ä
½¿ç”¨asp.net ajax调用ã€?
我们参考äº*http://msdn.microsoft.com/zh-cn/libr...资æ–
™ï¼Œå¹¶ä¸”下载äº*相 º”çš„sample
Quote:
code,ä½*是发现这些 sample基本ä¸*都需要在i isä¸*部署一个svcæ–
‡ä»¶ï¼Œä½*æ˜¯æ ¹æ®å½“å‰ä¸šå*¡éœ€æ±‚ï ¼Œæˆ‘ä»¬æ— æ³•éƒ¨ç½²iis服å*¡å™¨ã€?
是否有windows service host的wcf service与asp.net
ajax协作的解å*³æ–¹æ¡ˆ ¼Ÿè°¢è°¢ã€?
>
Quote:
>
>
Steven Cheng [MSFT]
Guest
 
Posts: n/a
#4: Jul 31 '08

re: Ajax calls web service in wcf(windows service)


Hi Billy,

I have performed some research on this. Here is some information I've got
so far:

As for the ASP.NET client script based AJAX call, it is limited by the web
page script model. For all the web pages in webbrowser, webbrowser will
restrict the script to access pages on remote server. For example, if your
page is from http://serverA , if your script try use some script
component to send webrequest to other server/application, it is not
allowed. And this also restrict the AJAX method call to remote
applications(webservice or wcf). I've even tried call WCF on the same
machine(different server application), it is now allowed.

So far, one way to make such remote WCF method call I can get is create a
local server-side page method in which you use server-side code to call the
remote WCF service. And your page's client-side script call this
server-side page_method via AJAX. How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
<4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
Quote:
>Subject: RE: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 02:46:05 -0700
Quote:
>
>I wrote it in Chinese, could you read Chinese in your tool?
>
>"Steven Cheng [MSFT]" wrote:
>
Quote:
>Hi Billy,
>>
>The thread content is displayed as garbo code, have you verified that
all
Quote:
Quote:
>the contents are posted via UTF8 or other unicode format? You can try
first
Quote:
Quote:
>paste them into a notepad with unicode encoding and repost the content
>again to see whether it works.
>>
>Sincerely,
>>
>Steven Cheng
>Microsoft MSDN Online Support Lead
>>
>>
>Delighting our customers is our #1 priority. We welcome your comments
and
Quote:
Quote:
>suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:
>feel free to let my manager know what you think of the level of service
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>>
>--------------------
>>
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>Subject: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 01:57:01 -0700
>>
Quote:
>
>>
>æˆ‘ä»¬çŽ°åœ¨é‡åˆ°ä¸€ä¸ ªé—®é¢˜ï¼Œé€
šè¿‡wcf创建的webserviceï¼Œé €‰æ‹©windo
Quote:
Quote:
>ws
>>
>serviceä½œä¸ºå®¿ä¸»ï¼Œé‡‡ç ¨java作为客
ˆ·ç«¯è°ƒç”¨æˆå*Ÿï¼Œä½* ˜¯æ?法?
Quote:
½¿ç”¨asp.net ajax调用ã€?
Quote:
>>
我们参考äº*http://msdn.microsoft.com/zh-cn/library/bb
410780.aspx的资æ?
Quote:
™ï¼Œå¹¶ä¸”下载äº*相 º”çš„sample
Quote:
>>
>code,ä½*æ˜¯å‘çŽ°è¿™äº sample基本ä¸*
ƒ½éœ€è¦åœ¨iisä¸*éƒ¨ç½²ä¸ ä¸ªsvcæ?
Quote:
>
‡ä»¶ï¼Œä½*是?¹æ®å½“å‰ ä¸šå*¡éœ€æ±
,我们æ?法部署iisæ œå*¡å™¨ã€?
Quote:
Quote:
>是否有windows service host的wcf service与asp.net
>ajax协作的解å*³æ–¹æ¡ˆ ?谢谢ã€?
>>
Quote:
>
>>
>>
>
=?Utf-8?B?QmlsbHkgWmhhbmc=?=
Guest
 
Posts: n/a
#5: Jul 31 '08

re: Ajax calls web service in wcf(windows service)


As you said, this also restrict the AJAX method call to remote
applications(webservice or wcf).

But actually I could call the web service in other IIS site by using Ajax.

Do I misunderstand you?



"Steven Cheng [MSFT]" wrote:
Quote:
Hi Billy,
>
I have performed some research on this. Here is some information I've got
so far:
>
As for the ASP.NET client script based AJAX call, it is limited by the web
page script model. For all the web pages in webbrowser, webbrowser will
restrict the script to access pages on remote server. For example, if your
page is from http://serverA , if your script try use some script
component to send webrequest to other server/application, it is not
allowed. And this also restrict the AJAX method call to remote
applications(webservice or wcf). I've even tried call WCF on the same
machine(different server application), it is now allowed.
>
So far, one way to make such remote WCF method call I can get is create a
local server-side page method in which you use server-side code to call the
remote WCF service. And your page's client-side script call this
server-side page_method via AJAX. How do you think?
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
>
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Quote:
From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
<4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
Quote:
Subject: RE: Ajax calls web service in wcf(windows service)
Date: Wed, 30 Jul 2008 02:46:05 -0700
>
Quote:

I wrote it in Chinese, could you read Chinese in your tool?

"Steven Cheng [MSFT]" wrote:
Quote:
Hi Billy,
>
The thread content is displayed as garbo code, have you verified that
all
Quote:
Quote:
the contents are posted via UTF8 or other unicode format? You can try
first
Quote:
Quote:
paste them into a notepad with unicode encoding and repost the content
again to see whether it works.
>
Sincerely,
>
Steven Cheng
Microsoft MSDN Online Support Lead
>
>
Delighting our customers is our #1 priority. We welcome your comments
and
Quote:
Quote:
suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
--------------------
>
From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
Subject: Ajax calls web service in wcf(windows service)
Date: Wed, 30 Jul 2008 01:57:01 -0700
>

>
æË*‘们现åœ ¨Ã©Ââ€¡Ã¥Ë*°ä¸€ä ¸ªé—®é¢˜ï¼Œ ©â‚¬
šè¿‡wcfÃ¥Ë*݌ȼ çš„webservice,é€ €°Ã¦â€¹Â©windo
Quote:
Quote:
ws
>
service作为宿䠸»ï¼Œ采甠¨java作为客Ã
¦Ë*·ç«¯è°ƒç” æË*åŠŸï¼Œä½†æ˜¯æâ€?法Ã?
Quote:
½¿ç”¨asp.net ajax调用ã€?
Quote:
>
æË*‘们参è⠬ƒäº†http://msdn.microsoft.com/zh-cn/library/bb
410780.aspx的资�
Quote:
™ï¼Œå¹¶ä¸”à ¸‹è½½äº†ç›¸åº”çš„sampl e
Quote:
>
code,但是发现è¿⠢些sample基本 上Ã
©Æ’½éœ€è¦åœ ¨iis上部署一丠ªsvcæâ€?
Quote:
‡ä»¶ï¼Œä½†æ˜¯Ã?¹æ®å½“å ‰ä¸šåŠ¡éœ€æ±â
€šÃ¯Â¼Å’æË*‘们æ â€?法部署iis ¦Å“åС噍ã€?
Quote:
Quote:
是否有windows service host的wcf service与asp.net
ajax协作的蠧£å†³æ–¹æ¡Ë*?è °Â¢Ã¨Â°Â¢Ã£â‚¬?
>

>
>
>
>
=?Utf-8?B?QmlsbHkgWmhhbmc=?=
Guest
 
Posts: n/a
#6: Jul 31 '08

re: Ajax calls web service in wcf(windows service)


OK, please close it as resolved, thank you!


"Steven Cheng [MSFT]" wrote:
Quote:
Hi Billy,
>
I have performed some research on this. Here is some information I've got
so far:
>
As for the ASP.NET client script based AJAX call, it is limited by the web
page script model. For all the web pages in webbrowser, webbrowser will
restrict the script to access pages on remote server. For example, if your
page is from http://serverA , if your script try use some script
component to send webrequest to other server/application, it is not
allowed. And this also restrict the AJAX method call to remote
applications(webservice or wcf). I've even tried call WCF on the same
machine(different server application), it is now allowed.
>
So far, one way to make such remote WCF method call I can get is create a
local server-side page method in which you use server-side code to call the
remote WCF service. And your page's client-side script call this
server-side page_method via AJAX. How do you think?
>
Sincerely,
>
Steven Cheng
>
Microsoft MSDN Online Support Lead
>
>
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
>
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Quote:
From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
<4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
Quote:
Subject: RE: Ajax calls web service in wcf(windows service)
Date: Wed, 30 Jul 2008 02:46:05 -0700
>
Quote:

I wrote it in Chinese, could you read Chinese in your tool?

"Steven Cheng [MSFT]" wrote:
Quote:
Hi Billy,
>
The thread content is displayed as garbo code, have you verified that
all
Quote:
Quote:
the contents are posted via UTF8 or other unicode format? You can try
first
Quote:
Quote:
paste them into a notepad with unicode encoding and repost the content
again to see whether it works.
>
Sincerely,
>
Steven Cheng
Microsoft MSDN Online Support Lead
>
>
Delighting our customers is our #1 priority. We welcome your comments
and
Quote:
Quote:
suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
>
--------------------
>
From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
Subject: Ajax calls web service in wcf(windows service)
Date: Wed, 30 Jul 2008 01:57:01 -0700
>

>
æË*‘们现åœ ¨Ã©Ââ€¡Ã¥Ë*°ä¸€ä ¸ªé—®é¢˜ï¼Œ ©â‚¬
šè¿‡wcfÃ¥Ë*݌ȼ çš„webservice,é€ €°Ã¦â€¹Â©windo
Quote:
Quote:
ws
>
service作为宿䠸»ï¼Œ采甠¨java作为客Ã
¦Ë*·ç«¯è°ƒç” æË*åŠŸï¼Œä½†æ˜¯æâ€?法Ã?
Quote:
½¿ç”¨asp.net ajax调用ã€?
Quote:
>
æË*‘们参è⠬ƒäº†http://msdn.microsoft.com/zh-cn/library/bb
410780.aspx的资�
Quote:
™ï¼Œå¹¶ä¸”à ¸‹è½½äº†ç›¸åº”çš„sampl e
Quote:
>
code,但是发现è¿⠢些sample基本 上Ã
©Æ’½éœ€è¦åœ ¨iis上部署一丠ªsvcæâ€?
Quote:
‡ä»¶ï¼Œä½†æ˜¯Ã?¹æ®å½“å ‰ä¸šåŠ¡éœ€æ±â
€šÃ¯Â¼Å’æË*‘们æ â€?法部署iis ¦Å“åС噍ã€?
Quote:
Quote:
是否有windows service host的wcf service与asp.net
ajax协作的蠧£å†³æ–¹æ¡Ë*?è °Â¢Ã¨Â°Â¢Ã£â‚¬?
>

>
>
>
>
Steven Cheng [MSFT]
Guest
 
Posts: n/a
#7: Jul 31 '08

re: Ajax calls web service in wcf(windows service)


Thanks or your reply.

Yes, this is a "cross-browser" script restriction which prevent script to
interact with remote site(domain).

Anyway, so far for your scenario, two possible solutions are available:

1. use AJAX call to invoke local server-side page method and let
server-side to call the WCF service

2. Move the WCF to the local site/application(at least need to have the
same main domain server name) with your web page application.

If there is anything else need help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
<4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
<CE156F5B-963C-4C53-9B83-8C69840CB704@microsoft.com>
<GW9MRCs8IHA.4376@TK2MSFTNGHUB02.phx.gbl>
Quote:
>Subject: RE: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 22:38:00 -0700
Quote:
>
>OK, please close it as resolved, thank you!
>
>
>"Steven Cheng [MSFT]" wrote:
>
Quote:
>Hi Billy,
>>
>I have performed some research on this. Here is some information I've
got
Quote:
Quote:
>so far:
>>
>As for the ASP.NET client script based AJAX call, it is limited by the
web
Quote:
Quote:
>page script model. For all the web pages in webbrowser, webbrowser will
>restrict the script to access pages on remote server. For example, if
your
Quote:
Quote:
>page is from http://serverA , if your script try use some script
>component to send webrequest to other server/application, it is not
>allowed. And this also restrict the AJAX method call to remote
>applications(webservice or wcf). I've even tried call WCF on the same
>machine(different server application), it is now allowed.
>>
>So far, one way to make such remote WCF method call I can get is create
a
Quote:
Quote:
>local server-side page method in which you use server-side code to call
the
Quote:
Quote:
>remote WCF service. And your page's client-side script call this
>server-side page_method via AJAX. How do you think?
>>
>Sincerely,
>>
>Steven Cheng
>>
>Microsoft MSDN Online Support Lead
>>
>>
>Delighting our customers is our #1 priority. We welcome your comments
and
Quote:
Quote:
>suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:
>feel free to let my manager know what you think of the level of service
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>>
>================================================= =
>Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/subscripti...ult.aspx#notif
Quote:
Quote:
>ications.
>>
>================================================= =
>This posting is provided "AS IS" with no warranties, and confers no
rights.
Quote:
Quote:
>--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
><4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
Quote:
>Subject: RE: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 02:46:05 -0700
>>
Quote:
>
>I wrote it in Chinese, could you read Chinese in your tool?
>
>"Steven Cheng [MSFT]" wrote:
>
>Hi Billy,
>>
>The thread content is displayed as garbo code, have you verified that
>all
Quote:
>the contents are posted via UTF8 or other unicode format? You can try
>first
Quote:
>paste them into a notepad with unicode encoding and repost the
content
Quote:
Quote:
Quote:
>again to see whether it works.
>>
>Sincerely,
>>
>Steven Cheng
>Microsoft MSDN Online Support Lead
>>
>>
>Delighting our customers is our #1 priority. We welcome your comments
>and
Quote:
>suggestions about how we can improve the support we provide to you.
>Please
Quote:
>feel free to let my manager know what you think of the level of
service
Quote:
Quote:
Quote:
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>>
>--------------------
>>
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>Subject: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 01:57:01 -0700
>>
>
>>
>>
>æË*‘们现åœ ¨é‡åË
*°ä¸€ä¸ªé—® ©Â¢ËœÃ¯Â¼Å’Ã
©â‚?
Quote:
>
šè¿‡wcfÃ¥Ë*݌ȼ çš„webservice
¯Â¼Å’选择windo
Quote:
Quote:
Quote:
>ws
>>
>>
>service作为宿ä ¸Â»Ã¯Â¼Å’éâ
€¡â€¡Ã§â€Â¨java作䠸ºå®¢?
Quote:
>
¦Ë*·ç«¯è°ƒç” æË*å?ŸÃ
¯Â¼Å’但是æâ?法?
Quote:
Quote:
Quote:
½¿ç”¨asp.net
ajax调用ã�
Quote:
Quote:
Quote:
>>
>æË*‘们参è⠂¬Æ’äºâ€
http://msdn.microsoft.com/zh-cn/library/bb
Quote:
Quote:
>410780.aspx的资æâ ?
Quote:
>
™ï¼Œå¹¶ä¸”à ¸‹è½½Ã
¤Âºâ€ 相应的sampl e
Quote:
Quote:
Quote:
>>
>code,ä½â€
是发现è¿⠢些sample
¥Å¸ÂºÃ¦Å“¬ä¸?Ã
Quote:
Quote:
>©Æ’½éœ€è¦åœ ¨iisä¸Å
部署一丠ªsvcæâ?
Quote:
Quote:
Quote:
>
>‡ä»¶ï¼Œä½â€
是Ã?¹æ®å½“å ‰ä¸šÃ
Š¡éœ€æ±?
Quote:
>
€šÃ¯Â¼Å’æË*‘们æ â?法éÆ
’¨ç½²iis服å?¡å „¢Â¨Ã£â‚?
Quote:
Quote:
Quote:
>是否有windows service
host的wcf service与asp.net
Quote:
Quote:
Quote:
>>
ajax协作的蠧£åâ?³æâ
“¹æ¡Ë*?谢è °¢ãâ‚?
Quote:
Quote:
Quote:
>>
>
>>
>>
>
>>
>>
>
Steven Cheng [MSFT]
Guest
 
Posts: n/a
#8: Jul 31 '08

re: Ajax calls web service in wcf(windows service)


Thanks or your reply.

Yes, this is a "cross-browser" script restriction which prevent script to
interact with remote site(domain).

Anyway, so far for your scenario, two possible solutions are available:

1. use AJAX call to invoke local server-side page method and let
server-side to call the WCF service

2. Move the WCF to the local site/application(at least need to have the
same main domain server name) with your web page application.

If there is anything else need help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
<4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
<CE156F5B-963C-4C53-9B83-8C69840CB704@microsoft.com>
<GW9MRCs8IHA.4376@TK2MSFTNGHUB02.phx.gbl>
Quote:
>Subject: RE: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 22:38:00 -0700
Quote:
>
>OK, please close it as resolved, thank you!
>
>
>"Steven Cheng [MSFT]" wrote:
>
Quote:
>Hi Billy,
>>
>I have performed some research on this. Here is some information I've
got
Quote:
Quote:
>so far:
>>
>As for the ASP.NET client script based AJAX call, it is limited by the
web
Quote:
Quote:
>page script model. For all the web pages in webbrowser, webbrowser will
>restrict the script to access pages on remote server. For example, if
your
Quote:
Quote:
>page is from http://serverA , if your script try use some script
>component to send webrequest to other server/application, it is not
>allowed. And this also restrict the AJAX method call to remote
>applications(webservice or wcf). I've even tried call WCF on the same
>machine(different server application), it is now allowed.
>>
>So far, one way to make such remote WCF method call I can get is create
a
Quote:
Quote:
>local server-side page method in which you use server-side code to call
the
Quote:
Quote:
>remote WCF service. And your page's client-side script call this
>server-side page_method via AJAX. How do you think?
>>
>Sincerely,
>>
>Steven Cheng
>>
>Microsoft MSDN Online Support Lead
>>
>>
>Delighting our customers is our #1 priority. We welcome your comments
and
Quote:
Quote:
>suggestions about how we can improve the support we provide to you.
Please
Quote:
Quote:
>feel free to let my manager know what you think of the level of service
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>>
>================================================= =
>Get notification to my posts through email? Please refer to
>>
http://msdn.microsoft.com/subscripti...ult.aspx#notif
Quote:
Quote:
>ications.
>>
>================================================= =
>This posting is provided "AS IS" with no warranties, and confers no
rights.
Quote:
Quote:
>--------------------
Quote:
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>References: <6DFF6104-4C5E-488D-9027-DC20E79FA826@microsoft.com>
><4#QHphi8IHA.4744@TK2MSFTNGHUB02.phx.gbl>
Quote:
>Subject: RE: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 02:46:05 -0700
>>
Quote:
>
>I wrote it in Chinese, could you read Chinese in your tool?
>
>"Steven Cheng [MSFT]" wrote:
>
>Hi Billy,
>>
>The thread content is displayed as garbo code, have you verified that
>all
Quote:
>the contents are posted via UTF8 or other unicode format? You can try
>first
Quote:
>paste them into a notepad with unicode encoding and repost the
content
Quote:
Quote:
Quote:
>again to see whether it works.
>>
>Sincerely,
>>
>Steven Cheng
>Microsoft MSDN Online Support Lead
>>
>>
>Delighting our customers is our #1 priority. We welcome your comments
>and
Quote:
>suggestions about how we can improve the support we provide to you.
>Please
Quote:
>feel free to let my manager know what you think of the level of
service
Quote:
Quote:
Quote:
>provided. You can send feedback directly to my manager at:
>msdnmg@microsoft.com.
>>
>--------------------
>>
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <htinns@noemail.noemail>
>Subject: Ajax calls web service in wcf(windows service)
>Date: Wed, 30 Jul 2008 01:57:01 -0700
>>
>
>>
>>
>æË*‘们现åœ ¨é‡åË
*°ä¸€ä¸ªé—® ©Â¢ËœÃ¯Â¼Å’Ã
©â‚?
Quote:
>
šè¿‡wcfÃ¥Ë*݌ȼ çš„webservice
¯Â¼Å’选择windo
Quote:
Quote:
Quote:
>ws
>>
>>
>service作为宿ä ¸Â»Ã¯Â¼Å’éâ
€¡â€¡Ã§â€Â¨java作䠸ºå®¢?
Quote:
>
¦Ë*·ç«¯è°ƒç” æË*å?ŸÃ
¯Â¼Å’但是æâ?法?
Quote:
Quote:
Quote:
½¿ç”¨asp.net
ajax调用ã�
Quote:
Quote:
Quote:
>>
>æË*‘们参è⠂¬Æ’äºâ€
http://msdn.microsoft.com/zh-cn/library/bb
Quote:
Quote:
>410780.aspx的资æâ ?
Quote:
>
™ï¼Œå¹¶ä¸”à ¸‹è½½Ã
¤Âºâ€ 相应的sampl e
Quote:
Quote:
Quote:
>>
>code,ä½â€
是发现è¿⠢些sample
¥Å¸ÂºÃ¦Å“¬ä¸?Ã
Quote:
Quote:
>©Æ’½éœ€è¦åœ ¨iisä¸Å
部署一丠ªsvcæâ?
Quote:
Quote:
Quote:
>
>‡ä»¶ï¼Œä½â€
是Ã?¹æ®å½“å ‰ä¸šÃ
Š¡éœ€æ±?
Quote:
>
€šÃ¯Â¼Å’æË*‘们æ â?法éÆ
’¨ç½²iis服å?¡å „¢Â¨Ã£â‚?
Quote:
Quote:
Quote:
>是否有windows service
host的wcf service与asp.net
Quote:
Quote:
Quote:
>>
ajax协作的蠧£åâ?³æâ
“¹æ¡Ë*?谢è °¢ãâ‚?
Quote:
Quote:
Quote:
>>
>
>>
>>
>
>>
>>
>
Closed Thread