You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2001/08/31 05:30:08 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl Emitter.java

gdaniels    01/08/30 20:30:08

  Modified:    java/src/org/apache/axis/wsdl Emitter.java
  Log:
  Fix namespace for complexType mapping generation.  Now gets it
  from the targetNamespace attribute of the parent element of the
  <complexType> element.
  
  Revision  Changes    Path
  1.2       +4 -5      xml-axis/java/src/org/apache/axis/wsdl/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Emitter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Emitter.java	2001/08/30 20:59:01	1.1
  +++ Emitter.java	2001/08/31 03:30:08	1.2
  @@ -81,10 +81,7 @@
   import javax.wsdl.Service;
   import javax.wsdl.WSDLException;
   
  -import org.w3c.dom.Document;
  -import org.w3c.dom.NamedNodeMap;
  -import org.w3c.dom.Node;
  -import org.w3c.dom.NodeList;
  +import org.w3c.dom.*;
   
   import org.apache.xerces.parsers.DOMParser;
   
  @@ -778,9 +775,11 @@
        * In the stub constructor, write the serializer code for the complex types.
        */
       private void writeSerializationInit(PrintWriter pw, String type) throws IOException {
  +        Element e = (Element)complexType(type).getParentNode();
  +        String namespace = e.getAttribute("targetNamespace");
           pw.println ("        try");
           pw.println ("        {");
  -        pw.println ("            org.apache.axis.utils.QName qn1 = new org.apache.axis.utils.QName (\"bogusNS\", \"" + type + "\");");
  +        pw.println ("            org.apache.axis.utils.QName qn1 = new org.apache.axis.utils.QName (\"" + namespace + "\", \"" + type + "\");");
           pw.println ("            Class cls = " + type + ".class;");
           pw.println ("            call.addSerializer (cls, qn1, new org.apache.axis.encoding.BeanSerializer (cls));");
           pw.println ("            call.addDeserializerFactory (qn1, cls, org.apache.axis.encoding.BeanSerializer.getFactory ());");