Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C3104D51A for ; Mon, 23 Jul 2012 19:25:15 +0000 (UTC) Received: (qmail 97006 invoked by uid 500); 23 Jul 2012 19:25:15 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 96960 invoked by uid 500); 23 Jul 2012 19:25:15 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 96952 invoked by uid 99); 23 Jul 2012 19:25:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 19:25:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 19:25:12 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CAC2B23888E4; Mon, 23 Jul 2012 19:24:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1364761 - in /cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding: source/SourceDataBinding.java stax/StaxDataBinding.java Date: Mon, 23 Jul 2012 19:24:52 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120723192452.CAC2B23888E4@eris.apache.org> Author: dkulp Date: Mon Jul 23 19:24:52 2012 New Revision: 1364761 URL: http://svn.apache.org/viewvc?rev=1364761&view=rev Log: Merged revisions 1364760 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ........ r1364760 | dkulp | 2012-07-23 15:22:00 -0400 (Mon, 23 Jul 2012) | 19 lines Merged revisions 1364757 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes ........ r1364757 | dkulp | 2012-07-23 15:15:49 -0400 (Mon, 23 Jul 2012) | 11 lines Merged revisions 1364754 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1364754 | dkulp | 2012-07-23 15:08:27 -0400 (Mon, 23 Jul 2012) | 3 lines For source and stax databinding, set the "type" to anyType so java first case will at least generate a simple but crappy wsdl ........ ........ ........ Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java?rev=1364761&r1=1364760&r2=1364761&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java (original) +++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java Mon Jul 23 19:24:52 2012 @@ -19,14 +19,20 @@ package org.apache.cxf.databinding.source; + import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import org.w3c.dom.Node; +import org.apache.cxf.common.xmlschema.SchemaCollection; +import org.apache.cxf.common.xmlschema.XmlSchemaConstants; import org.apache.cxf.databinding.DataReader; import org.apache.cxf.databinding.DataWriter; import org.apache.cxf.service.Service; +import org.apache.cxf.service.ServiceModelVisitor; +import org.apache.cxf.service.model.MessagePartInfo; +import org.apache.cxf.service.model.ServiceInfo; /** * A simple databinding implementation which reads and writes Source objects. @@ -40,7 +46,21 @@ public class SourceDataBinding extends o } public void initialize(Service service) { - // do nothing + for (ServiceInfo serviceInfo : service.getServiceInfos()) { + SchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection(); + if (schemaCollection.getXmlSchemas().length > 1) { + // Schemas are already populated. + continue; + } + new ServiceModelVisitor(serviceInfo) { + public void begin(MessagePartInfo part) { + if (part.getTypeQName() != null || part.getElementQName() != null) { + return; + } + part.setTypeQName(XmlSchemaConstants.ANY_TYPE_QNAME); + } + } .walk(); + } } Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java?rev=1364761&r1=1364760&r2=1364761&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java (original) +++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java Mon Jul 23 19:24:52 2012 @@ -32,13 +32,17 @@ import org.w3c.dom.Node; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.logging.LogUtils; +import org.apache.cxf.common.xmlschema.SchemaCollection; +import org.apache.cxf.common.xmlschema.XmlSchemaConstants; import org.apache.cxf.databinding.AbstractDataBinding; import org.apache.cxf.databinding.DataReader; import org.apache.cxf.databinding.DataWriter; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Attachment; import org.apache.cxf.service.Service; +import org.apache.cxf.service.ServiceModelVisitor; import org.apache.cxf.service.model.MessagePartInfo; +import org.apache.cxf.service.model.ServiceInfo; import org.apache.cxf.staxutils.StaxUtils; /** @@ -57,9 +61,23 @@ public class StaxDataBinding extends Abs } public void initialize(Service service) { - // do nothing + for (ServiceInfo serviceInfo : service.getServiceInfos()) { + SchemaCollection schemaCollection = serviceInfo.getXmlSchemaCollection(); + if (schemaCollection.getXmlSchemas().length > 1) { + // Schemas are already populated. + continue; + } + new ServiceModelVisitor(serviceInfo) { + public void begin(MessagePartInfo part) { + if (part.getTypeQName() != null || part.getElementQName() != null) { + return; + } + part.setTypeQName(XmlSchemaConstants.ANY_TYPE_QNAME); + } + } .walk(); + } } - + @SuppressWarnings("unchecked") public DataReader createReader(Class cls) { if (cls == XMLStreamReader.class) {