








EndpointAddress endPointAddress = new EndpointAddress("{wcf uri}");
CustomBinding binding = new CustomBinding();
binding.Elements.Add(new BinaryMessageEncodingBindingElement());
binding.Elements.Add(new HttpTransportBindingElement());
Adomd.AnalysisService.AdomdConnectorClient client = new Adomd.AnalysisService.AdomdConnectorClient(binding, endPointAddress);
注意:如果不使用CutomBinding而用BasicHttpBinding就会返回:Not Found错误,主要是协议的问题,这是跟踪HTTP请求时发现的。
<?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>
<configuration><behaviors><serviceBehaviors><behavior name="">
... <serviceDebug includeExceptionDetailInFaults="true" />
...
$sts = Get-SPServiceApplication | ?{$_ -match "Security"}
$sts.Provision()
Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue ...蛋疼了,在Sharepoint管理中点什么都错误?
原因:
“
This error occurs when your site is configured for claims and you are logged into an account thats isn't being formatted as a proper claim.
E.g.,
If your site is claims and you log in VIA Ad and the Welcome control says "Domain\SomeUser" that is not a properly encoded claim, so when the OOTB Claim Provider try's to decode the claim, it errors out with encodedValue.
The code that processes that encoded value is looking for an "i" before a "|" in the login name "Domain\UserName" and there isn't one, so it throws an error that the passed in encodedValue is invalid or null etc.
This usually indicates that your web config files are not properly configured for a site running in claims, or you could have FBA set up and that's not configured properly either.
Refer to this link for that,
http://blogs.technet.com/b/speschka/archive/2009/11/05/configuring-forms-based-authentication-in-sharepoint-2010.aspx
In some cases, if your using extremely custom authentication logic "like a custom Trusted Identity Provider" then you need to write your own ClaimProvider so sharepoint knows how to encoded/decode the claims.
When it's result and you log in Via a Windows account, your login name should look something like "i#:w|Domain\UserName" (*spelling*). And when logged in via fba it should look like "i#:membershipprovidernamehere|usernamehere" (*spelling*)
This error can also occur if you have your SuperReader and Cache Reader accounts configured with improper claim values. When using a Claims Configuration, your SuperReader and CacheReader account names need to be Encoded Claims like the examples above. And I bet this is what's happening in your example,
When you try to get an SPSite, because you have the Cache Accounts configured, it's trying to check the cache to see if the Site exists in the Cache, but when it does it dies when trying to evaluate the SuperReader and SuperUser accounts because it can't decode their claims because their not valid encoded claims, then you get the encodedValue exception. It works sometimes because the object might not be cached, so it gets a new one, then when the object is cached it dies.
Or it might work when your logged in via AD but die when logged in via FBA etc (just a hypothetical theory).
Heres an article on this issue as well. (I struggled with this for a good week before I found this).
http://technet.microsoft.com/en-us/library/ff758656.aspx
My Blog: http://www.thesug.org/Blogs/ryan_mann1/default.aspx Website: Under Construction
”
我把配置FBA时所改的3个web.config都改回去了,当时偷懒了直接使用继承的AspNetSqlRoleProvider,这样是不行。
declare @now datetime
set @now= GETDATE()
exec aspnet_Membership_CreateUser 'MyAppName','bob','pass@word1',
'','bob@contoso.com','','',1,@now,@now,0,0,null
exec aspnet_Membership_CreateUser 'MyAppName','mary','pass@word1',
'','mary@contoso.com','','',1,@now,@now,0,0,null
exec aspnet_Membership_CreateUser 'MyAppName','jack','pass@word1',
'','jack@contoso.com','','',1,@now,@now,0,0,null
EXEC aspnet_Roles_CreateRole 'MyAppName', 'Employee'
EXEC aspnet_Roles_CreateRole 'MyAppName', 'TeamManager'
EXEC aspnet_Roles_CreateRole 'MyAppName', 'CEO'
EXEC aspnet_UsersInRoles_AddUsersToRoles 'MyAppName', 'bob', 'Employee', 8
EXEC aspnet_UsersInRoles_AddUsersToRoles 'MyAppName', 'mary', 'TeamManager', 8
EXEC aspnet_UsersInRoles_AddUsersToRoles 'MyAppName', 'jack', 'CEO', 8
EXEC aspnet_UsersInRoles_AddUsersToRoles 'MyAppName', 'jack', 'Admin', 8
WebHost 无法处理请求。
发件人信息: System.ServiceModel.ServiceHostingEnvironment+HostingManager/39147728
异常: System.ServiceModel.ServiceActivationException: 由于编译过程中出现异常,无法激活服务“/_vti_bin/client.svc”。异常消息为: 无法创建相对 URI,因为“uriString”参数表示绝对 URI。http://xxx:2222/_vti_bin/client.svc。 ---> System.UriFormatException: 无法创建相对 URI,因为“uriString”参数表示绝对 URI。http://xxx:2222/_vti_bin/client.svc
在 System.ServiceModel.Activation.ApplyHostConfigurationBehavior.ThrowIfAbsolute(Uri uri)
在 System.ServiceModel.Activation.ApplyHostConfigurationBehavior.FailActivationIfEndpointsHaveAbsoluteAddress(ServiceHostBase service)
在 System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost)
在 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
在 System.ServiceModel.ServiceHostBase.InitializeRuntime()
在 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
在 System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- 内部异常堆栈跟踪的结尾 ---
在 System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
在 System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)
进程名称: w3wp
进程 ID: 7828
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。