【发布时间】:2016-08-17 14:45:45
【问题描述】:
我正在使用包含 SilverLight 应用程序按钮的 SharePoint 登录页面,登录页面将在客户端加载,并且通过按下按钮,SilverLight 应用程序必须打开安装在客户端计算机上的本地 WCF 服务它必须生成一个 OTP,但在我的情况下,这没有发生。
我正在使用的 WCF Uri 是这样的http://localhost:12345/service,当我按下登录页面上的按钮时,我注意到在提琴手中调用为http://localhost:12345/clientaccesspolicy.xml。
我已经把ClientAccessPolicy.xml和CrossDomain.xml放在系统根目录和项目目录下。
我也尝试通过 WCF 服务提供 ClientAccessPolicy.xml,但没有成功
这是错误的完整堆栈跟踪。
{System.ServiceModel.CommunicationException: An error occurred while trying to make a request to URI 'http://localhost:XXXXX/XXXXX'.
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. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
--- End of inner exception stack trace ---
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)
--- End of inner exception stack trace ---
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 SLLogin.iCubeWCFsvc.Service1Client.Service1ClientChannel.EndGenKey(IAsyncResult result)
at SLLogin.iCubeWCFsvc.Service1Client.SLLogin.iCubeWCFsvc.IService1.EndGenKey(IAsyncResult result)
at SLLogin.iCubeWCFsvc.Service1Client.OnEndGenKey(IAsyncResult result)
at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)}
【问题讨论】:
标签: wcf c#-4.0 visual-studio-2013 sharepoint-2013 silverlight-5.0