Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 40851 invoked from network); 19 Aug 2008 15:45:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Aug 2008 15:45:27 -0000 Received: (qmail 40991 invoked by uid 500); 19 Aug 2008 15:45:25 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 40491 invoked by uid 500); 19 Aug 2008 15:45:23 -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 40480 invoked by uid 99); 19 Aug 2008 15:45:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Aug 2008 08:45:23 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Aug 2008 15:44:25 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KVTOA-0007Py-4u for axis-dev@ws.apache.org; Tue, 19 Aug 2008 08:44:54 -0700 Message-ID: <19053107.post@talk.nabble.com> Date: Tue, 19 Aug 2008 08:44:54 -0700 (PDT) From: ripcord To: axis-dev@ws.apache.org Subject: Set http cookie for generated web service MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: robbie.kennedy@yahoo.ie X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I have a question about AXIS and security handling. I need to set a cookie in the request header, and I'm not sure how to do this. I have created a Web Service, and automatically generated the WSDL file from this. The WSDL file uses SOAP binding with the 'document' style. I then use an ANT all of the WSDLtoJava class to generate the required java files. All examples I've seen on the web generate a Service and ServiceLocator. The Service actually extends javax.xml.rpc.Stub, and the examples show that the header can be set using the following code: MyServiceLocator locator = new MyServiceLocator(); MyService serivce = locator.getMyService(); ((javax.xml.rpc.Stub)service)._setProperty( "javax.xml.rpc.session.maintain"), Boolean.TRUE); ((javax.xml.rpc.Stub)service)._setProperty( HTTPConstants.HEADER_COOKIE, "JSESSIONID=" + sessionID); However, I do not get a ServiceLocator generated, and the Service class I get extends from 'javax.xml.ws.Stub' - therefore the cast above won't work. The class 'javax.xml.ws.Stub' does not seem to support setting a request header. The code i'm trying is using the request context as follows: ss = new MyService(wsdlURL, new QName(nameSpaceURI, localPart)); servicePort = ss.getMyServicePort(); java.util.Map requestContext = ((javax.xml.ws.BindingProvider)servicePort) .getRequestContext(); requestContext.put( org.apache.axis.transport.http.HTTPConstants.HEADER_COOKIE, "cookie_name=my_cookie"); But this is not setting the cookie. Would anyone have any idea on how to set a cookie in the header using this service? Or do I definitley have to use the SOAP rpc binding? Thanks -- View this message in context: http://www.nabble.com/Set-http-cookie-for-generated-web-service-tp19053107p19053107.html Sent from the Axis - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org