John,

Thanks. Just applied them (semantically). 

CGJ

-----Ursprüngliche Nachricht-----
Von: John Fawcett [mailto:[EMAIL PROTECTED]] 
Gesendet: Mittwoch, 8. Januar 2003 02:22
An: [EMAIL PROTECTED]
Betreff: [JBoss-dev] patch for axis1.1beta upgrade



Hi, 

Below is a patch to upgrade the jboss sources to use axis1.1beta. 
The files modified are:
jboss.net/src/main/org/jboss/net/axis/server/AxisService.java
jboss.net/src/main/org/jboss/net/jmx/adaptor/AttributeSerializer.java
jboss.net/src/main/org/jboss/net/jmx/adaptor/ObjectNameSerializer.java

I've been using this modified source to run sessionbean-based web-services,
and it seems to be working fine for me.

hope this is useful,
fawce

---
..../../../../jboss-head/jboss.net/src/main/org/jboss/net/axis/server/Axis
Service.java    2003-01-07 12:30:37.000000000 -0500
+++
..../../../../tamale_jboss4/jboss.net/src/main/org/jboss/net/axis/server/A
xisService.java 2002-12-15 10:37:09.000000000 -0500
@@ -5,7 +5,7 @@
  * See terms of license at gnu.org.
  */
 
-// $Id: AxisService.java,v 1.32 2003/01/07 17:30:37 cgjung Exp $
+// $Id: AxisService.java,v 1.2 2002/12/15 15:37:09 jfawcett Exp $
 
 package org.jboss.net.axis.server;
 
@@ -58,6 +58,7 @@
 import javax.naming.LinkRef;
 import javax.naming.Context;
 import javax.naming.NamingException;
+import javax.xml.parsers.ParserConfigurationException;
 
 import java.io.FilenameFilter;
 import java.io.File;
@@ -82,7 +83,7 @@
  * within JMX.
  * @created 27. September 2001
  * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>
- * @version $Revision: 1.32 $
+ * @version $Revision: 1.2 $
  */
 
 public class AxisService
@@ -409,52 +410,57 @@
          Document doc= (Document) sdi.metaData;
          // the original command
          Element root= doc.getDocumentElement();
+         // the deployment command document
+         Document deployDoc = null;
          
+         Document deployClientDoc = null;
          try{
-            
-            // the deployment command document
-            Document deployDoc= XMLUtils.newDocument();
-            // the client deployment command document
-            Document deployClientDoc= XMLUtils.newDocument();
-            // create command
-            Element deploy=
-               deployDoc.createElementNS(root.getNamespaceURI(),
"deployment");
-            // create command
-            Element deployClient=
-               deployClientDoc.createElementNS(
-                  root.getNamespaceURI(),
-                     "deployment");
-
-            NamedNodeMap attributes= root.getAttributes();
-            for (int count= 0; count < attributes.getLength(); count++)
{
-               Attr attribute= (Attr) attributes.item(count);
-               deploy.setAttributeNodeNS(
-                  (Attr) deployDoc.importNode(attribute, true));
-               deployClient.setAttributeNodeNS(
-                  (Attr) deployClientDoc.importNode(attribute, true));
-            }
+         deployDoc= XMLUtils.newDocument();
+         // the client deployment command document
+          deployClientDoc= XMLUtils.newDocument();
+         } catch (ParserConfigurationException e){
+               e.printStackTrace();
+         }
+         
+         // create command
+         Element deploy=
+            deployDoc.createElementNS(root.getNamespaceURI(),
"deployment");
+         // create command
+         Element deployClient=
+            deployClientDoc.createElementNS(
+               root.getNamespaceURI(),
+               "deployment");
 
