Try our conversational search powered by Generative AI!

Trying to create a page with PageStoreService

Vote:
 

I get this error message:

Service1 Message 17 Error:
System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm=""'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory factory)
   at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IntranetMailer.PageStoreService.PageStoreServiceSoap.GetDefaultPageData(GetDefaultPageDataRequest request)
   at IntranetMailer.PageStoreService.PageStoreServiceSoapClient.IntranetMailer.PageStoreService.PageStoreServiceSoap.GetDefaultPageData(GetDefaultPageDataRequest request) in C:\Source\PH\Intranet\IntranetMailer\Service References\PageStoreService\Reference.cs:line 2191
   at IntranetMailer.PageStoreService.PageStoreServiceSoapClient.GetDefaultPageData(PageReference parentPageLink, Int32 pageTypeID, LanguageSelector selector, AccessLevel access) in C:\Source\PH\Intranet\IntranetMailer\Service References\PageStoreService\Reference.cs:line 2201
   at IntranetMailer.IntranetMailerService.ProcessEmails() in C:\Source\PH\Intranet\IntranetMailer\IntranetMailerService.cs:line 93

I've configured basic authentication as per the instructions and I am supplying a userrname and password in the code but for some reason the web service thinks I'm trying to log on anonymously.

What have I missed?

#52016
Jul 01, 2011 17:54
Vote:
 
#52220
Jul 12, 2011 18:28
Vote:
 

Ok I managed to figure out that the web.config setting didn't allow Anonymous access to the Webservices folder (might be an idea to set that as a default since it seems to be required) but now I'm getting another error which I have no idea how to solve:

Service1 Message 3 Error:
System.ServiceModel.FaultException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0272: The property or indexer 'EPiServer.Core.LanguageSelector.SelectionSource' cannot be used in this context because the set accessor is inaccessible

at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IntranetMailer.PageStoreService.PageStoreServiceSoap.GetDefaultPageData(GetDefaultPageDataRequest request)
at IntranetMailer.PageStoreService.PageStoreServiceSoapClient.IntranetMailer.PageStoreService.PageStoreServiceSoap.GetDefaultPageData(GetDefaultPageDataRequest request) in C:\Source\PH\Intranet\IntranetMailer\Service References\PageStoreService\Reference.cs:line 2191
at IntranetMailer.PageStoreService.PageStoreServiceSoapClient.GetDefaultPageData(PageReference parentPageLink, Int32 pageTypeID, LanguageSelector selector, AccessLevel access) in C:\Source\PH\Intranet\IntranetMailer\Service References\PageStoreService\Reference.cs:line 2201
at IntranetMailer.IntranetMailerService.ProcessEmails() in C:\Source\PH\Intranet\IntranetMailer\IntranetMailerService.cs:line 94

 Any ideas at all would be most welcome

#52221
Jul 12, 2011 18:30
Vote:
 

This is the code:

                        PageStoreServiceSoapClient pageStoreService = new PageStoreServiceSoapClient();
pageStoreService.ClientCredentials.UserName.UserName = "user";
pageStoreService.ClientCredentials.UserName.Password = "password";
PageReference reference = new PageReference { ID = 24 };
LanguageSelector selector = new LanguageSelector { LanguageBranch = "en-GB" };
RawPage rawPage = pageStoreService.GetDefaultPageData(reference, 6, selector, AccessLevel.Create);
It fails on trying to create the RawPage

 

#52222
Jul 12, 2011 18:32
Vote:
 

Anyone?

#52353
Jul 19, 2011 16:15
Vote:
 

Try changing security mode to "TransportCredentialOnly" if you have not fixed it yet.

<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" proxyCredentialType="None"
realm="" />
</security>

 

#53792
Sep 22, 2011 16:56
Vote:
 

I think we have a bug for this one:

Bug #72114: Runtime compiler error CS0272 when using the PageStoreService 

#53802
Sep 22, 2011 18:34
Vote:
 

I am having this problem with CMS 6 R2, the bug should be fixed in that version right? I am just trying to retrieve a page by ID. Has anyone found a workaround for this?

#59004
May 15, 2012 16:38
Vote:
 

Kevin: It should be fixed in the general hotfix. Do you have that installed?

#59005
May 15, 2012 16:40
Vote:
 

I'm not sure on that (I didn't set up the server), but I will check. Where is this hotfix available, in case that is the problem?

#59006
May 15, 2012 16:44
Vote:
 

The EPiServer CMS 6 R2 release on world is the general hotfix. See this blog for more details (how to upgrade to it):

http://world.episerver.com/Blogs/Shahid-Nawaz/Dates/2012/1/General-Hotfix-CMS-6-R2/

#59007
May 15, 2012 16:46
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.