Return-Path: Delivered-To: apmail-beehive-user-archive@www.apache.org Received: (qmail 98931 invoked from network); 1 Dec 2006 13:12:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Dec 2006 13:12:31 -0000 Received: (qmail 12023 invoked by uid 500); 1 Dec 2006 13:12:38 -0000 Delivered-To: apmail-beehive-user-archive@beehive.apache.org Received: (qmail 12001 invoked by uid 500); 1 Dec 2006 13:12:38 -0000 Mailing-List: contact user-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list user@beehive.apache.org Received: (qmail 11990 invoked by uid 99); 1 Dec 2006 13:12:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 05:12:38 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of BBurgess@tiaa-cref.org designates 65.82.104.36 as permitted sender) Received: from [65.82.104.36] (HELO nc89acb01isem10.tiaa-cref.org) (65.82.104.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 05:12:27 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Pass properties to WS Handler Date: Fri, 1 Dec 2006 08:11:55 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Pass properties to WS Handler Thread-Index: AccU1XFotAE0FncQSlqaj66wIB7N5gAc5miw From: "Burgess, Benjamin" To: "Beehive Users" X-OriginalArrivalTime: 01 Dec 2006 13:12:01.0263 (UTC) FILETIME=[49C307F0:01C7154A] X-PostX-Message-ID: 538681ebf593243e41526827b6e0de64@nc89acb01eess02 X-Loop-Check: X-Virus-Checked: Checked by ClamAV on apache.org Excellent trick! Thanks for the help. I had been toying with passing the two values I need in with .getStub()._setProperty("weblogic.webservice.client.proxyusername",myVal ue) and "context.getProperty("weblogic.webservice.client.proxyusername") and the password property. Because no proxy server address was defined, the username and password values were ignored by the control and service, but my handler could still use them. But I think your method of using Headers is cleaner and not as "hackish". Also, the solution needs to be thread safe as the client will be running in a Weblogic application of its own, which may have multiple users logged in at once accessing the application and making parallel calls to the web service. I still need to read up a little in this area; does the control bean get shared among threads, or is a new instance instantiated for each request. Is a new Handler instantiated for each request, etc. Thanks again for your help, Ben -----Original Message----- From: Andrew McCulloch [mailto:amccullo@gmail.com]=20 Sent: Thursday, November 30, 2006 6:15 PM To: Beehive Users Subject: Re: Pass properties to WS Handler Ben, There is a easy way to pass properties to either a client or server side handler. The difference is how the handler accesses these properties. To set properties you would use the setOuputHeaders(Element[]) method on the web service control before invoking the method you want to call. Ex: String fragment =3D "STOP"; DocumentBuilderFactory factory =3D DocumentBuilderFactory.newInstance(); Document d =3D factory.newDocumentBuilder().parse(new InputSource(new StringReader(fragment))); NodeList nl =3D d.getElementsByTagName("MyHeader"); helloWorldServiceControl.setOutputHeaders(new Element[] { nl.item(0) } ); In the server side handler (not the case you describe) you can simply retrieve the headers from the message context object. Unfortunately the headers are not put on the message context until after you client side handler is invoked, so, there is a more round-about way to access this data from the client handler. public boolean handleRequest(MessageContext context) { List outboundHeaders =3D (List)context.getProperty( weblogic.wsee.ws.dispatch.client.ConnectionHandler.OUTPUT_HEADERS); if (outboundHeaders !=3D null) { Iterator iter =3D outboundHeaders.iterator(); while (iter.hasNext()) { Element elt =3D (Element) iter.next(); if ("STOP".equals(elt.getTextContent())) { throw new IllegalArgumentException("Stopping service call due to STOP header"); } } } return true; } I am sure there are other ways to accomplish what you are after but this works for me :) I hope this helps, --Andrew On 11/30/06, Burgess, Benjamin wrote: > > Yes, I believe you are correct. Here is the relevant part of my Control > (I changed the endpoint address): > > import org.apache.beehive.controls.api.bean.ControlExtension; > import org.apache.beehive.controls.api.events.EventSet; > > import com.bea.control.ServiceControl; > > @ServiceControl.Location(urls =3D { "http://my.server.address/appname/ws" > }) > @ServiceControl.HttpSoapProtocol > @ServiceControl.Handler(operation =3D > {"org.tiaa.datalayer.DSVSecurityHandler"}) > @ServiceControl.SOAPBinding(style =3D > ServiceControl.SOAPBinding.Style.DOCUMENT, use =3D > ServiceControl.SOAPBinding.Use.LITERAL, parameterStyle =3D > ServiceControl.SOAPBinding.ParameterStyle.WRAPPED) > @ServiceControl.WSDL(resourcePath =3D "org/tiaa/datalayer/DSVNET.wsdl", > service =3D "DSVNetWebServiceService") > @ControlExtension > @SuppressWarnings("serial") > public interface DSVNetWebServiceControl extends ServiceControl { > > Ben > > -----Original Message----- > From: Andrew McCulloch [mailto:amccullo@gmail.com] > Sent: Thursday, November 30, 2006 12:22 PM > To: Beehive Users > Subject: Re: Pass properties to WS Handler > > Hi Ben, > > Can you tell me if this is a client/control side handler or > server/web-service side handler? Also a bit of the handler config file > would be helpful. > > P.S. > I am assuming that when you said you are using a control from a Weblogic > application that you are using the BEA Workshop web service control and > not > the web service control in the beehive svn tree [I don't believe the one > in > svn is shipped with the apache beehive distribution or BEA Workshop]. > Is > that correct? > > On 11/30/06, Burgess, Benjamin wrote: > > > > I am fairly new to Web Services and very new to Beehive. So far, I > love > > it. I have a Weblogic application that will be calling a web service > > running on another box via a Control. > > > > > > > > Is there a way to pass dynamic properties to a handler that I have > > configured? If I use a handler config file, then I can setup > > init-params, but these can't change from request to request. The > > "MessageContext" object can be used to pass properties between > handlers, > > but can it be accessed somehow from the client before starting the > SOAP > > request (in the Control)? > > > > > > > > Thanks, > > > > > > > > Ben > > > > > > > > ************************************************************** > > This message, including any attachments, contains confidential > information > > intended for a specific individual and purpose, and is protected by > law. If > > you are not the intended recipient, please contact sender immediately > by > > reply e-mail and destroy all copies. You are hereby notified that any > > disclosure, copying, or distribution of this message, or the taking of > any > > action based on it, is strictly prohibited. > > TIAA-CREF > > ************************************************************** > > > > > > >