L
Laurent Bugnion
I posted this in the WinForms forum, and didn't get an answer yet. Come
to think of it, I am sure some of you guys were confronted to that
problem too, because the same scenario can happen in ASP.NET too
(server-side of course). Allow me to post here too:
Hi,
I got a problem when I try to connect to a stateful web service using a
Windows Forms application (actually, a WPF application, but it's the same).
Simplified code:
SERVER:
[WebService( Namespace = "http://www.galasoft-lb.ch/" )]
[WebServiceBinding( ConformsTo = WsiProfiles.BasicProfile1_1 )]
[ToolboxItem( false )]
public class Service1 : System.Web.Services.WebService
{
[WebMethod( EnableSession=true )]
public string GetSessionId()
{
return Session.SessionID;
}
}
CLIENT:
private Service1 m_oService = new Service1();
public Form1()
{
InitializeComponent();
m_oService.CookieContainer = new CookieContainer();
}
private void bnExecute_Click( object sender, EventArgs e )
{
try
{
DisplayResults( m_oService.GetSessionId(), false );
}
catch ( Exception ex )
{
DisplayResults( ex.Message, true );
}
}
Any idea what's causing the problem? The cookies are never set.
Thanks,
Laurent
to think of it, I am sure some of you guys were confronted to that
problem too, because the same scenario can happen in ASP.NET too
(server-side of course). Allow me to post here too:
Hi,
I got a problem when I try to connect to a stateful web service using a
Windows Forms application (actually, a WPF application, but it's the same).
Simplified code:
SERVER:
[WebService( Namespace = "http://www.galasoft-lb.ch/" )]
[WebServiceBinding( ConformsTo = WsiProfiles.BasicProfile1_1 )]
[ToolboxItem( false )]
public class Service1 : System.Web.Services.WebService
{
[WebMethod( EnableSession=true )]
public string GetSessionId()
{
return Session.SessionID;
}
}
CLIENT:
private Service1 m_oService = new Service1();
public Form1()
{
InitializeComponent();
m_oService.CookieContainer = new CookieContainer();
}
private void bnExecute_Click( object sender, EventArgs e )
{
try
{
DisplayResults( m_oService.GetSessionId(), false );
}
catch ( Exception ex )
{
DisplayResults( ex.Message, true );
}
}
Any idea what's causing the problem? The cookies are never set.
Thanks,
Laurent