Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 67087 invoked by uid 500); 28 Feb 2002 14:56:05 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 67078 invoked by uid 500); 28 Feb 2002 14:56:05 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 28 Feb 2002 14:56:05 -0000 Message-ID: <20020228145605.43383.qmail@icarus.apache.org> From: tomj@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava SymbolTable.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N tomj 02/02/28 06:56:05 Modified: java/src/org/apache/axis/wsdl/toJava SymbolTable.java Log: Change "dotNet" switch to wrapped. Key off single part name of "parameters" not attributes. Much goodness from interop!!! Revision Changes Path 1.37 +19 -16 xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java Index: SymbolTable.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/SymbolTable.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- SymbolTable.java 27 Feb 2002 13:41:28 -0000 1.36 +++ SymbolTable.java 28 Feb 2002 14:56:05 -0000 1.37 @@ -140,7 +140,7 @@ private BaseTypeMapping btm = null; // should we attempt to treat document/literal WSDL as "rpc-style" - private boolean dotNet = true; + private boolean wrapped = false; /** * Construct a symbol table with the given Namespaces. @@ -283,17 +283,17 @@ } /** - * Are we trying to treat document/literal in an "rpc-style" manner. + * Are we wrapping literal soap body elements. */ - public boolean isDotNet() { - return dotNet; + public boolean isWrapped() { + return wrapped; } /** - * Turn on/off .NET strategy for literal soap body's. + * Turn on/off element wrapping for literal soap body's. */ - public void setDotNet(boolean dotNet) { - this.dotNet = dotNet; + public void setWrapped(boolean wrapped) { + this.wrapped = wrapped; } /** @@ -570,8 +570,6 @@ te.setSimpleType(true); } else if (isXSD && localPart.equals("attribute")) { - // we can no longer do .NET stuff and treat document as rpc style - this.dotNet = false; // Create symbol table entry for attribute type QName refQName = Utils.getNodeTypeRefQName(node, "type"); if (refQName != null) { @@ -1064,18 +1062,23 @@ Part part = (Part) i.next(); QName elementName = part.getElementName(); QName typeName = part.getTypeName(); + String partName = part.getName(); + + // Hack alert - Try to sense "wrapped" document literal mode + if (literal && !i.hasNext() && partName.equals("parameters")) + wrapped = true; - if (!literal || !dotNet) { + if (!literal || !wrapped) { // not doing literal use, add this type or element name if (typeName != null) { v.add(getType(typeName)); - v.add(part.getName()); + v.add(partName); } else if (elementName != null) { // Just an FYI: The WSDL spec says that for use=encoded // that parts reference an abstract type using the type attr // but we kinda do the right thing here, so let it go. v.add(getElement(elementName)); - v.add(part.getName()); + v.add(partName); } continue; // next part } @@ -1094,7 +1097,7 @@ // node = getTypeEntry(typeName, false).getNode(); throw new IOException( JavaUtils.getMessage("literalTypePart00", - new String[] {part.getName(), + new String[] {partName, opName, bindingName})); } @@ -1122,10 +1125,10 @@ // XXX - This should be a SOAPElement/SOAPBodyElement if (typeName != null) { v.add(getType(typeName)); - v.add(part.getName()); + v.add(partName); } else if (elementName != null) { v.add(getElement(elementName)); - v.add(part.getName()); + v.add(partName); } } } // while @@ -1333,7 +1336,7 @@ private void setTypeReferences(TypeEntry entry, Document doc, boolean literal) { - if (dotNet) { + if (wrapped) { // If this type is ONLY referenced from a literal usage in a binding, // then isOnlyLiteralReferenced should return true. if (!entry.isReferenced() && literal) {