Proxy Server configuration question

Proxy Server configuration question

Old forum URL: forums.lhotka.net/forums/t/962.aspx


Rayk posted on Monday, August 21, 2006

I am evaluating the use of CSLA in my current application.  In one of my current test, I have a WinForm app that accesses data thru a web service.  To get this to work at my client's site, and to get thru their proxy server, I had to add the following code:

            DataService.Service s = new TestApp.DataService.Service();
            s.Proxy = WebRequest.DefaultWebProxy;
            s.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

I have not found any such code in the CSLA app, but I'm not sure if it needs to be there.

I guess my main question is:  Will the CSLA data portal be able to get through a proxy server, or will I need to add this code somewhere along the line?

Thanks

- RayK


RockfordLhotka replied on Monday, August 21, 2006

You will probably have to create your own data portal channel (at least the client-side proxy part) so you can set the proxy configuration. You should be able to use the existing remoting or web service proxy as a base for doing so, and CSLA is designed to allow you to plug in your own channel proxy on the client - see Chapter 4 for details.

Rayk replied on Monday, August 21, 2006

Okay, I can definitely see how to use the Web Service proxy as a base.  Seems like the GetPortal() method will just add the 2 lines I need to set up the proxy server info:

      wsvc.Proxy = WebRequest.DefaultWebProxy;
      wsvc.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
 

I can't figure out where to put the remoting info, but I'm not sure I need to figure it out if the web service method works.  Seems like the HttpChannel iDictionary has a spot for Credentials, but I'm not sure how to get the ICredentials interface in there, let alone created and set to the default values. 

I'll test the web service methods first.

Thanks,
-RayK

Copyright (c) Marimer LLC