New Posts New Posts RSS Feed: how do ideablade config the clients?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

how do ideablade config the clients?

 Post Reply Post Reply
Author
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Topic: how do ideablade config the clients?
    Posted: 22-Oct-2012 at 9:35am
The DevForce services, EntityService.svc and EntityServer.svc, build up a CustomBinding, using the protocol scheme from the URI to determine whether SSL is used. 
 
Basically what you're doing, but with the added check of the uri.Scheme, something like this:
 
Uri uri = new Uri(Application.Current.Host.Source, "../Services/Authentication.svc");
if (uri.Scheme == "http")
    BasicHttpBinding binding = new BasicHttpBinding();
else if (uri.Scheme == "https")
    BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
EndpointAddress ep = new EndpointAddress(uri);
service = new ServiceAuthentication.AuthenticationClient(binding, ep);
 
Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post Posted: 22-Oct-2012 at 8:52am
If you don't want to use the config file, you can use ServiceProxyEvents to do it in code.
Back to Top
pponzano View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Apr-2011
Location: Italy
Posts: 165
Post Options Post Options   Quote pponzano Quote  Post ReplyReply Direct Link To This Post Posted: 22-Oct-2012 at 2:05am
Hello,
I've switched from http to https and I've noticed that ideablade automatically adopted the transport layer... for my sercive (wcf) I have to specify the binding as

     Uri uri = new Uri(Application.Current.Host.Source, "../Services/Authentication.svc");

            BasicHttpBinding binding = new BasicHttpBinding();
            EndpointAddress ep = new EndpointAddress(uri);

            service = new ServiceAuthentication.AuthenticationClient(binding, ep);

...is there a simpler way that permits me to have it dinamically created one?

I don't want to use the serviceclient.config since it has the address fixed in the configuration

   <endpoint address="http://localhost/xxxClient/Services/Authentication.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthentication"
        contract="ServiceAuthentication.IAuthentication" name="BasicHttpBinding_IAuthentication" />

Thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down