Hi,
I have a silverlight application which connects to a WCF service using HTTPS using CSLA framework. As usual the service references are stored in ServiceReferences.clientconfig. That is a problem and we have to hack .xap file when we deploy on production. What tried to set endpoint address at runtime but CSLA throws
Normal
0
false
false
false
EN-NZ
ZH-CN
X-NONE
"The provided
URI scheme 'https' is invalid; expected 'http'"
exception. Please note that this exception does not occur when endpoint address is picked from client configuration file. So that means CSLA data portal is doing something when we override DataPortalUrl property. This does not look like WCF configuration or HTTPS issue.
// base.DataPortalUrl = dynamicURL;//build dynamic url here
If someone has attempted this earlier, please help me.
Regards,
Murtaza
,
Have you tried to set the
ApplicationContext.DataPortalUrlString in code?
public static string DataPortalUrlString { get { return _dataPortalUrl; } set { _dataPortalUrl = value; } }
public static Uri DataPortalUrl { get { return new Uri(DataPortalUrlString); } }
Hi Jonny,
Thanks for posting. But I cannot find ApplicationContext object? Is that some specific CSLA entity? What namespace do I need to import?
Murtaza
Are you also updating the binding to support https?
var binding = new BasicHttpBinding();
binding.MaxBufferSize = int.MaxValue;
binding.MaxReceivedMessageSize = int.MaxValue;
binding.ReceiveTimeout = TimeSpan.FromMinutes(1);
binding.SendTimeout = TimeSpan.FromMinutes(1);
binding.OpenTimeout = TimeSpan.FromMinutes(1);
binding.CloseTimeout = TimeSpan.FromMinutes(1);
// allow https endpoint url
binding.Security.Mode = BasicHttpSecurityMode.Transport;
Csla.DataPortalClient.WcfProxy.DefaultUrl = "https://myweb.com/WcfPortal.svc"
Csla.DataPortalClient.WcfProxy.DefaultBinding = binding;
Hi Peran,
Is it necessary to set Binding if we are setting HTTPS url? Can CSLA pick up binding information from Silverlight Servicereferences.clientconfig file? Because we are not setting any binding properties in code - we specify binding properties only in silverlight configuration file. This works fine with HTTP. I am wondering why it does not work with HTTPS. Please note that mine is a Silverlight application.
Regards,
Murtaza
I have not tried part code/part .clientconfig before. Do you get the same problem if you set the Binding in code?
Regards
Peran
Copyright (c) Marimer LLC