Azam Jalali | 2 Jan 11:24
Picon
Favicon

Unauthorized (401) exception in Exchange Server

I want to connect to a microsoft exchange server 2003 to call mkcolMet and etc.
 I used the following code :

             HttpURL hrl = new HttpURL("http://" + MailBoxManager.getDirectoryServer() + "/exchange/man/");

             NTCredentials ntc = new NTCredentials("man", "password", "opxiAppServer.cc.basamad.acc", "");
             WebdavResource wdr = new WebdavResource(hrl, ntc, WebdavResource.ALL, DepthSupport.DEPTH_1);
 boolean done=false;
   done = wdr.mkcolMethod("/exchange/temp/opxi");//.list();
             if (!done) {
                 String msg = wdr.getStatusMessage();
                 System.out.println("mesg = " + msg);
             }

 After running this code i got this exception 
 mesg= Unauthorized (401) is occured.
   Before trying with the above code snippet, I tried to access my Exchange server through Outlook Web Access
(OWA) from my browser. for the next time, when I tried to connect to the Exchange server using my code
snippet, it done successfully without exception. I need to solve it in my code without opening mailbox in
browser at first time. 
 Is this possible with Jakarta Slide ?

 Best Regards
 Azam Jalali

 
		
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
(Continue reading)

Azam Jalali | 2 Jan 13:48
Picon
Favicon

slide-user <at> jakarta.apache.org

Dear Ekan,
I appreciate your guide.
Would you please send your code sample.  
Thanks in advance
Azam Jalali

Hi Azam,
Usually FBA (Form based authentication) is turned on on the exchange server. When you try
to access the exchange server using slide, you will get a 401 error as you have not supplied
the credentials. The way to avoid this is to first supply the credentials and login using
FBA programmatically, get the session cookies and send the cookies everytime with your webdav
request.
I have done this and it works. Let me know and I can send you the code sample.
The other option is to do this using javascript (AJAX). The advantage is that the browser
will take care of sending the credentials (assuming you are executing the code from a browser
in a machine which is logged on to your network).

Hope this helps
Thanks
Ekan

________________________________

From: Azam Jalali [mailto:jalali_azam <at> yahoo.com]
Sent: Sun 12/25/2005 1:30 AM
To: slide-user <at> jakarta.apache.org
Subject: Unauthorized (401) exception (SCL: 6)

 I want to connect to a microsoft exchange server 2003 to call mkcolMethod and etc.
 I used the following code :
(Continue reading)

Rakesh Saha | 2 Jan 14:58
Picon
Favicon

Re: Slide Transaction

I am using native slide API.

Ray Sprinkle wrote:

>Are you using the Webdav interface or native slide? 
>
>-----Original Message-----
>From: Rakesh Saha [mailto:rakesh.saha <at> oracle.com] 
>Sent: Tuesday, December 20, 2005 5:30 AM
>To: Slide Users Mailing List
>Subject: Slide Transaction
>
>Hi All , 
>
>I am trying out Slide Transactions in my project.
>
>I am not able to retrieve the files or folders created in the same
>transaction before the txn is committed.
>
>I am using following code : 
>
>      <slideTransaction>.begin();
>      createFolder();      
>      List fl = <list directoires in the folder>
>      <slideTransaction>.commit();
>
>Slide Transaction -> NamespaceAccessToken 
>
>
>I am getting following error : 
(Continue reading)

Ray Sprinkle | 3 Jan 15:57
Gravatar

RE: Slide Transaction

Sorry, my experience is with the Webdav interface, I do know you have to
go through back flips with the Webdav interface to insure that
everything is part of the same transaction. 

-----Original Message-----
From: Rakesh Saha [mailto:rakesh.saha <at> oracle.com] 
Sent: Monday, January 02, 2006 8:59 AM
To: Slide Users Mailing List
Subject: Re: Slide Transaction

I am using native slide API.

Ray Sprinkle wrote:

