You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Andrew Bruno <an...@gmail.com> on 2009/06/16 11:11:20 UTC

Axis2 NTLM not working on SBS2008 with EWS

Hello all,

I have been developing an ExchangeWebServices client using axis2 (xmlbeans),
and cannot seem to get NTLM working.
Basic Authentication is working.

I have a class that extends the generated stub.

It has a constructor

    public ExchangeWebServiceBinding(String userName, String passWord,
boolean secure, String ewsPath, String host, String ntDomain, int port)
            throws RemoteException {
        super(createTargetEndPointUrl(ewsPath, secure, host, port,
ewsPath));
        setAuthenticationParameters(userName, passWord, host, ntDomain,
port);
    }

The setAuthenticationParameters does the authentication:

    private void setAuthenticationParameters(String userName, String
passWord, String host, String ntDomain, int port) throws RemoteException {
        Protocol AlcHttpsProtocol = new Protocol(HTTPS, new
EasySSLProtocolSocketFactory(), port);
        Protocol.registerProtocol(HTTPS, AlcHttpsProtocol);

        Options options = this._getServiceClient().getOptions();

        HttpTransportProperties.Authenticator ntlmAuthentication =  new
HttpTransportProperties.Authenticator();
        ntlmAuthentication.setUsername(userName);
        ntlmAuthentication.setPassword(passWord);
        ntlmAuthentication.setHost(host);
        ntlmAuthentication.setPort(port);
        ntlmAuthentication.setRealm(null);
        ntlmAuthentication.setDomain(ntDomain);
        ntlmAuthentication.setAllowedRetry(true);

        ArrayList authSchemes = new ArrayList();
        authSchemes.add(AuthPolicy.NTLM);
        ntlmAuthentication.setAuthSchemes(authSchemes);

        options.setProperty(HTTPConstants.AUTHENTICATE, ntlmAuthentication);

            // Set to 5 minutes
        options.setTimeOutInMilliSeconds(300000);

        this._getServiceClient().setOptions(options);

        logger.info("Authentication parameters set for user [" + userName +
"]");
    }


I have setup SBS2008 with "Windows Authentication" enabled on the
SERVER\Sites\SBS Web Applications\EWS folder, and all others disabled.

I keep getting 401 errors.  If I change the AuthPolicy.NTLM to
AuthPolicy.BASIC, and enable BASIC on the server it works.

Does anyone have any ideas?  Is what I am doing above correct? or is there
another way?

Thanks
Andrew

P.S.  Also, http://ws.apache.org/axis2/1_3/http-transport.html talks about
NTCredentials.  Do I need to use these?  How to I set them in the stub?

RE: Max size of request for web services

Posted by Martin Gainty <mg...@hotmail.com>.
following this up on 2 other threads
configuring the connector to use Unix sendfile
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html

DiskFileUpload (with commons-fileupload)
http://www2.lifl.fr/~lemeur/car/fileupload/

asynchronous connectors
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Tue, 16 Jun 2009 13:41:13 +0200
> Subject: Re: Max size of request for web services
> From: andreas.veithen@gmail.com
> To: axis-user@ws.apache.org
> 
> That depends on many factors, such as the type of message (plain SOAP,
> SwA or MTOM), what kind of databinding is used, etc.
> 
> Andreas
> 
> On Tue, Jun 16, 2009 at 13:26, Sudhanshu Umalkar
> Umalkar<su...@cisco.com> wrote:
> > Hi
> >
> >        What is the max size of the request that can be submitted to a web
> > service? Can 50mb be submitted at one go?
> >
> > Regards,
> > Sudhanshu
> >
> >

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Re: Max size of request for web services

Posted by Paul Fremantle <pz...@gmail.com>.
As Andreas points out, it depends how you code it. But if its just a
file, supported through MTOM, then yes it can be more than 50Mb.

Paul

