You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/08/25 11:29:36 UTC
svn commit: r240025 - in /webservices/axis/trunk/java/modules/xml:
src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
test/org/apache/axis2/soap/SOAPMessageTest.java
Author: chinthaka
Date: Thu Aug 25 02:29:10 2005
New Revision: 240025
URL: http://svn.apache.org/viewcvs?rev=240025&view=rev
Log:
Fixing a serialiser bug in SOAPMessage
Added:
webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPMessageTest.java
Modified:
webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java?rev=240025&r1=240024&r2=240025&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java Thu Aug 25 02:29:10 2005
@@ -296,7 +296,7 @@
}
- private void serialize(OMOutputImpl omOutput, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
+ protected void serialize(OMOutputImpl omOutput, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
if (includeXMLDeclaration) {
//Check whether the OMOutput char encoding and OMDocument char
//encoding matches, if not use char encoding of OMOutput
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java?rev=240025&r1=240024&r2=240025&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java Thu Aug 25 02:29:10 2005
@@ -65,18 +65,7 @@
throw new UnsupportedOperationException("This is not allowed. Use set SOAPEnvelope instead");
}
- private void serialize(OMOutputImpl omOutput, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
- if (includeXMLDeclaration) {
- //Check whether the OMOutput char encoding and OMDocument char
- //encoding matches, if not use char encoding of OMOutput
- String outputCharEncoding = omOutput.getCharSetEncoding();
- if (!outputCharEncoding.equalsIgnoreCase(this.charSetEncoding)) {
- this.charSetEncoding = outputCharEncoding;
- }
- omOutput.getXmlStreamWriter().writeStartDocument(charSetEncoding,
- xmlVersion);
- }
-
+ protected void serialize(OMOutputImpl omOutput, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
if (cache) {
this.rootElement.serializeWithCache(omOutput);
} else {
Added: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPMessageTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPMessageTest.java?rev=240025&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPMessageTest.java (added)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPMessageTest.java Thu Aug 25 02:29:10 2005
@@ -0,0 +1,41 @@
+package org.apache.axis2.soap;
+
+import org.apache.axis2.om.OMTestCase;
+import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @author : Eran Chinthaka (chinthaka@apache.org)
+ */
+
+public class SOAPMessageTest extends OMTestCase {
+
+ public SOAPMessageTest(String testName) {
+ super(testName);
+ }
+
+ public void testSOAPMessageCreation(){
+ try {
+ StAXSOAPModelBuilder soapBuilder = getOMBuilder("");
+ SOAPMessage soapMessage = soapBuilder.getSoapMessage();
+ assertNotNull(soapMessage);
+ assertNotNull(soapMessage.getSOAPEnvelope());
+ } catch (Exception e) {
+ fail("Exception thrown "+ e);
+ e.printStackTrace();
+ }
+ }
+}