>Are you using the Webdav interface or native slide? 
>
>-----Original Message-----
>From: Rakesh Saha [mailto:rakesh.saha <at> oracle.com]
>Sent: Tuesday, December 20, 2005 5:30 AM
>To: Slide Users Mailing List
>Subject: Slide Transaction
>
>Hi All ,
>
>I am trying out Slide Transactions in my project.
>
>I am not able to retrieve the files or folders created in the same 
>transaction before the txn is committed.
>
>I am using following code : 
(Continue reading)

Michael Oliver | 3 Jan 16:16

RE: Slide Transaction

Can I ask why you want to access files or collections before they are
committed?  The whole point of a transaction is to package things so they
either all happen or all do not.  If you are using the API then you already
have the files you put into the transaction.  If you are doing it to test
that they got created, in a read after write fashion, the transaction
process already does that internally so you can be assured the transaction
won't complete unless all the items were successful.

Michael Oliver
CTO
Alarius Systems LLC
6800 E. Lake Mead Blvd, #1096
Las Vegas, NV 89156
Phone:(702)953-8949
Fax:(702)974-0341

-----Original Message-----
From: Ray Sprinkle [mailto:rsprinkle <at> vhainc.com] 
Sent: Tuesday, January 03, 2006 6:57 AM
To: Slide Users Mailing List
Subject: RE: Slide Transaction

Sorry, my experience is with the Webdav interface, I do know you have to
go through back flips with the Webdav interface to insure that
everything is part of the same transaction. 

-----Original Message-----
From: Rakesh Saha [mailto:rakesh.saha <at> oracle.com] 
Sent: Monday, January 02, 2006 8:59 AM
To: Slide Users Mailing List
(Continue reading)

RE: slide-user <at> jakarta.apache.org

Attached is the code sample for authenticating and connecting to a MS Exchange server 2003.
It is a sample JSP.

Let me know if oyu have any questions.

Thanks
Ekan

-----Original Message-----
From: Azam Jalali [mailto:jalali_azam <at> yahoo.com]
Sent: Monday, January 02, 2006 4:49 AM
To: slide-user <at> jakarta.apache.org
Subject: slide-user <at> jakarta.apache.org

Dear Ekan,
I appreciate your guide.
Would you please send your code sample.  
Thanks in advance
Azam Jalali

Hi Azam,
Usually FBA (Form based authentication) is turned on on the exchange server. When you try
to access the exchange server using slide, you will get a 401 error as you have not supplied
the credentials. The way to avoid this is to first supply the credentials and login using
FBA programmatically, get the session cookies and send the cookies everytime with your webdav
request.
I have done this and it works. Let me know and I can send you the code sample.
The other option is to do this using javascript (AJAX). The advantage is that the browser
will take care of sending the credentials (assuming you are executing the code from a browser
in a machine which is logged on to your network).
(Continue reading)

Warwick Burrows | 3 Jan 20:28

RE: Slide Transaction


Yes but there are cases where you need to run a command and then get
information on the object created to store yourself or return to a
caller. For example a lock gets created on an object and in another
method call within the same transaction we check that the object is
locked before it can allow changes to the object. The latter can't
assume that the object is locked and must test it. So the transaction
must keep a record that this object was previously locked in this
transaction. Also the WebDAV external transaction implementation in the
WebDAV client relies on it. When a transaction is started you can create
a parent collection (mkcol) and put files in it (put) and then
potentially commit or roll it all back. The calls to put the files must
be able to see the parent collection in you just created in the same
transaction. The same mechanism used to do transactions internally in
the slide server is also used to do external transactions. 

There is probably something wrong with the enlistment of the services
between the calls within the transaction. Ie. one of the calls, either
the create or the list, is not enlisting resources to the current
transaction. Maybe that is something that the caller is supposed to do
expicitly when using the Slide API?? Maybe the calls you are making are
not high enough up in the call hieararchy to be calling the right chain
of calls to enlist the resources to the transaction? I don't know as
I've only used the transaction implementation from the WebDAV client
interface.  