On Tue, Jun 16, 2009 at 12:41 PM, Andreas
Veithen<an...@gmail.com> wrote:
> That depends on many factors, such as the type of message (plain SOAP,
> SwA or MTOM), what kind of databinding is used, etc.
>
> Andreas
>
> On Tue, Jun 16, 2009 at 13:26, Sudhanshu Umalkar
> Umalkar<su...@cisco.com> wrote:
>> Hi
>>
>>        What is the max size of the request that can be submitted to a web
>> service? Can 50mb be submitted at one go?
>>
>> Regards,
>> Sudhanshu
>>
>>
>



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

Re: Max size of request for web services

Posted by Andreas Veithen <an...@gmail.com>.
That depends on many factors, such as the type of message (plain SOAP,
SwA or MTOM), what kind of databinding is used, etc.

Andreas

On Tue, Jun 16, 2009 at 13:26, Sudhanshu Umalkar
Umalkar<su...@cisco.com> wrote:
> Hi
>
>        What is the max size of the request that can be submitted to a web
> service? Can 50mb be submitted at one go?
>
> Regards,
> Sudhanshu
>
>

Max size of request for web services

Posted by Sudhanshu Umalkar Umalkar <su...@cisco.com>.
Hi

	What is the max size of the request that can be submitted to a web
service? Can 50mb be submitted at one go?

Regards,
Sudhanshu


Re: Axis2 NTLM not working on SBS2008 with EWS

Posted by Andrew Bruno <an...@gmail.com>.
Does anyone know if its possible to downgrade NTLM on SBS2008? (for testing
purposes)?

Also, I am using Axis2 1.3.

On Tue, Jun 16, 2009 at 7:32 PM, Andreas Veithen
<an...@gmail.com>wrote:

> Axis2 currently only has support for NTLMv1. This may explain the
> problem. See also AXIS2-4318.
>
> Andreas
>
> On Tue, Jun 16, 2009 at 11:11, Andrew Bruno<an...@gmail.com> wrote:
> > Hello all,
> >
> > I have been developing an ExchangeWebServices client using axis2
> (xmlbeans),
> > and cannot seem to get NTLM working.
> > Basic Authentication is working.
> >
> > I have a class that extends the generated stub.
> >
> > It has a constructor
> >
> >     public ExchangeWebServiceBinding(String userName, String passWord,
> > boolean secure, String ewsPath, String host, String ntDomain, int port)
> >             throws RemoteException {
> >         super(createTargetEndPointUrl(ewsPath, secure, host, port,
> > ewsPath));
> >         setAuthenticationParameters(userName, passWord, host, ntDomain,
> > port);
> >     }
> >
> > The setAuthenticationParameters does the authentication:
> >
> >     private void setAuthenticationParameters(String userName, String
> > passWord, String host, String ntDomain, int port) throws RemoteException
> {
> >         Protocol AlcHttpsProtocol = new Protocol(HTTPS, new
> > EasySSLProtocolSocketFactory(), port);
> >         Protocol.registerProtocol(HTTPS, AlcHttpsProtocol);
> >
> >         Options options = this._getServiceClient().getOptions();
> >
> >         HttpTransportProperties.Authenticator ntlmAuthentication =  new
> > HttpTransportProperties.Authenticator();
> >         ntlmAuthentication.setUsername(userName);
> >         ntlmAuthentication.setPassword(passWord);
> >         ntlmAuthentication.setHost(host);
> >         ntlmAuthentication.setPort(port);
> >         ntlmAuthentication.setRealm(null);
> >         ntlmAuthentication.setDomain(ntDomain);
> >         ntlmAuthentication.setAllowedRetry(true);
> >
> >         ArrayList authSchemes = new ArrayList();
> >         authSchemes.add(AuthPolicy.NTLM);
> >         ntlmAuthentication.setAuthSchemes(authSchemes);
> >
> >         options.setProperty(HTTPConstants.AUTHENTICATE,
> ntlmAuthentication);
> >
> >             // Set to 5 minutes
> >         options.setTimeOutInMilliSeconds(300000);
> >
> >         this._getServiceClient().setOptions(options);
> >
> >         logger.info("Authentication parameters set for user [" +
> userName +
> > "]");
> >     }
> >
> >
> > I have setup SBS2008 with "Windows Authentication" enabled on the
> > SERVER\Sites\SBS Web Applications\EWS folder, and all others disabled.
> >
> > I keep getting 401 errors.  If I change the AuthPolicy.NTLM to
> > AuthPolicy.BASIC, and enable BASIC on the server it works.
> >
> > Does anyone have any ideas?  Is what I am doing above correct? or is
> there
> > another way?
> >
> > Thanks
> > Andrew
> >
> > P.S.  Also, http://ws.apache.org/axis2/1_3/http-transport.html talks
> about
> > NTCredentials.  Do I need to use these?  How to I set them in the stub?
> >
> >
> >
> >
>

