Hi,
I'm trying to access a few webservices (asmx) which are stored on the
same remote computer (e.g.: test.name.com). Now the first asmx which I
add gets a namespace: com.name.test and the second one get a
namespace: com.name.test2 whatever I do this is always like this.
Now the first asmx file handles authentication... e.g.:
com.name.test.LogonService LoginServer = new com.name.test.LogonService();
...
if(LogonServer.Logon(username, password)==true)
{
//etc
}
this works fine...
The authentication stores a cookie to make sure you are authenticated.
however the other service knows nothing about this cookie.
so the other service could be like this:
com.name.test2.InteractionService IntServer = new
com.name.test2.InteractionService();
...
if(IntServer.SomeFunction(...)==true)
{
//etc
}
Returns errors that I am not authenticated.
how can the cookie obtained with the first service be used with the
second service??
Thanks!
Reinier
p.s. I made this whole thing using regular HTTP commands and it works
good. (that is, when remebering all the cookies). Of course, I'd prefer
using this method since it is much more simple if it would work.
Reinier v Vliet - 25 Jun 2005 10:53 GMT
ok found the solution myself:
before calling the Logon I have to install a cookiecontainer:
LogonServer.CookieContainer = new CookieContainer();
and then I copy this cookie container to every subsequent call:
IntServer.CookieContainer = LogonServer.CookieContainer;
R
> Hi,
>
[quoted text clipped - 40 lines]
> good. (that is, when remebering all the cookies). Of course, I'd prefer
> using this method since it is much more simple if it would work.