So I figured out how to get httpclient involved, and I believe I'm passing everything correctly. However, I'm still getting "not authorized" when I try executing the service.
Here's what I get in the eclipse console: Feb 16, 2008 8:22:01 AM org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme INFO: ntlm authentication scheme selected Feb 16, 2008 8:22:01 AM org.apache.commons.httpclient.HttpMethodBase readResponse INFO: Discarding unexpected response: HTTP/1.1 100 Continue When I watch it in tcpmon, I see 3 separate connections (I'll post the requests down below). When I access the URL in the browser, everything works fine. So being pretty unfamiliar with this stuff, I think I've hit my limit. Any ideas on why I'd still be getting access denied even though i'm passing the username and password and even though it does appear to be attempting to be using the ntlm scheme? (besides "wrong username/password"?) Thanks so much. Marc the resquests I see in tcpmon: #1 POST /mxunit/framework/RemoteFacade.cfc?wsdl HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "" User-Agent: Axis/1.4 Host: 127.0.0.1:1234 Content-Length: 374 <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:ping soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://framework.mxunit"/></soapenv:Body></soapenv:Envelope> #2 POST /mxunit/framework/RemoteFacade.cfc?wsdl HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "" User-Agent: Axis/1.4 Content-Length: 374 Authorization: NTLM TlRMTVNTUAABAAAABlIAAAcABwAnAAAABwAHACAAAABNQVJDTkVUTUFSQ05FVA== Host: 127.0.0.1:1234 <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:ping soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://framework.mxunit"/></soapenv:Body></soapenv:Envelope>POST /mxunit/framework/RemoteFacade.cfc?wsdl HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "" User-Agent: Axis/1.4 Content-Length: 374 Authorization: NTLM TlRMTVNTUAADAAAAGAAYAFYAAAAAAAAAbgAAAAcABwBAAAAACAAIAEcAAAAHAAcATwAAAAAAAABuAAAABlIAAE1BUkNORVRNQVJDVEVTVE1BUkNORVSjGk/OeGS7O/F1TcJoxhbk4VLiL07IL1A= Host: localhost:1234 <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:ping soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://framework.mxunit"/></soapenv:Body></soapenv:Envelope> #3 POST /mxunit/framework/RemoteFacade.cfc?wsdl HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.4 Host: 127.0.0.1:1234 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 374 Authorization: Basic TUFSQ05FVFxtYXJjdGVzdDo= chunked: false <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:ping soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://framework.mxunit"/></soapenv:Body></soapenv:Envelope> On Feb 15, 2008 11:09 AM, Marc Esher <[EMAIL PROTECTED]> wrote: > Greetings all. I'm using Axis 1.4 but have the option of moving to > axis2 if I have to in order to achieve my goal. I've got an eclipse > plugin that makes webservice calls; it currently uses the stubs > generated with wsdl2java. > > the URL for the service could be a local machine without any > authentication, or it could be some other machine that uses an > authentication mechanism (basic, NTLM, etc). for the local stuff, > everything works fine. But when I try to hit the service on a server > requiring authentication it fails, naturally. > > My specific question is: with axis 1.4, is there a generic way of > working with the various different authentication mechanisms if all I > know is the username and password? For example, I understand that this > is fairly easy with httpclient using something along these lines: > > if(!authMethod.equals("no_auth")){ > List authPrefs = new ArrayList(3); > authPrefs.add(AuthPolicy.DIGEST); > authPrefs.add(AuthPolicy.BASIC); > authPrefs.add(AuthPolicy.NTLM); > > this.client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, > authPrefs); > this.client.getState().setCredentials(AuthScope.ANY, new > UsernamePasswordCredentials(username, password)); > this.doAuthentication = true; > } > > Can I achieve this same kind of generic coding using Axis 1.4? IF > not, can I achieve it (or something similar) with Axis2? > > Mainly, I want to minimize the data i need to collect inside the > eclipse plugin... I don't want to ask the user what type of > authentication method is being used, for example. Just get the > username and password and have the service engine figure it out. > > Please forgive if this is a n00b question... I'm not too familiar with > coding to authentication schemes. > > Thanks in advance. > > Marc > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
