Webservice and proxy
-
Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:
MyWebservice service = new MyWebservice();
WebProxy iProxy = new WebProxy(_proxyAdress, true);
service.Proxy = iProxy;
...
if(service.LogOn(user, pass))
{...
data = service.GetMyData();
now what happens is that the session variables are lost on the GetMyData() call on the server side:
[WebMethod (EnableSession = true)]
public bool Logon(string s, string p)
{
...Context.Session.Add ("LoggedIn", true);
...
return
}[WebMethod (EnableSession = true)]
public SomeData GetMyData()
{...
if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null
...
}Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)
-
Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:
MyWebservice service = new MyWebservice();
WebProxy iProxy = new WebProxy(_proxyAdress, true);
service.Proxy = iProxy;
...
if(service.LogOn(user, pass))
{...
data = service.GetMyData();
now what happens is that the session variables are lost on the GetMyData() call on the server side:
[WebMethod (EnableSession = true)]
public bool Logon(string s, string p)
{
...Context.Session.Add ("LoggedIn", true);
...
return
}[WebMethod (EnableSession = true)]
public SomeData GetMyData()
{...
if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null
...
}Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)
Have you tried regenerating the proxy?
CCC solved so far: 2 (including a Hard One!)
-
Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:
MyWebservice service = new MyWebservice();
WebProxy iProxy = new WebProxy(_proxyAdress, true);
service.Proxy = iProxy;
...
if(service.LogOn(user, pass))
{...
data = service.GetMyData();
now what happens is that the session variables are lost on the GetMyData() call on the server side:
[WebMethod (EnableSession = true)]
public bool Logon(string s, string p)
{
...Context.Session.Add ("LoggedIn", true);
...
return
}[WebMethod (EnableSession = true)]
public SomeData GetMyData()
{...
if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null
...
}Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)
I suppose you need to attach
CookieContainer
to your web service instance using CookieContainer property ofSoapHttpClientProtocol
class.service.CookieContainer=new System.Net.CookieContainer();
Read here more about Session and web methods. :)
Life is a stage and we are all actors!
-
Have you tried regenerating the proxy?
CCC solved so far: 2 (including a Hard One!)
-
I suppose you need to attach
CookieContainer
to your web service instance using CookieContainer property ofSoapHttpClientProtocol
class.service.CookieContainer=new System.Net.CookieContainer();
Read here more about Session and web methods. :)
Life is a stage and we are all actors!