从Silverlight Client消耗IIS托管在WF服务中的问题

问题描述

|| 我正在尝试使用Silverlight客户端使用IIS Express(xamlx)中托管的WF服务。 我添加了我的服务参考,当我使用客户端代理时,我得到了:
System.ServiceModel.CommunicationException was unhandled by user code
  Message=An error occurred while trying to make a request to URI \'http://localhost:52878/Workflows/PerformanceAppraisal/Exempt.xamlx\'. 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. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.
  StackTrace:
       at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action,Object[] outs,IAsyncResult result)
       at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName,Object[] args,IAsyncResult result)
       at CompanyHR.ExemptPAService.ExemptPAClient.ExemptPAClientChannel.EndInitiatePerformanceAppraisal(IAsyncResult result)
       at CompanyHR.ExemptPAService.ExemptPAClient.CompanyHR.ExemptPAService.IExemptPA.EndInitiatePerformanceAppraisal(IAsyncResult result)
       at CompanyHR.ExemptPAService.ExemptPAClient.OnEndInitiatePerformanceAppraisal(IAsyncResult result)
       at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)
  InnerException: System.Security.SecurityException
       Message=\"\"
       StackTrace:
            at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod,Object state)
            at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
       InnerException: System.Security.SecurityException
            Message=Security error.
            StackTrace:
                 at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
                 at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
                 at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
            InnerException: 
添加服务参考时,我没有使用http:// localhost:52878 / Workflows / PerformanceAppraisal / Exempt.xamlx 我使用的是https版本。但是它似乎正在使用此网址。 我在Visual Studio 2010中使用IIS Express。     

解决方法

        该错误消息非常清楚,无法找到clientaccesspolicy.xml。这是在Silverlight应用程序正在运行时在另一个站点上调用服务的结果。您没有提到Silverlight应用程序的URL,但是可能是使用HTTPS的情况,也可能是完全不同的站点。     

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...