AI OnAI Off
PageDataCollection pages = Global.EPDataFactory.GetChildren(new PageReference(3, "RemoteSiteName"));
But it results in this error:
"09/23/2005 12:22:05" er en ugyldig verdi for "EPiServer.Core.PropertyDate".
I learned while creating my own web service, and in doing that, had to convert all the page properties from my web services' RawPage to EPiServer.Core.RawPage. While doing this, I ran into this error, and I had to set the Date properties (like PageCreated) to f.ex. DateTime.Now or EPiServer.PropertyDate.MaxValue.
I might add that the remote site is multi lingual, while the local one is not. Could this be a bug? Anyone @ EP want to comment on this?
Frank
[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.GetDayOfNNY(DateTimeResult result, DateTimeRawInfo raw, DateTimeFormatInfo dtfi) +202
System.DateTimeParse.ProcessTerminaltState(Int32 dps, DateTimeResult result, DateTimeRawInfo raw, DateTimeFormatInfo dtfi) +142
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +488
System.DateTime.Parse(String s, IFormatProvider provider, DateTimeStyles styles) +30
System.DateTime.Parse(String s, IFormatProvider provider) +11
System.DateTime.Parse(String s) +7
System.Convert.ToDateTime(String value) +46
EPiServer.Core.PropertyDate.Parse(String str)
[InvalidPropertyValueException: "10/13/2005 21:22:34" er en ugyldig verdi for "EPiServer.Core.PropertyDate".]
EPiServer.Core.PropertyDate.Parse(String str)
EPiServer.Core.PropertyDate.ParseToSelf(String str)
EPiServer.Core.PropertyData.CreatePropertyDataObject(RawProperty rawProp)
EPiServer.Core.PropertyDataCollection..ctor(RawProperty[] properties)
EPiServer.Core.PageData..ctor(RawPage page)
EPiServer.Core.PageDataCollection..ctor(RawPage[] rawPages)
EPiServer.DataFactory.?(PageReference )
EPiServer.DataFactory.GetChildren(PageReference pageLink, AccessLevel access) +373
EPiServer.DataFactory.GetChildren(PageReference pageLink) +25
Sandvik.Templates.StandardPageWS.GetRemoteData() in c:\inetpub\babyverden\www\templates\pagews.aspx.cs:67
Sandvik.Templates.StandardPageWS.Page_Load(Object sender, EventArgs e) in c:\inetpub\babyverden\www\templates\pagews.aspx.cs:39
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
Frank :)
private void GetData() { EPiServer.WebServices.RemoteSite site = new EPiServer.WebServices.RemoteSite(); site.UserName = "webserviceuser"; site.Password = "webservicepassword; site.Name = "Test"; site.Url = "http://www.remotesite.com/WebServices/DataFactoryService.asmx"; EPiServer.WebServices.SignatureHeader header = new EPiServer.WebServices.SignatureHeader(); header.RemoteSite = "Test"; EPiServer.WebServices.DataFactoryService factory = new EPiServer.WebServices.DataFactoryService(); factory.Signature = header; PageReference pageRef = new PageReference(3, "Test"); RawPage[] children = factory.GetChildren(pageRef); Response.Write(children.Length); }
I've already created my own proxy class against the datafactory web service on the remote site, but it's QUITE a job to handle the return values, since the returned data isn't the same classes. For example, when retrieving a page through the EPiServer.WebServices.DataFactoryService, it comes back as a EPiServer.Core.RawPage. But when I create my own proxy, it comes back as MyWSProxy.DataFactoryService.RawPage, and these two don't mix. I have successfully converted from my version to EPiServer's version, but it's not the preferred way... Hope someone can help me. Frank :(