Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 75804 invoked from network); 26 Aug 2005 13:47:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Aug 2005 13:47:57 -0000 Received: (qmail 94845 invoked by uid 500); 26 Aug 2005 13:47:37 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 94792 invoked by uid 500); 26 Aug 2005 13:47:37 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 94751 invoked by uid 99); 26 Aug 2005 13:47:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 06:47:37 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [131.111.8.131] (HELO ppsw-1.csi.cam.ac.uk) (131.111.8.131) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 06:47:53 -0700 X-Cam-SpamDetails: Not scanned X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cass41.ast.cam.ac.uk ([131.111.69.186]:52454) by ppsw-1.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.131]:25) with esmtp id 1E8eY8-00013J-41 (Exim 4.51) for axis-user@ws.apache.org (return-path ); Fri, 26 Aug 2005 14:47:16 +0100 Received: from cass123.ast.cam.ac.uk (cass123 [IPv6:2001:630:200:4240:203:baff:fe17:f117]) by cass41.ast.cam.ac.uk (8.12.10+Sun/8.12.10) with ESMTP id j7QDl6Zu016878 for ; Fri, 26 Aug 2005 14:47:15 +0100 (BST) Received: from cass123.ast.cam.ac.uk (localhost [127.0.0.1]) by cass123.ast.cam.ac.uk (8.13.3+Sun/8.13.3) with ESMTP id j7QDl5mZ008412 for ; Fri, 26 Aug 2005 14:47:05 +0100 (BST) Received: from localhost (gtr@localhost) by cass123.ast.cam.ac.uk (8.13.3+Sun/8.13.3/Submit) with ESMTP id j7QDl5i8008409 for ; Fri, 26 Aug 2005 14:47:05 +0100 (BST) X-Authentication-Warning: cass123.ast.cam.ac.uk: gtr owned process doing -bs Date: Fri, 26 Aug 2005 14:47:05 +0100 (BST) From: Guy Rixon To: axis-user@ws.apache.org Subject: Re: basic authentication In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If you are able to change the WSDL contract, then you can indeed include the username and password in the SOAP body. Just put them in a message part, like any other parameter. If you want to put username and password in the SOAP header, then you can use the UsernameToken mode of WSS4J to be compatible with the WS-Security standard; or you can invent your own header if you don't have to be standard or interoperable. Using WSS4J is probably better. On Fri, 26 Aug 2005, Plorks mail wrote: > hi all > > i'm currntly getting username and password using basic authentication in my > web service. > > we are using a product that doesn't support basic authentaication in the > http header, so now i have to re-write my web service. Can anyone suggest > an alternative way to do this? > > Can i set the username and password in the SOAP Envelope/body? > > Thsi is the code i'm curently using > String headerAuth = > (String)msgContext.getProperty(HTTPConstants.HEADER_AUTHORIZATION); > > if (headerAuth != null) > { > headerAuth = headerAuth.trim(); > } > > if (headerAuth != null && headerAuth.startsWith("Basic ")) > { > int i; > > headerAuth = new String(Base64.decode(headerAuth.substring(6))); > > String [] userNamePassword = headerAuth.split(":"); > > userName = userNamePassword[0]; > password = userNamePassword[1]; > } > > thanks for any help > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > Guy Rixon gtr@ast.cam.ac.uk Institute of Astronomy Tel: +44-1223-337542 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523