U
Usman Shami
Hie,
I have developed some codes both in C# and VB using CDO
and ADO,which work perfectly fine in a windows
application, but they donot seem to work in a web services
application.
I am using the .NET platform with win 2k server and
exchange 2k server, with service pack 2.
The small code part is as follows(which works okay in a
windows application but not in a ASP NET web service web
method. Is it that my machine security/settings policies
need to be changed??? );
ADODB.Connection EmailCon=new ADODB.Connection();
EmailCon.Provider ="ExOLEDB.Datasource";
ADODB.Record EmailRec=new ADODB.RecordClass();
ADODB.Recordset EmailRs=new ADODB.RecordsetClass ();
string strInboxQuery,strURLInbox, strURLMailbox,
strUserName,strPassword;
ADODB.Fields Flds;
ADODB.Field Fld;
strUserName="admin";
strPassword="adminpass";
strURLMailbox="file://./backofficestorage/mytestdomain.com/
MBX/" + strUserName;
/*THROWS EXCEPTION HERE IN ASP .NET WEBSERVICES APPLICATION
/*EXCEPTION IS "Authentication Failed" while the same code
works for a forms(windows application)*/
EmailCon.Open(strURLMailbox,strUserName,strPassword,0);
EmailRec.Open( strURLMailbox,EmailCon ,
ADODB.ConnectModeEnum.adModeReadWrite,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource, strUserName,
strPassword);
strURLInbox = EmailRec.Fields
["urn:schemas:httpmail:inbox"]. Value. ToString () ;
I have developed some codes both in C# and VB using CDO
and ADO,which work perfectly fine in a windows
application, but they donot seem to work in a web services
application.
I am using the .NET platform with win 2k server and
exchange 2k server, with service pack 2.
The small code part is as follows(which works okay in a
windows application but not in a ASP NET web service web
method. Is it that my machine security/settings policies
need to be changed??? );
ADODB.Connection EmailCon=new ADODB.Connection();
EmailCon.Provider ="ExOLEDB.Datasource";
ADODB.Record EmailRec=new ADODB.RecordClass();
ADODB.Recordset EmailRs=new ADODB.RecordsetClass ();
string strInboxQuery,strURLInbox, strURLMailbox,
strUserName,strPassword;
ADODB.Fields Flds;
ADODB.Field Fld;
strUserName="admin";
strPassword="adminpass";
strURLMailbox="file://./backofficestorage/mytestdomain.com/
MBX/" + strUserName;
/*THROWS EXCEPTION HERE IN ASP .NET WEBSERVICES APPLICATION
/*EXCEPTION IS "Authentication Failed" while the same code
works for a forms(windows application)*/
EmailCon.Open(strURLMailbox,strUserName,strPassword,0);
EmailRec.Open( strURLMailbox,EmailCon ,
ADODB.ConnectModeEnum.adModeReadWrite,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource, strUserName,
strPassword);
strURLInbox = EmailRec.Fields
["urn:schemas:httpmail:inbox"]. Value. ToString () ;