Re: Axis2 NTLM not working on SBS2008 with EWS

Posted by Andreas Veithen <an...@gmail.com>.
Axis2 currently only has support for NTLMv1. This may explain the
problem. See also AXIS2-4318.

Andreas

On Tue, Jun 16, 2009 at 11:11, Andrew Bruno<an...@gmail.com> wrote:
> Hello all,
>
> I have been developing an ExchangeWebServices client using axis2 (xmlbeans),
> and cannot seem to get NTLM working.
> Basic Authentication is working.
>
> I have a class that extends the generated stub.
>
> It has a constructor
>
>     public ExchangeWebServiceBinding(String userName, String passWord,
> boolean secure, String ewsPath, String host, String ntDomain, int port)
>             throws RemoteException {
>         super(createTargetEndPointUrl(ewsPath, secure, host, port,
> ewsPath));
>         setAuthenticationParameters(userName, passWord, host, ntDomain,
> port);
>     }
>
> The setAuthenticationParameters does the authentication:
>
>     private void setAuthenticationParameters(String userName, String
> passWord, String host, String ntDomain, int port) throws RemoteException {
>         Protocol AlcHttpsProtocol = new Protocol(HTTPS, new
> EasySSLProtocolSocketFactory(), port);
>         Protocol.registerProtocol(HTTPS, AlcHttpsProtocol);
>
>         Options options = this._getServiceClient().getOptions();
>
>         HttpTransportProperties.Authenticator ntlmAuthentication =  new
> HttpTransportProperties.Authenticator();
>         ntlmAuthentication.setUsername(userName);
>         ntlmAuthentication.setPassword(passWord);
>         ntlmAuthentication.setHost(host);
>         ntlmAuthentication.setPort(port);
>         ntlmAuthentication.setRealm(null);
>         ntlmAuthentication.setDomain(ntDomain);
>         ntlmAuthentication.setAllowedRetry(true);
>
>         ArrayList authSchemes = new ArrayList();
>         authSchemes.add(AuthPolicy.NTLM);
>         ntlmAuthentication.setAuthSchemes(authSchemes);
>
>         options.setProperty(HTTPConstants.AUTHENTICATE, ntlmAuthentication);
>
>             // Set to 5 minutes
>         options.setTimeOutInMilliSeconds(300000);
>
>         this._getServiceClient().setOptions(options);
>
>         logger.info("Authentication parameters set for user [" + userName +
> "]");
>     }
>
>
> I have setup SBS2008 with "Windows Authentication" enabled on the
> SERVER\Sites\SBS Web Applications\EWS folder, and all others disabled.
>
> I keep getting 401 errors.  If I change the AuthPolicy.NTLM to
> AuthPolicy.BASIC, and enable BASIC on the server it works.
>
> Does anyone have any ideas?  Is what I am doing above correct? or is there
> another way?
>
> Thanks
> Andrew
>
> P.S.  Also, http://ws.apache.org/axis2/1_3/http-transport.html talks about
> NTCredentials.  Do I need to use these?  How to I set them in the stub?
>
>
>
>