I can only suggest that you try comparing your Slide API transaction
calls with the sequence of events that happen when a transaction is
started by the WebDAV client entry point which is in
AbstractWebdavMethod.run(). Look for "token.begin()" and try comparing
(Continue reading)

Rakesh Saha | 4 Jan 07:46
Picon
Favicon

Re: Slide Transaction

Thanks for your help. I will take a look but most likely there are some 
issues with my code itself which is similar to Webdav but may be I 
missed something.

My usecase is the following :

1. Create files in slide. [ not committed ]
2. Read the files from slide for creating some record in DB.
3. If creation of DB is successful then commit the txn of slide.

Hope this will help.

Thanks,
Rakesh

Warwick Burrows wrote:

>Yes but there are cases where you need to run a command and then get
>information on the object created to store yourself or return to a
>caller. For example a lock gets created on an object and in another
>method call within the same transaction we check that the object is
>locked before it can allow changes to the object. The latter can't
>assume that the object is locked and must test it. So the transaction
>must keep a record that this object was previously locked in this
>transaction. Also the WebDAV external transaction implementation in the
>WebDAV client relies on it. When a transaction is started you can create
>a parent collection (mkcol) and put files in it (put) and then
>potentially commit or roll it all back. The calls to put the files must
>be able to see the parent collection in you just created in the same
>transaction. The same mechanism used to do transactions internally in
(Continue reading)

Warwick Burrows | 4 Jan 18:18

RE: Slide Transaction


The algoritm you've given should be fine as long as you are reading the
files (step 2) in the same transaction as you created the files (step
1). The reason it isn't working is probably because the transaction
methods you are calling are not the right ones. Understanding how Slide
uses transactions internally may point you to the right Slide API calls
to use.

The other option is that it's a bug in the Slide API. Historically the
Slide APIs are not used as much as the WebDAV API and, because of this,
they have not progresses as much and are almost unsupported. The problem
may just be that nobody has gotten transaction integration working from
the Slide API.

Warwick

> -----Original Message-----
> From: Rakesh Saha [mailto:rakesh.saha <at> oracle.com] 
> Sent: Wednesday, January 04, 2006 12:46 AM
> To: Slide Users Mailing List
> Cc: ollie <at> alariussystems.com
> Subject: Re: Slide Transaction
> 
> 
> Thanks for your help. I will take a look but most likely 
> there are some 
> issues with my code itself which is similar to Webdav but may be I 
> missed something.
> 
> My usecase is the following :
(Continue reading)

Xiaobo Yang | 7 Jan 02:37
Picon

Could not send email with attachment to ms exchange server

Hi, I can send an email using Slide through MS exchange server but have
problems to add attachment. I used the code below but always with status
code 403 returned. I suppose attachment can be added to the message body.
Any idea? Thanks in advanced.

Xiaobo Yang

             PutMethod putMethod = new PutMethod(sUri); // sUri - mail
submission uri
                         putMethod.setRequestHeader("MIME-Version", "1.0");
                         String boundary = "lalala";
                         putMethod.setRequestHeader("Content-Type",
                                       "multipart/mixed; boundary=\"" +
                                       boundary + "\"");
//putMethod.setRequestHeader("Content-Disposition", "attachment;
filename=\"ral_031105.txt\"");
                         putMethod.setRequestHeader("Translate", "f");
                         putMethod.setRequestHeader("Saveinsent", "f");
//putMethod.setRequestHeader("Content-Type", "message/rfc821");

                         String sQuery = "--" + boundary + CRLF +
                            "Content-Type: message/rfc821" + CRLF + CRLF +
                            "MAIL FROM:<" + email.getFrom() + ">" + CRLF +
                            "RCPT TO:<" + email.getTo() + ">" + CRLF +
                            "RCPT TO:<" + email.getCc() + ">" + CRLF + CRLF
+
                            "Subject:" + email.getSubject() + CRLF + CRLF +
                            email.getBody() + CRLF + CRLF +
                            "--" + boundary + "--" + CRLF +
                            "Content-Type: text/plain" + CRLF +
(Continue reading)


Gmane