Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 95278 invoked from network); 5 Jan 2006 04:46:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jan 2006 04:46:21 -0000 Received: (qmail 56245 invoked by uid 500); 5 Jan 2006 04:46:15 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 56231 invoked by uid 500); 5 Jan 2006 04:46:14 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 56219 invoked by uid 99); 5 Jan 2006 04:46:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2006 20:46:14 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [209.68.5.9] (HELO relay00.pair.com) (209.68.5.9) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 04 Jan 2006 20:46:11 -0800 Received: (qmail 30535 invoked from network); 5 Jan 2006 04:45:59 -0000 Received: from unknown (HELO ?192.168.1.205?) (unknown) by unknown with SMTP; 5 Jan 2006 04:45:59 -0000 X-pair-Authenticated: 222.165.172.200 Message-ID: <43BCA483.7090607@opensource.lk> Date: Thu, 05 Jan 2006 10:45:55 +0600 From: Saminda Abeyruwan User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050727) X-Accept-Language: en-us, en MIME-Version: 1.0 To: axis-dev@ws.apache.org Subject: [Axis2]Re: "No credentials available for NTLM" References: <43BBBF71.6020707@softwarium.net> <43BBD0E3.5000200@opensource.lk> <43BBD4DF.80708@softwarium.net> In-Reply-To: <43BBD4DF.80708@softwarium.net> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Following code will allow you to connect to MS Share Point with "Integrated Windows authentication" and "Basic authentication on MS Server 2003 using Axis2 client. public class Client { private static String toEpr = "http://msserver:8008/_vti_bin/DWS.asmx?WSDL"; public static void main(String[] args) throws AxisFault { HttpTransportProperties.ProxyProperties proxy = new HttpTransportProperties().new ProxyProperties(); proxy.setUserName("msserver\\user"); proxy.setPassWord("pass"); Options options = new Options(); options.setTo(new EndpointReference(toEpr)); options.setProperty(HTTPConstants.PROXY,proxy); ServiceClient serviceClient = new ServiceClient(); serviceClient.setOptions(options); OMElement result = serviceClient.sendReceive(getPayload()); try { XMLStreamWriter writer = XMLOutputFactory.newInstance() .createXMLStreamWriter(System.out); result.serialize(writer); writer.flush(); } catch (XMLStreamException e) { e.printStackTrace(); } } private static OMElement getPayload() { OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace omNs = fac.createOMNamespace( "http://schemas.microsoft.com/sharepoint/soap/dws/", "dws"); OMElement method = fac.createOMElement("FindDoc", omNs); OMElement value = fac.createOMElement("Text", omNs); value.addChild(fac.createText(value, "Axis2 Echo String ")); method.addChild(value); System.out.println(method.getText()); return method; } } To do NTLM authentication, one needs to fill the HttpTransportProperties.ProxyProperties been with following proxy.setProxyName("xxyy"); proxy.setProxyPort(""); The prior will be the runtime setting of Basic/NTLM authentication. Apart from that one can use axis2.xml to configure the authentication. So one has to fill the axis2.xml as follows, ... HTTP/1.1 > public static void main(String[] args) throws AxisFault { > Authenticator.setDefault(new AxisAuthenticator("msserver\\user", > "pass")); > Options options = new Options(); > options.setTo(new EndpointReference(toEpr)); > options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP); > options.setUseSeparateListener(false); > options.setProperty(Constants.Configuration.ENABLE_REST, > Constants.VALUE_FALSE); > options.setProperty(Constants.USER_NAME, "msserver\\user"); > options.setProperty(Constants.PASSWORD, "pass"); > Call call = new Call(); > call.setClientOptions(options); > OMElement result = call.invokeBlocking("FindDoc", getPayload()); > > try { > XMLStreamWriter writer = > XMLOutputFactory.newInstance().createXMLStreamWriter(System.out); > result.serialize(writer); > writer.flush(); > } catch (XMLStreamException e) { > e.printStackTrace(); > } catch (FactoryConfigurationError e) { > e.printStackTrace(); > } > } > > private static OMElement getPayload() { > OMFactory fac = OMAbstractFactory.getOMFactory(); > OMNamespace omNs = > fac.createOMNamespace("http://schemas.microsoft.com/sharepoint/soap/dws/", > "dws"); > OMElement method = fac.createOMElement("FindDoc", omNs); > OMElement value = fac.createOMElement("Text", omNs); > value.addChild(fac.createText(value, "Axis2 Echo String ")); > method.addChild(value); > System.out.println(method.getText()); > return method; > } > } > > Thank you > > > Saminda Abeyruwan wrote: > > Please post your client code, So we can simulate it here. > > Thank you > > Saminda > > Serg Nesterenko wrote: > > >>>> Hello! >>>> I used Axis 2 (0.93). >>>> I try connect to MS Share Point with "Integrated Windows authentication" >>>> and "Basic authentication (also tried swith off)" on MS Server 2003. >>>> >>>> My code contain: >>>> options.setProperty(Constants.USER_NAME, "msserver\\user"); >>>> options.setProperty(Constants.PASSWORD, "pass"); >>>> and >>>> Authenticator.setDefault(new >>>> AxisAuthenticator("msserver\\user","user")); >>>> >>>> And result: >>>> - Invoking Handler 'AddressingOutHandler' in Phase 'MessageOut' >>>> - ntlm authentication scheme selected >>>> - No credentials available for NTLM @msserver:8008 >>>> >>>> org.apache.axis2.AxisFault: Transport error 401 . Error Message is >>>> >>> HTTP Error 401.2 - Unauthorized: Access is denied due to server >>>> configuration.
Internet Information Services (IIS) >>>> ................. >>>> at >>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:265) >>>> >>>> >>>> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:93) >>>> at >>>> org.apache.axis2.client.InOutMEPClient.send(InOutMEPClient.java:392) >>>> at >>>> org.apache.axis2.client.InOutMEPClient.invokeBlocking(InOutMEPClient.java:154) >>>> >>>> >>>> at org.apache.axis2.client.Call.invokeBlocking(Call.java:91) >>>> at userguide.clients.Client2.main(Client2.java:73) >>>> >>>> Why this don't work? >>>> Why i cannot to switch Client to "Basic authentication"? >>>> I not used "Code Generator Wizard". >>>> >>>> > > >> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDvKSCYmklbLuW6wYRAlgMAJ0fjWGGf8A4ZmSbCw4gxm1IQnL2oQCdFm8I wfCjoyOiu+SfBIndUL9mnoM= =9G7A -----END PGP SIGNATURE-----