Author: vanto
Date: Thu Sep 23 17:14:27 2010
New Revision: 1000542
URL: http://svn.apache.org/viewvc?rev=1000542&view=rev
Log:
fixes ODE-891.
Modified:
ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/XMLSchemaTypeSerializer.java
ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
Modified:
ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/XMLSchemaTypeSerializer.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/XMLSchemaTypeSerializer.java?rev=1000542&r1=1000541&r2=1000542&view=diff
==============================================================================
---
ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/XMLSchemaTypeSerializer.java
(original)
+++
ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/XMLSchemaTypeSerializer.java
Thu Sep 23 17:14:27 2010
@@ -22,6 +22,7 @@ import org.apache.ode.utils.DOMUtils;
import java.io.PrintWriter;
import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -76,6 +77,12 @@ public class XMLSchemaTypeSerializer imp
ExtensionRegistry extensionRegistry)
throws WSDLException {
DOMUtils.pancakeNamespaces(element);
- return new XMLSchemaType(DOMUtils.domToString(element).getBytes());
+ try {
+ // xml dump is encoded in UTF-8, so the byte array should use the same
encoding
+ // the reading xml parser should be able to correctly detect the
encoding then.
+ return new
XMLSchemaType(DOMUtils.domToString(element).getBytes("UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ throw new WSDLException(WSDLException.OTHER_ERROR, e.getMessage(), e);
+ }
}
}
Modified: ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
URL:
http://svn.apache.org/viewvc/ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java?rev=1000542&r1=1000541&r2=1000542&view=diff
==============================================================================
--- ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
(original)
+++ ode/trunk/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java Thu Sep
23 17:14:27 2010
@@ -30,14 +30,14 @@ import org.apache.xerces.xni.parser.XMLP
import org.apache.xerces.xs.XSModel;
import org.w3c.dom.ls.LSInput;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
+import java.io.ByteArrayInputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
/**
* Various utility methods related to XML Schema processing.
*/
@@ -64,7 +64,7 @@ public class XSUtils {
DOMInputImpl input = new DOMInputImpl();
input.setSystemId(systemURI.toString());
- input.setStringData(new String(schemaData));
+ input.setByteStream(new ByteArrayInputStream(schemaData));
Map<URI, byte[]> ret = captureSchema(input, resolver);