KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > axis > server > FlashNamespaceHandler


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 // $Id: FlashNamespaceHandler.java,v 1.11.4.1 2005/03/02 14:19:51 tdiesler Exp $
9

10 package org.jboss.net.axis.server;
11
12 import org.jboss.axis.AxisFault;
13 import org.jboss.axis.Message;
14 import org.jboss.axis.MessageContext;
15 import org.jboss.axis.handlers.BasicHandler;
16
17 import javax.xml.soap.SOAPEnvelope JavaDoc;
18
19 /**
20  * This class implements the Apache Axis Handler interface. As such, it is
21  * inserted into the chain of Axis Engine Handlers by specifying it in the
22  * server-config.wsdd file of the jboss-net-flash.sar file. This particular
23  * handler flags the generated SOAP Envelope to not include namespace
24  * declarations. This is because Flash versions 5 and MX do not support
25  * namespaces and only support simple strings.
26  * <br>
27  * <h3>Change notes</h3>
28  * <ul>
29  * </ul>
30  * @created 22.04.2002
31  * @author <a HREF="mailto:fbrier@multideck.com">Frederick N. Brier</a>
32  * @version $Revision: 1.11.4.1 $
33  */

34
35 public class FlashNamespaceHandler extends BasicHandler
36 {
37    /**
38     * The instance logger for the service. Not using a class logger
39     * because we want to dynamically obtain the logger name from
40     * concrete sub-classes.
41     */

42 // protected Logger log;
43

44 // public FlashNamespaceHandler()
45
// {
46
// super();
47

48 // log = Logger.getLogger( getClass() );
49
// log.trace( "Constructing" );
50
// }
51

52    /**
53     * Implements
54     * @see Handler#invoke( MessageContext )
55     */

56    public void invoke(MessageContext msgContext)
57    {
58       // log.trace("FlashNamespaceHandler.invoke(): Entered.");
59
removeNamespaces(msgContext);
60    }
61
62
63    /*
64       * @see Handler#onFault(MessageContext)
65    */

66    public void onFault(MessageContext msgContext)
67    {
68 // log.error( "FlashNamespaceHandler.onFault(): Entered." );
69
}
70
71
72    /**
73     * Flag the SOAP envelope not to use namespaces.
74     */

75    protected void removeNamespaces(MessageContext msgContext)
76    {
77       Message msg = msgContext.getResponseMessage();
78       try
79       {
80          SOAPEnvelope JavaDoc soapEnvelope = msg.getSOAPEnvelope();
81          boolean result = soapEnvelope.removeNamespaceDeclaration("SOAP-ENV");
82       }
83       catch (AxisFault e)
84       {
85       }
86    } // of method removeNamespaces
87

88 } // of class FlashNamespaceHandler
89
Popular Tags