Author: dkulp
Date: Mon Jan 14 09:02:05 2008
New Revision: 611853
URL: http://svn.apache.org/viewvc?rev=611853&view=rev
Log:
Merged revisions 611838 via svnmerge from
https://svn.apache.org/repos/asf/incubator/cxf/trunk
........
r611838 | dkulp | 2008-01-14 11:02:13 -0500 (Mon, 14 Jan 2008) | 2 lines
[CXF-1392] Fix problems of always qualifying exception elements
........
Modified:
incubator/cxf/branches/2.0.x-fixes/ (props changed)
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=611853&r1=611852&r2=611853&view=diff
==============================================================================
---
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++
incubator/cxf/branches/2.0.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Mon Jan 14 09:02:05 2008
@@ -67,6 +67,7 @@
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.service.model.SchemaInfo;
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.staxutils.W3CDOMStreamWriter;
import org.apache.ws.commons.schema.XmlSchemaElement;
@@ -220,7 +221,7 @@
XMLStreamWriter writer = getStreamWriter(source);
QName qn = part.getElementQName();
try {
- writer.writeStartElement(qn.getNamespaceURI(), qn.getLocalPart());
+ writer.writeStartElement("ns1", qn.getLocalPart(),
qn.getNamespaceURI());
Class<?> cls = part.getTypeClass();
XmlAccessorType accessorType =
cls.getAnnotation(XmlAccessorType.class);
if (accessorType == null && cls.getPackage() != null) {
@@ -229,6 +230,14 @@
XmlAccessType accessType = accessorType != null
? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
String namespace = part.getElementQName().getNamespaceURI();
+
+ SchemaInfo sch =
part.getMessageInfo().getOperation().getInterface()
+ .getService().getSchema(namespace);
+ if (!sch.isElementFormQualified()) {
+ namespace = null;
+ }
+
+
Marshaller u = createMarshaller(context, cls,
marshallerProperties);
try {
// override anything the user asked us to set.