CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Problem overriding DataPortalUrl property at runtime

    rated by 0 users
    Answered (Not Verified) This post has 0 verified answers | 5 Replies | 2 Followers

    Not Ranked
    3 Posts
    murtaza.tinwala posted on Mon, Jul 15 2013 7:41 PM

    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

     

    All Replies

    Top 10 Contributor
    2,279 Posts

    ,

    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); }     }

     

    Jonny Bekkum, Norway CslaContrib Coordinator

    Not Ranked
    3 Posts

    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

    Top 100 Contributor
    84 Posts
    Answered (Not Verified) Peran replied on Wed, Jul 17 2013 6:19 AM
    Suggested by Peran

    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;

    Not Ranked
    3 Posts

    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

    Top 100 Contributor
    84 Posts
    Peran replied on Tue, Jul 23 2013 3:02 PM

    I have not tried part code/part .clientconfig before.  Do you get the same problem if you set the Binding in code?

     

    Regards

    Peran

    Page 1 of 1 (6 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems