Movatterモバイル変換


[0]ホーム

URL:


Wikidot.com
.wikidot.com
Share ontwitterFacebookDeliciousDiggRedditReddit
EditHistoryTagsSource
Explore »
 

Java Wiki

How to authenticate an Axis2 client running against a Windows Web Server
bouncer_big.JPG

If you are running against a Windows web server, you may have problems with authentication, if you get the following error :

INFO org.apache.commons.httpclient.auth.AuthChallengeProcessor - ntlm authentication scheme selected
INFO org.apache.commons.httpclient.HttpMethodDirector - No credentials available for NTLM <any realm>@yourhost:80
INFO org.apache.axis2.transport.http.HTTPSender - Unable to sendViaPost to url[http://yoururl]

The webserver is trying to authenticate via windows authentication, you have to set up a NTCredentials, the following code shows you how to overcome this issue :

importorg.apache.axis2.AxisFault;importorg.apache.axis2.transport.http.HttpTransportProperties;importorg.apache.commons.httpclient.Credentials;importorg.apache.commons.httpclient.NTCredentials;importorg.apache.commons.httpclient.auth.AuthScheme;importorg.apache.commons.httpclient.auth.CredentialsNotAvailableException;importorg.apache.commons.httpclient.auth.CredentialsProvider;importorg.apache.commons.httpclient.params.DefaultHttpParams;publicclassMain{publicstaticvoidmain(String...args)throwsAxisFault{finalNTCredentialsnt =newNTCredentials("your username","your password","","your domain");finalCredentialsProvidermyCredentialsProvider =newCredentialsProvider(){publicCredentialsgetCredentials(finalAuthSchemescheme,finalStringhost,intport,booleanproxy)throwsCredentialsNotAvailableException{returnnt;}};DefaultHttpParams.getDefaultParams().setParameter("http.authentication.credential-provider",myCredentialsProvider);}}
Powered byWikidot.com
Unless otherwise stated, the content of this page is licensed underCreative Commons Attribution-ShareAlike 3.0 License

Other interesting sites

Arlington, Mass.

The Arlington Wiki - Arlington, MA

SCP基金会云国分部

徜徉 等夷 媾和

BATTLESTAR GENESIS MUSH

battlestar.isunlimited.net 3012
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
See pages that link to and include this page.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp