axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Daniels" <gdani...@macromedia.com>
Subject Re: Update to wsdl2java emitter code for complex types
Date Fri, 31 Aug 2001 03:34:43 GMT
Thanks, Tom - checked in and (manually) tested.  We should start thinking
about what unit tests for the WSDL code (both directions) would look
like....

--G

----- Original Message -----
From: "Tom Jordahl" <tomj@macromedia.com>
To: <axis-dev@xml.apache.org>
Sent: Thursday, August 30, 2001 6:08 PM
Subject: Update to wsdl2java emitter code for complex types


>
> The change below correctly uses the schema namespace for the
> BeanSerializer/DeserializerFactory in the generated client stub.
>
> Thanks.
> --
> Tom Jordahl
> MacroMedia Server Development
>
>
> *** Emitter.java.ORIG Thu Aug 30 17:56:36 2001
> --- Emitter.java Thu Aug 30 17:58:32 2001
> ***************
> *** 82,87 ****
> --- 82,88 ----
>   import javax.wsdl.WSDLException;
>
>   import org.w3c.dom.Document;
> + import org.w3c.dom.Element;
>   import org.w3c.dom.NamedNodeMap;
>   import org.w3c.dom.Node;
>   import org.w3c.dom.NodeList;
> ***************
> *** 778,786 ****
>        * In the stub constructor, write the serializer code for the
complex
> types.
>        */
>       private void writeSerializationInit(PrintWriter pw, String type)
> throws IOException {
>           pw.println ("        try");
>           pw.println ("        {");
> !         pw.println ("            org.apache.axis.utils.QName qn1 = new
> org.apache.axis.utils.QName (\"bogusNS\", \"" + 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 ());");
> --- 779,791 ----
>        * 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 (\"" + 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 ());");
>


Mime
View raw message