-            // and insert the nodes from the original document
-            // and sort out the ejb-ref extensions
-            NodeList children= root.getChildNodes();
-            for (int count= 0; count < children.getLength(); count++) {
-               Node actNode= children.item(count);
-               if (actNode instanceof Element) {
-                  Element actElement= (Element) actNode;
-
-                 if (actElement.getTagName().equals("ejb-ref")) {
-
-                     String refName=
-                        MetaData.getElementContent(
-                           MetaData.getUniqueChild(
-                              (Element) actNode,
-                                 "ejb-ref-name"));
-                     String linkName=
-                        MetaData.getElementContent(
-                           MetaData.getUniqueChild((Element) actNode,
"ejb-link"));
+         NamedNodeMap attributes= root.getAttributes();
+         for (int count= 0; count < attributes.getLength(); count++) {
+            Attr attribute= (Attr) attributes.item(count);
+            deploy.setAttributeNodeNS(
+               (Attr) deployDoc.importNode(attribute, true));
+            deployClient.setAttributeNodeNS(
+               (Attr) deployClientDoc.importNode(attribute, true));
+         }
 
-                     log.warn(
-                        "Web Service Deployment "
+         // and insert the nodes from the original document
+         // and sort out the ejb-ref extensions
+         NodeList children= root.getChildNodes();
+         for (int count= 0; count < children.getLength(); count++) {
+            Node actNode= children.item(count);
+            if (actNode instanceof Element) {
+               Element actElement= (Element) actNode;
+
+               if (actElement.getTagName().equals("ejb-ref")) {
+
+                  String refName=
+                     MetaData.getElementContent(
+                        MetaData.getUniqueChild(
+                           (Element) actNode,
+                           "ejb-ref-name"));
+                  String linkName=
+                     MetaData.getElementContent(
+                        MetaData.getUniqueChild((Element) actNode,
"ejb-link"));
+
+                  log.warn(
+                     "Web Service Deployment "
                         + sdi
                         + " makes use of the deprecated ejb-ref feature. "
                         + "Please adjust any ejb-providing service tag
inside your web-service.xml pointing to " @@ -463,34 +469,35 @@
                         + linkName
                         + " instead.");
 
-                     if (refName == null)
-                        throw new DeploymentException(
-                           Constants.EJB_REF_MUST_HAVE_UNIQUE_NAME);
-                     if (linkName == null)
-                        throw new DeploymentException(
-                           Constants.EJB_REF_MUST_HAVE_UNIQUE_LINK);
-
-                     Util.bind(envCtx, refName, new LinkRef(linkName));
-                  } else if
(actElement.getTagName().equals("ext-service")) {
-                     deployExternalWebService(actElement);
-                  } else {
-                     if (!actElement.getTagName().equals("service")) {
-                        deployClient.appendChild(
-                           deployClientDoc.importNode(actNode, true));
-                     }
-                     deploy.appendChild(deployDoc.importNode(actNode,
true));
-                  }
+                  if (refName == null)
+                     throw new DeploymentException(
+                        Constants.EJB_REF_MUST_HAVE_UNIQUE_NAME);
+                  if (linkName == null)
+                     throw new DeploymentException(
+                        Constants.EJB_REF_MUST_HAVE_UNIQUE_LINK);
+
+                  Util.bind(envCtx, refName, new LinkRef(linkName));
+               } else if
(actElement.getTagName().equals("ext-service")) {
+                  deployExternalWebService(actElement);
                } else {
-                  deployClient.appendChild(
-                     deployClientDoc.importNode(actNode, true));
+                  if (!actElement.getTagName().equals("service")) {
+                     deployClient.appendChild(
+                        deployClientDoc.importNode(actNode, true));
+                  }
                   deploy.appendChild(deployDoc.importNode(actNode,
true));
                }
+            } else {
+               deployClient.appendChild(
+                  deployClientDoc.importNode(actNode, true));
+               deploy.appendChild(deployDoc.importNode(actNode, true));
             }
+         }
 
-            // insert command into document
-            deployDoc.appendChild(deploy);
-            deployClientDoc.appendChild(deployClient);
+         // insert command into document
+         deployDoc.appendChild(deploy);
+         deployClientDoc.appendChild(deployClient);
 
+         try {
 
Thread.currentThread().setContextClassLoader(serviceLoader);
             new Deployment(deploy).deployToRegistry(
                ((XMLResourceProvider)
axisServer.getConfig()).getDeployment());
@@ -541,38 +548,42 @@
       }
       // this was the deployment command
       Element root= (Element) ((Document)
sdi.metaData).getDocumentElement();
-
-      try {
-         // from which we extract an undeployment counterpart
-         Document undeployDoc= XMLUtils.newDocument();
-         Element undeploy=
-            undeployDoc.createElementNS(root.getNamespaceURI(),
"undeployment");
+      // from which we extract an undeployment counterpart
+      Document undeployDoc = null;
+      try{
+      undeployDoc= XMLUtils.newDocument();
+      } catch (ParserConfigurationException e){
+       e.printStackTrace();    
+      }
+      Element undeploy=
+         undeployDoc.createElementNS(root.getNamespaceURI(),
"undeployment");
       
-         // copy over administrational attributes
-         NamedNodeMap attributes= root.getAttributes();
-         for (int count= 0; count < attributes.getLength(); count++) {
-            Attr attribute= (Attr) attributes.item(count);
-            undeploy.setAttributeNodeNS(
-               (Attr) undeployDoc.importNode(attribute, true));
-         }
+      // copy over administrational attributes
+      NamedNodeMap attributes= root.getAttributes();
+      for (int count= 0; count < attributes.getLength(); count++) {
+         Attr attribute= (Attr) attributes.item(count);
+         undeploy.setAttributeNodeNS(
+            (Attr) undeployDoc.importNode(attribute, true));
+      }
 
-         // external services are just a matter of us
-         NodeList children= root.getElementsByTagName("ext-service");
-         for (int count= 0; count < children.getLength(); count++) {
-            Element actNode= (Element) children.item(count);
-            undeployExternalWebService(actNode);
-         }
+      // external services are just a matter of us
+      NodeList children= root.getElementsByTagName("ext-service");
+      for (int count= 0; count < children.getLength(); count++) {
+         Element actNode= (Element) children.item(count);
+         undeployExternalWebService(actNode);
+      }
 
-         // all service and handler entries are copied in the
-         // undeployment document
-         copyChildren(undeployDoc,root,"service",undeploy);
-         copyChildren(undeployDoc,root,"handler",undeploy);
-         copyChildren(undeployDoc,root,"typemapping",undeploy);
-         copyChildren(undeployDoc,root,"beanmapping",undeploy);
+      // all service and handler entries are copied in the
+      // undeployment document
+      copyChildren(undeployDoc,root,"service",undeploy);
+      copyChildren(undeployDoc,root,"handler",undeploy);
+      copyChildren(undeployDoc,root,"typemapping",undeploy);
+      copyChildren(undeployDoc,root,"beanmapping",undeploy);
 
-         // put command into document
-         undeployDoc.appendChild(undeploy);
+      // put command into document
+      undeployDoc.appendChild(undeploy);
 
+      try {
          // and call the administrator
          new WSDDUndeployment(undeploy).undeployFromRegistry(
             ((XMLResourceProvider)
axisServer.getConfig()).getDeployment());
---
..../../../../jboss-head/jboss.net/src/main/org/jboss/net/jmx/adaptor/Attr
ibuteSerializer.java    2003-01-07 17:26:51.000000000 -0500
+++
..../../../../tamale_jboss4/jboss.net/src/main/org/jboss/net/jmx/adaptor/A
ttributeSerializer.java 2002-12-15 11:41:00.000000000 -0500
@@ -5,7 +5,7 @@
  * See terms of license at gnu.org.
  */
 
-// $Id: AttributeSerializer.java,v 1.3 2003/01/07 22:26:51 telrod Exp $
+// $Id: AttributeSerializer.java,v 1.2 2002/12/15 16:41:00 jfawcett Exp
$
 
 package org.jboss.net.jmx.adaptor;
 
@@ -30,7 +30,7 @@
  * corresponding XML-types.
  * @created 09.04.02
  * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.2 $
  */
 
 public class AttributeSerializer implements Serializer {
@@ -38,7 +38,7 @@
        /** this is the fully-qualified type that we serialize into */
        protected QName xmlType;
 
-       //
+       //
        // Constructors
        //
 
@@ -46,17 +46,12 @@
                this.xmlType = xmlType;
        }
 
-    public Element writeSchema(Class aClass, Types types) throws
Exception
-    {
-        //TODO Needs to be implemented to comply with Axis 1.1beta
-        return null;
-    }
        //
        // Public API
        //
 
-       /**
-        *  turns a JMX objectname into a string-based xml element
+       /** 
+        *  turns a JMX objectname into a string-based xml element
         *  @param name the name of the element that carries our type
         *  @param attributes the attributes of the element that carries our
type
         *  @param value the objectname to serialize
@@ -92,7 +87,7 @@
                // attributes content
                qname = new QName("", "value");
                Object attrValue = ((Attribute) value).getValue();
-               // lets hope that Object is mapped semantically to
xsd:any??
+               // lets hope that Object is mapped semantically to
xsd:any??       
                context.serialize(qname, null, attrValue);
       // end the attribute tag
                context.endElement();
@@ -108,28 +103,20 @@
         * The Attribute type has a string-based name attribute and a
         */
 
-       public boolean writeSchema(Types types) throws Exception {
+       public boolean writeSchema(org.apache.axis.wsdl.fromJava.Types
types) throws Exception {
                // ComplexType representation of SimpleType bean class
                Element complexType =
types.createElement("complexType");
                types.writeSchemaElement(xmlType, complexType);
                complexType.setAttribute("name",
xmlType.getLocalPart());
-
-        //TODO implemented to comply with Axis 1.1beta
+               //TODO: find out what class is supposed to passed in
+               //api doc says
                Element nameAttribute =
                        types.createAttributeElement(
                                "name",
-                XMLType.XSD_STRING.getClass(),
-                XMLType.XSD_STRING,
+                               null,
+                               XMLType.XSD_STRING,
                                false,
                                complexType.getOwnerDocument());
-        /** Implementation for Axis 1.0 **
-        Element nameAttribute =
-            types.createAttributeElement(
-                "name",
-                XMLType.XSD_STRING.toString(),
-                false,
-                complexType.getOwnerDocument());
-        */
                complexType.appendChild(nameAttribute);
                Element complexContent =
types.createElement("complexContent");
                complexType.appendChild(complexContent);
@@ -146,4 +133,37 @@
                return true;
        }
 
+       /**
+        * @see
org.apache.axis.encoding.Serializer#writeSchema(java.lang.Class,
org.apache.axis.wsdl.fromJava.Types)
+        */
+       public Element writeSchema(Class arg0, Types types) throws
Exception {
+               // ComplexType representation of SimpleType bean class
+               Element complexType =
types.createElement("complexType");
+               types.writeSchemaElement(xmlType, complexType);
+               complexType.setAttribute("name",
xmlType.getLocalPart());
+               //TODO: find out what class is supposed to passed in
+               //api doc says
+               Element nameAttribute =
+                       types.createAttributeElement(
+                               "name",
+                               null,
+                               XMLType.XSD_STRING,
+                               false,
+                               complexType.getOwnerDocument());
+               complexType.appendChild(nameAttribute);
+               Element complexContent =
types.createElement("complexContent");
+               complexType.appendChild(complexContent);
+               Element all = types.createElement("sequence");
+               complexContent.appendChild(all);
+               Element valueElement =
+                       types.createElement(
+                               "value",
+                               XMLType.XSD_ANYTYPE.toString(),
+                               true,
+            false,
+                               all.getOwnerDocument());
+               all.appendChild(valueElement);
+               return all;
+       }
+
 }
\ No newline at end of file
---
..../../../../jboss-head/jboss.net/src/main/org/jboss/net/jmx/adaptor/Obje
ctNameSerializer.java   2003-01-07 17:26:54.000000000 -0500
+++
..../../../../tamale_jboss4/jboss.net/src/main/org/jboss/net/jmx/adaptor/O
bjectNameSerializer.java        2002-12-15 11:41:00.000000000 -0500
@@ -5,7 +5,7 @@
  * See terms of license at gnu.org.
  */
 
-// $Id: ObjectNameSerializer.java,v 1.4 2003/01/07 22:26:54 telrod Exp $
+// $Id: ObjectNameSerializer.java,v 1.2 2002/12/15 16:41:00 jfawcett
Exp $
 
 package org.jboss.net.jmx.adaptor;
 
@@ -29,7 +29,7 @@
  * corresponding XML-types.
  * @created 2. Oktober 2001, 14:01
  * @author <a href="mailto:[EMAIL PROTECTED]";>Christoph G. Jung</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.2 $
  */
 
 public class ObjectNameSerializer implements Serializer {
@@ -37,7 +37,7 @@
    /** this is the fully-qualified type that we serialize into */
    protected QName xmlType;
 
-   //
+   //
    // Constructors
    //
 
@@ -49,8 +49,8 @@
    // Public API
    //
 
-   /**
-    *  turns a JMX objectname into a string-based xml element
+   /** 
+    *  turns a JMX objectname into a string-based xml element
     *  @param name the name of the element that carries our type
     *  @param attributes the attributes of the element that carries our
type
     *  @param value the objectname to serialize
@@ -67,13 +67,7 @@
       context.endElement();
    }
 
-    public Element writeSchema(Class aClass, Types types) throws
Exception
-    {
-        //TODO Needs to be implemented to comply with Axis 1.1beta
-        return null;
-    }
-
-    /** we use sax approach */
+   /** we use sax approach */
    public String getMechanismType() {
       return Constants.AXIS_SAX;
    }
@@ -95,4 +89,19 @@
       return true;
    }
 
+       /**
+        * @see
org.apache.axis.encoding.Serializer#writeSchema(java.lang.Class,
org.apache.axis.wsdl.fromJava.Types)
+        */
+       public Element writeSchema(Class arg0, Types types) throws
Exception {
+               Element simpleType = types.createElement("simpleType");
+      types.writeSchemaElement(xmlType, simpleType);
+      simpleType.setAttribute("name", xmlType.getLocalPart());
+      Element simpleContent = types.createElement("simpleContent");
+      simpleType.appendChild(simpleContent);
+      Element extension = types.createElement("extension");
+      simpleContent.appendChild(extension);
+      extension.setAttribute("base", XMLType.XSD_STRING.toString());
+      return simpleType;
+       }
+
 }
\ No newline at end of file



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com _______________________________________________
Jboss-development mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to