Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / June 2005

Tip: Looking for answers? Try searching our database.

Webservice and Cookies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reinier v Vliet - 25 Jun 2005 09:49 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.