Try our conversational search powered by Generative AI!

GetDefaultPageData through WebServices

Vote:
 
Hi! I trying to use GetDefaultData from the datafactoryservice.asmx. I have a PageReference which I filled like this: PageRef.ID = 4; PageRef.WorkID = ???; // WorkID? What should I put here? PageRef.RemoteSite = "????"; // No matter what I put here I get a // System.Collections.Generic.KeyNotFoundException rawPage = dfs.GetDefaultPageData(PageRef, 90); Have tried site shortname, url with and without http://, empty string..... /Fredrik, Internetfabriken
#15784
Sep 24, 2007 10:39
Vote:
 
Hi Fredrik, More info about PageReference can be found on the following page. http://sdk.episerver.com/library/cms5/html/AllMembers_T_EPiServer_Core_PageReference.htm If you want to get the latest published version of a certain page, you just fill the ID of the page, WorkID should be 0 and the remote site should be null(if you are looking for a page on your current site, meaning the one hosting the webservice). Regards,
#16353
Sep 24, 2007 11:34
Vote:
 
Problem is when I set RemoteSite to null I get this: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null. Parameter name: key at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at EPiServer.WebServices.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID) This is an RC4 server, is it a bug that has been fixed in the release version? /Fredrik, Internetfabriken
#16354
Sep 24, 2007 14:03
Vote:
 
Tested against the realease of CMS5 and I get the same error. System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentNullException: Value cannot be null. Parameter name: key at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Dictionary`2.FindEntry(TKey key) at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at EPiServer.WebServices.DataFactoryService.IsTrusted(String siteName) at EPiServer.WebServices.DataFactoryService.GetDefaultPageData(PageReference pageLink, Int32 pageTypeID) --- End of inner exception stack trace ---
#16355
Sep 24, 2007 16:00
Vote:
 
Hi, If you want to get data for a CMS site, you will have to use the new WebService (PageStoreService.asmx) instead, with the PageReference structure as I mentioned earlier. Regards, Tibi
#16356
Sep 24, 2007 17:08
Vote:
 
Hi, Had the same difficulties getting data out of EpiServer until I found this thread. Now I can at least get one page out of it! What happens is that I can get the start page by using PageStoreService but I can't get any other page. Could it be that I haven't specified langage? Right now I'm sending an empty LanguageSelector because I can't access any properties? I have checked: Pageid correct, WorkId correct, User has access to page (everyone can view). The only conclusion must be that the language branch is wrong but how do I set that? The error I get looks like this: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> EPiServer.Core.PageNotFoundException: Page 4_1 was not found at EPiServer.DataAccess.PageLoadDB.LoadPageInternal(PageReference pageLink, AbstractCommand cmd) at EPiServer.DataAccess.PageLoadDB.LoadVersion(PageReference pageLink, Int32 languageBranchID) Here's the code: PageStoreServiceRef.PageStoreService proxy = new PageStoreServiceRef.PageStoreService(); proxy.Credentials = new NetworkCredential("Administrator", "xxx"); PageStoreServiceRef.PageReference pageLink = new PageStoreServiceRef.PageReference(); pageLink.ID = pageId; pageLink.WorkID = workId; PageStoreServiceRef.LanguageSelector selector = new EPiServerWSTestApp.PageStoreServiceRef.LanguageSelector(); PageStoreServiceRef.RawPage page = proxy.GetPage(pageLink, selector, EPiServerWSTestApp.PageStoreServiceRef.AccessLevel.Read);
#16357
Oct 09, 2007 17:05
Vote:
 

@Christian.gnosspelius. I want to get pagedata using PageStoreService, but i am getting exception "The type initializer for 'EPiServer.Security.PrincipalInfo'". Can you please help me is sorting out this problem. I am using CMS 6. My code is:

PageStoreService pageContent = new PageStoreService();                
        LanguageSelector selector = new LanguageSelector("en-US");

        RawPage page = new RawPage();

        page = pageContent.GetPage(new EPiServer.Core.PageReference(423),
                                    selector, EPiServer.Security.AccessLevel.Read);

 

#55235
Nov 23, 2011 13:59
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.