Ajax calls web service in wcf(windows service)

Discussion in 'ASP .Net' started by Billy Zhang, Jul 30, 2008.

  1. Billy Zhang

    Billy Zhang Guest

    我们现在é‡åˆ°ä¸€ä¸ªé—®é¢˜ï¼Œé€šè¿‡wcf创建的webservice,选择windows
    service作为宿主,采用java作为客户端调用æˆåŠŸï¼Œä½†æ˜¯æ— æ³•ä½¿ç”¨asp.net ajax调用。
    我们å‚考了http://msdn.microsoft.com/zh-cn/library/bb410780.aspx的资料,并且下载了相应的sample
    code,但是å‘现这些sample基本上都需è¦åœ¨iis上部署一个svc文件,但是根æ®å½“å‰ä¸šåŠ¡éœ€æ±‚,我们无法部署iisæœåŠ¡å™¨ã€‚
    是å¦æœ‰windows service hostçš„wcf service与asp.net ajaxå作的解决方案?谢谢。
    Billy Zhang, Jul 30, 2008
    #1
    1. Advertising

  2. 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:
    .

    --------------------

    >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >Subject: Ajax calls web service in wcf(windows service)
    >Date: Wed, 30 Jul 2008 01:57:01 -0700


    >
    >我们现在é‡åˆ°ä¸€ä¸ªé—®é¢˜ï¼Œé€šè¿‡wcf创建的webservice,选择windo

    ws
    >service作为宿主,采用java作为客户端调用æˆåŠŸï¼Œä½†æ˜¯æ— æ³•ä

    ½¿ç”¨asp.net ajax调用ã€?
    我们å‚考了http://msdn.microsoft.com/zh-cn/library/bb410780.aspx的资æ–
    ™ï¼Œå¹¶ä¸”下载了相应的sample
    >code,但是å‘现这些sample基本上都需è¦åœ¨iis上部署一个svcæ–

    ‡ä»¶ï¼Œä½†æ˜¯æ ¹æ®å½“å‰ä¸šåŠ¡éœ€æ±‚,我们无法部署iisæœåŠ¡å™¨ã€?
    是å¦æœ‰windows service hostçš„wcf service与asp.net
    ajaxå作的解决方案?谢谢ã€?

    >
    Steven Cheng [MSFT], Jul 30, 2008
    #2
    1. Advertising

  3. Billy Zhang

    Billy Zhang Guest

    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
    > 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:
    > .
    >
    > --------------------
    >
    > >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    > >Subject: Ajax calls web service in wcf(windows service)
    > >Date: Wed, 30 Jul 2008 01:57:01 -0700

    >
    > >
    > >我们现在é‡到一个问题,通过wcf创建的webservice,选择windo

    > ws
    > >service作为宿主,采çâ€Â¨java作为客户端调çâ€Â¨Ã¦Ë†Â功,但是æ— 法ä

    > ½¿çâ€Â¨asp.net ajaxè°ƒçâ€Â¨Ã£â‚¬?
    > 我们å‚考了http://msdn.microsoft.com/zh-cn/library/bb410780.aspx的资æ–
    > ™ï¼Œå¹¶ä¸â€Ã¤Â¸â€¹Ã¨Â½Â½Ã¤Âºâ€ Ã§â€ºÂ¸Ã¥Âºâ€Ã§Å¡â€žsample
    > >code,但是å‘现这些sample基本上都需è¦Â在iis上部署一个svcæ–

    > ‡ä»¶ï¼Œä½†æ˜¯æ ¹æ®当å‰Â业务需求,我们æ— 法部署iisæœÂ务器ã€?
    > 是å¦有windows service hostçš„wcf service与asp.net
    > ajaxÃ¥ÂÂ作的解决方案?谢谢ã€?
    >
    > >

    >
    >
    Billy Zhang, Jul 30, 2008
    #3
  4. 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:
    .

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

    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
    >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >References: <>

    <4#>
    >Subject: RE: Ajax calls web service in wcf(windows service)
    >Date: Wed, 30 Jul 2008 02:46:05 -0700


    >
    >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
    >> 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:
    >> .
    >>
    >> --------------------
    >>
    >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >> >Subject: Ajax calls web service in wcf(windows service)
    >> >Date: Wed, 30 Jul 2008 01:57:01 -0700

    >>
    >> >

    >>

    >我们现在é‡到一个问题,é€

    šè¿‡wcf创建的webservice,选择windo
    >> ws
    >>

    >service作为宿主,采çâ€Â¨java作为客Ã

    ¦Ë†Â·Ã§Â«Â¯Ã¨Â°Æ’çâ€Â¨Ã¦Ë†Â功,但是æâ€?法Ã?
    > ½¿çâ€Â¨asp.net ajaxè°ƒçâ€Â¨Ã£â‚¬?
    >>

    我们å‚考了http://msdn.microsoft.com/zh-cn/library/bb
    410780.aspx的资æ�
    > ™ï¼Œå¹¶ä¸â€Ã¤Â¸â€¹Ã¨Â½Â½Ã¤Âºâ€ Ã§â€ºÂ¸Ã¥Âºâ€Ã§Å¡â€žsample
    >>

    >code,但是å‘现这些sample基本上Ã

    ©Æ’½éœ€è¦Â在iis上部署一个svcæâ€?
    >

    ‡ä»¶ï¼Œä½†æ˜¯Ã?¹æ®当å‰Â业务需æ±â
    €šÃ¯Â¼Å’我们æâ€?法部署iisæœÂ务器ã€?
    >> 是å¦有windows service hostçš„wcf service与asp.net
    >> ajaxÃ¥ÂÂ作的解决方案?谢谢ã€?
    >>
    >> >

    >>
    >>

    >
    Steven Cheng [MSFT], Jul 31, 2008
    #4
  5. Billy Zhang

    Billy Zhang Guest

    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:

    > 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:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    > --------------------
    > >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    > >References: <>

    > <4#>
    > >Subject: RE: Ajax calls web service in wcf(windows service)
    > >Date: Wed, 30 Jul 2008 02:46:05 -0700

    >
    > >
    > >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
    > >> 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:
    > >> .
    > >>
    > >> --------------------
    > >>
    > >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    > >> >Subject: Ajax calls web service in wcf(windows service)
    > >> >Date: Wed, 30 Jul 2008 01:57:01 -0700
    > >>
    > >> >
    > >>

    > >我们现在é‡到一个éâ€â€Ã‚®Ã©Â¢ËœÃ¯Â¼Å’é€

    > šè¿‡wcf创建的webservice,选择windo
    > >> ws
    > >>

    > >service作为宿主,采çâ€Â¨java作为客Ã

    > ¦Ë†Â·Ã§Â«Â¯Ã¨Â°Æ’çâ€Â¨æˆÂÂ功,ä½â€ 是æâ€?法Ã?
    > > ½¿çâ€Â¨asp.net ajaxè°ƒçâ€Â¨ã€?
    > >>

    > 我们å‚考äºâ€ http://msdn.microsoft.com/zh-cn/library/bb
    > 410780.aspx的资æ�
    > > ™ï¼Œå¹¶ä¸â€Â下载äºâ€ 相åºâ€Âçš„sample
    > >>

    > >code,ä½â€ 是å‘现这些sample基本ä¸Å Ã

    > ©Æ’½éœ€è¦ÂÂ在iisä¸Å 部署一个svcæâ€?
    > >

    > ‡ä»¶ï¼Œä½â€ 是Ã?¹æ®当å‰ÂÂ业åÅ ¡éœ€æ±â
    > €šÃ¯Â¼Å’我们æâ€?法部署iisæœÂÂ务器ã€?
    > >> 是å¦有windows service hostçš„wcf service与asp.net
    > >> ajaxÃ¥ÂÂÂÂ作的解决方案?谢谢ã€?
    > >>
    > >> >
    > >>
    > >>

    > >

    >
    >
    Billy Zhang, Jul 31, 2008
    #5
  6. Billy Zhang

    Billy Zhang Guest

    OK, please close it as resolved, thank you!


    "Steven Cheng [MSFT]" wrote:

    > 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:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    > --------------------
    > >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    > >References: <>

    > <4#>
    > >Subject: RE: Ajax calls web service in wcf(windows service)
    > >Date: Wed, 30 Jul 2008 02:46:05 -0700

    >
    > >
    > >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
    > >> 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:
    > >> .
    > >>
    > >> --------------------
    > >>
    > >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    > >> >Subject: Ajax calls web service in wcf(windows service)
    > >> >Date: Wed, 30 Jul 2008 01:57:01 -0700
    > >>
    > >> >
    > >>

    > >我们现在é‡到一个éâ€â€Ã‚®Ã©Â¢ËœÃ¯Â¼Å’é€

    > šè¿‡wcf创建的webservice,选择windo
    > >> ws
    > >>

    > >service作为宿主,采çâ€Â¨java作为客Ã

    > ¦Ë†Â·Ã§Â«Â¯Ã¨Â°Æ’çâ€Â¨æˆÂÂ功,ä½â€ 是æâ€?法Ã?
    > > ½¿çâ€Â¨asp.net ajaxè°ƒçâ€Â¨ã€?
    > >>

    > 我们å‚考äºâ€ http://msdn.microsoft.com/zh-cn/library/bb
    > 410780.aspx的资æ�
    > > ™ï¼Œå¹¶ä¸â€Â下载äºâ€ 相åºâ€Âçš„sample
    > >>

    > >code,ä½â€ 是å‘现这些sample基本ä¸Å Ã

    > ©Æ’½éœ€è¦ÂÂ在iisä¸Å 部署一个svcæâ€?
    > >

    > ‡ä»¶ï¼Œä½â€ 是Ã?¹æ®当å‰ÂÂ业åÅ ¡éœ€æ±â
    > €šÃ¯Â¼Å’我们æâ€?法部署iisæœÂÂ务器ã€?
    > >> 是å¦有windows service hostçš„wcf service与asp.net
    > >> ajaxÃ¥ÂÂÂÂ作的解决方案?谢谢ã€?
    > >>
    > >> >
    > >>
    > >>

    > >

    >
    >
    Billy Zhang, Jul 31, 2008
    #6
  7. 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:
    .

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


    --------------------
    >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >References: <>

    <4#>
    <>
    <>
    >Subject: RE: Ajax calls web service in wcf(windows service)
    >Date: Wed, 30 Jul 2008 22:38:00 -0700


    >
    >OK, please close it as resolved, thank you!
    >
    >
    >"Steven Cheng [MSFT]" wrote:
    >
    >> 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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >> --------------------
    >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >> >References: <>

    >> <4#>
    >> >Subject: RE: Ajax calls web service in wcf(windows service)
    >> >Date: Wed, 30 Jul 2008 02:46:05 -0700

    >>
    >> >
    >> >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
    >> >> 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:
    >> >> .
    >> >>
    >> >> --------------------
    >> >>
    >> >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >> >> >Subject: Ajax calls web service in wcf(windows service)
    >> >> >Date: Wed, 30 Jul 2008 01:57:01 -0700
    >> >>
    >> >> >
    >> >>

    >>

    >我们现在é‡åËâ

    € Ã‚°Ã¤Â¸â‚¬Ã¤Â¸ÂªÃ©â€â€Ã‚®Ã©Â¢ËœÃ¯Â¼Å’Ã
    ©â‚�
    >

    šè¿‡wcf创建的webserviceÃ
    ƒÂ¯Ã‚¼Å’选择windo
    >> >> ws
    >> >>

    >>

    >service作为宿主,éâ

    €¡â€¡Ã§â€Â¨java作为客Ã?
    >

    ¦Ë†Â·Ã§Â«Â¯Ã¨Â°Æ’çâ€Â¨æˆÂÂÃ¥Ã?ŸÃ
    ¯Â¼Å’但是æâ�法�
    >> > ½¿çâ€Â¨asp.net

    ajaxè°ƒçâ€Â¨ãâ‚Â?
    >> >>

    >> 我们å‚考äºâ€

    http://msdn.microsoft.com/zh-cn/library/bb
    >> 410780.aspx的资æâ�
    >> >

    ™ï¼Œå¹¶ä¸â€Â下载Ã
    ¤Âºâ€ 相åºâ€Âçš„sample
    >> >>
    >> >code,ä½â€

    是å‘现这些sampleÃ
    ƒÂ¥Ã…¸ÂºÃ¦Å“¬ä¸Ã?Ã
    >> ©Æ’½éœ€è¦ÂÂ在iisä¸Å

    部署一个svcæâ�
    >> >

    >> ‡ä»¶ï¼Œä½â€

    是Ã?¹æ®当å‰ÂÂ业ÃÂ
    ¥Ã… ¡éœ€æ±Ã?
    >

    €šÃ¯Â¼Å’我们æâ�法éÆ
    ’¨ç½²iisæœÂÂÃ¥Ã?¡å™¨ãâ‚Â?
    >> >> 是å¦有windows service

    host的wcf service与asp.net
    >> >>

    ajaxÃ¥ÂÂÂÂ作的解åââ‚?³æââ
    ‚¬â€œÃ‚¹Ã¦Â¡Ë†Ã¯Â¼Å¸Ã¨Â°Â¢Ã¨Â°Â¢Ã£â‚Â?
    >> >>
    >> >> >
    >> >>
    >> >>
    >> >

    >>
    >>

    >
    Steven Cheng [MSFT], Jul 31, 2008
    #7
  8. 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:
    .

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


    --------------------
    >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >References: <>

    <4#>
    <>
    <>
    >Subject: RE: Ajax calls web service in wcf(windows service)
    >Date: Wed, 30 Jul 2008 22:38:00 -0700


    >
    >OK, please close it as resolved, thank you!
    >
    >
    >"Steven Cheng [MSFT]" wrote:
    >
    >> 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:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >> --------------------
    >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >> >References: <>

    >> <4#>
    >> >Subject: RE: Ajax calls web service in wcf(windows service)
    >> >Date: Wed, 30 Jul 2008 02:46:05 -0700

    >>
    >> >
    >> >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
    >> >> 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:
    >> >> .
    >> >>
    >> >> --------------------
    >> >>
    >> >> >From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <>
    >> >> >Subject: Ajax calls web service in wcf(windows service)
    >> >> >Date: Wed, 30 Jul 2008 01:57:01 -0700
    >> >>
    >> >> >
    >> >>

    >>

    >我们现在é‡åËâ

    € Ã‚°Ã¤Â¸â‚¬Ã¤Â¸ÂªÃ©â€â€Ã‚®Ã©Â¢ËœÃ¯Â¼Å’Ã
    ©â‚�
    >

    šè¿‡wcf创建的webserviceÃ
    ƒÂ¯Ã‚¼Å’选择windo
    >> >> ws
    >> >>

    >>

    >service作为宿主,éâ

    €¡â€¡Ã§â€Â¨java作为客Ã?
    >

    ¦Ë†Â·Ã§Â«Â¯Ã¨Â°Æ’çâ€Â¨æˆÂÂÃ¥Ã?ŸÃ
    ¯Â¼Å’但是æâ�法�
    >> > ½¿çâ€Â¨asp.net

    ajaxè°ƒçâ€Â¨ãâ‚Â?
    >> >>

    >> 我们å‚考äºâ€

    http://msdn.microsoft.com/zh-cn/library/bb
    >> 410780.aspx的资æâ�
    >> >

    ™ï¼Œå¹¶ä¸â€Â下载Ã
    ¤Âºâ€ 相åºâ€Âçš„sample
    >> >>
    >> >code,ä½â€

    是å‘现这些sampleÃ
    ƒÂ¥Ã…¸ÂºÃ¦Å“¬ä¸Ã?Ã
    >> ©Æ’½éœ€è¦ÂÂ在iisä¸Å

    部署一个svcæâ�
    >> >

    >> ‡ä»¶ï¼Œä½â€

    是Ã?¹æ®当å‰ÂÂ业ÃÂ
    ¥Ã… ¡éœ€æ±Ã?
    >

    €šÃ¯Â¼Å’我们æâ�法éÆ
    ’¨ç½²iisæœÂÂÃ¥Ã?¡å™¨ãâ‚Â?
    >> >> 是å¦有windows service

    host的wcf service与asp.net
    >> >>

    ajaxÃ¥ÂÂÂÂ作的解åââ‚?³æââ
    ‚¬â€œÃ‚¹Ã¦Â¡Ë†Ã¯Â¼Å¸Ã¨Â°Â¢Ã¨Â°Â¢Ã£â‚Â?
    >> >>
    >> >> >
    >> >>
    >> >>
    >> >

    >>
    >>

    >
    Steven Cheng [MSFT], Jul 31, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon
    Replies:
    0
    Views:
    992
    Simon
    Oct 13, 2009
  2. Cindy Lee
    Replies:
    1
    Views:
    2,063
    Mr. Arnold
    Mar 19, 2010
  3. Replies:
    1
    Views:
    223
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  4. Replies:
    3
    Views:
    356
  5. mike

    Windows Service as Web Service host without WCF?

    mike, Mar 30, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    816
Loading...

Share This Page