【转贴】Silverlight 解决方案 access a service in a cross-domain way

在开发手机项目的时候,从Windows Phone7应用程序调用webservice的时候发生了异常,与下面描述的类似。

 http://hi.baidu.com/laozhenghit/blog/item/b912a60d72a325e6aa645747.html

Excepition like:

"An error occurred while trying to make a request to URI 'http://www.mywebsite.com/webser/emailsender.asmx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details."

solution:

copy following as clientaccesspolicy.xml to root of web server

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
</cross-domain-access>
</access-policy>

转载于:https://www.cnblogs.com/jojozhuang/archive/2011/05/03/2035017.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值