I have the same problem like this guy here: http://support.sourcegear.com/viewtopic.php?t=5641
I want to use web services to build a client that will allow me to integrate dragnet with another application. When I try to get project from db I get the following error:
{System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: 1004: Session Timed Out
at Mantis.DragnetWebService.ThrowSoapException(Exception e, Int32 nStatusCode, XmlQualifiedName code)
at Mantis.DragnetWebService.CheckAuthValidity(HttpSessionState hss, DragnetAuth ma)
at Mantis.DragnetWebService.ListProjects(MantisProject[]& mProjects)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TSF.Bugtracker.Dragnet.DragnetWebService.ListProjects(MantisProject[]& mProjects) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\TSF.Bugtracker\TSF.Bugtracker\Web References\Dragnet\Reference.cs:line 456
at TSF.Bugtracker.Bugtracker.Bugtracker_Load(Object sender, EventArgs e) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2005\Projects\TSF.Bugtracker\TSF.Bugtracker\Bugtracker.cs:line 91}
WebServices help
Moderator: SourceGear
From the looks of the stack trace, you don't have a cookie set for authentication.
Does your web request contain a valid cookie container? Before your first request make sure you have a created cookie container, and then check after the call, the authentication ticket is set before making any other web service calls.
Does your web request contain a valid cookie container? Before your first request make sure you have a created cookie container, and then check after the call, the authentication ticket is set before making any other web service calls.
Jeff Clausius
SourceGear
SourceGear
-
- Posts: 5
- Joined: Fri Nov 10, 2006 8:34 am
RE: WebServices help
This is the code that I am using:
int ret = -1;
string authTicket;
Dragnet.MantisProject[] Projects;
Dragnet.DragnetWebService dws = new Dragnet.DragnetWebService();
ret = dws.LoginPlainText("admin", "bobby", out authTicket);
if (0 == ret)
{
dws.DragnetAuthValue = new Dragnet.DragnetAuth();
dws.DragnetAuthValue.Token = authTicket;
CookieContainer cc = new CookieContainer();
dws.CookieContainer = cc;
// get a list of projects
ret = dws.ListProjects(out Projects);
foreach (Dragnet.MantisProject current in Projects)
{
if (current.Active)
{
// get all the incidents in this project
Dragnet.MantisItemQueryFilter qf = new Dragnet.MantisItemQueryFilter();
Dragnet.MantisItemExpanded[] items;
qf.Projects[0] = current.ID;
ret = dws.QueryItems(qf, true, out items);
}
}
}
Maybe now it's more clear. I will appreciate any suggestions.
int ret = -1;
string authTicket;
Dragnet.MantisProject[] Projects;
Dragnet.DragnetWebService dws = new Dragnet.DragnetWebService();
ret = dws.LoginPlainText("admin", "bobby", out authTicket);
if (0 == ret)
{
dws.DragnetAuthValue = new Dragnet.DragnetAuth();
dws.DragnetAuthValue.Token = authTicket;
CookieContainer cc = new CookieContainer();
dws.CookieContainer = cc;
// get a list of projects
ret = dws.ListProjects(out Projects);
foreach (Dragnet.MantisProject current in Projects)
{
if (current.Active)
{
// get all the incidents in this project
Dragnet.MantisItemQueryFilter qf = new Dragnet.MantisItemQueryFilter();
Dragnet.MantisItemExpanded[] items;
qf.Projects[0] = current.ID;
ret = dws.QueryItems(qf, true, out items);
}
}
}
Maybe now it's more clear. I will appreciate any suggestions.
-
- Posts: 5
- Joined: Fri Nov 10, 2006 8:34 am
RE: WebServices help
I've created a cookie container before the call of LoginPlainText() like that
Dragnet.DragnetWebService dws = new Dragnet.DragnetWebService();
CookieContainer cc = new CookieContainer();
dws.CookieContainer = cc;
ret = dws.LoginPlainText("admin", "bobby", out authTicket);
and it worked.
Thank you Jeff.
Bobby.
Dragnet.DragnetWebService dws = new Dragnet.DragnetWebService();
CookieContainer cc = new CookieContainer();
dws.CookieContainer = cc;
ret = dws.LoginPlainText("admin", "bobby", out authTicket);
and it worked.
Thank you Jeff.
Bobby.