A basic example for login follows:
Code: Select all
//Assuming Dragnet is the name of the web reference
Dragnet.DragnetWebService _dragnetService = null;
public bool Login()
{
int ret = -1;
_dragnetService = null;
CookieContainer cc = new CookieContainer();
_dragnetService = new Dragnet.DragnetWebService();
_dragnetService.CookieContainer = cc;
_dragnetService.Url = "http://localhost/dragnet/dragnetwebservice.asmx";
string strAuthTicket = null;
ret = _dragnetService.LoginPlainText("username", "password", out strAuthTicket);
if (ret == 0)
{
_dragnetService.DragnetAuthValue = new Dragnet.DragnetAuth();
_dragnetService.DragnetAuthValue.Token = strAuthTicket;
return true;
}
else
return false;
}
_dragnetWebService.ModifyItem()