axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r226927 - in /webservices/axis/trunk/java/modules: common/src/org/apache/axis2/ samples/test/org/apache/axis2/engine/ xml/src/org/apache/axis2/om/ xml/src/org/apache/axis2/om/impl/ xml/src/org/apache/axis2/soap/impl/llom/ xml/test/org/apach...
Date Tue, 02 Aug 2005 02:09:23 GMT
Author: chinthaka
Date: Mon Aug  1 19:08:35 2005
New Revision: 226927

URL: http://svn.apache.org/viewcvs?rev=226927&view=rev
Log:
- fixing XML declaration
- fixing OMOutputImpl for setting XML Version, charEncoding

Modified:
    webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/OMConstants.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPEnvelopeTest.java

Modified: webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
(original)
+++ webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
Mon Aug  1 19:08:35 2005
@@ -23,5 +23,4 @@
     public void setFaultCode(String faultCode);
 
     public String getMessage();
-
 }

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
(original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/CallUnregisteredServiceTest.java
Mon Aug  1 19:08:35 2005
@@ -69,7 +69,7 @@
         try {
             SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 
-            SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
+//            SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
             OMNamespace omNs = fac.createOMNamespace("http://localhost/my",
                     "my");
             OMElement method = fac.createOMElement("echoOMElement", omNs);
@@ -78,12 +78,13 @@
                     fac.createText(value,
                             "Isaac Assimov, the foundation Sega"));
             method.addChild(value);
-            reqEnv.getBody().addChild(method);
+//            reqEnv.getBody().addChild(method);
 
             Call call = new Call();
             EndpointReference targetEPR =
                     new EndpointReference("http://127.0.0.1:"
-                    + (UtilServer.TESTING_PORT)
+                    + ("5556")
+//                    + (UtilServer.TESTING_PORT)
                     + "/axis/services/EchoXMLService1");
             call.setTransportInfo(Constants.TRANSPORT_HTTP,
                     Constants.TRANSPORT_HTTP,
@@ -91,7 +92,7 @@
             call.setTo(targetEPR);
             SOAPEnvelope resEnv =
                     (SOAPEnvelope) call.invokeBlocking(
-                            operationName.getLocalPart(), reqEnv);
+                            operationName.getLocalPart(), method);
 
             SOAPBody sb = resEnv.getBody();
             if (sb.hasFault()) {

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/OMConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/OMConstants.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/OMConstants.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/OMConstants.java Mon Aug
 1 19:08:35 2005
@@ -54,4 +54,11 @@
     public static final String ARRAY_ITEM_QNAME =
             OMConstants.ARRAY_ITEM_NS_PREFIX + ':'
             + OMConstants.ARRAY_ITEM_LOCALNAME;
+
+    /**
+     * Field DEFAULT_CHAR_SET_ENCODING specifies the default
+     * character encoding scheme to be used
+     */
+    public static final String DEFAULT_CHAR_SET_ENCODING = "utf-8";
+    public static final String DEFAULT_XML_VERSION = "1.0";
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java
(original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/OMOutputImpl.java
Mon Aug  1 19:08:35 2005
@@ -25,6 +25,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.axis2.om.OMText;
+import org.apache.axis2.om.OMConstants;
 
 /**
  * For the moment this assumes that transport takes the decision of whether
@@ -40,15 +41,11 @@
     private String mimeBoundary = null;
     private String rootContentId = null;
     private int nextid = 0;
-    private String xmlVersion = "1.0";
 
-    /**
-     * Field DEFAULT_CHAR_SET_ENCODING specifies the default 
-     * character encoding scheme to be used
-     */
-    private static final String DEFAULT_CHAR_SET_ENCODING = "utf-8";
-    
-    private String charSetEncoding = DEFAULT_CHAR_SET_ENCODING;
+    private String xmlVersion = OMConstants.DEFAULT_XML_VERSION;
+    private String charSetEncoding = OMConstants.DEFAULT_CHAR_SET_ENCODING;
+    private boolean ignoreXMLDeclaration = false;
+
 
     public OMOutputImpl() {
     }
@@ -79,7 +76,7 @@
 		this.outStream = outStream;
 
 		if (charSetEncoding == null) //Default encoding is UTF-8
-			this.charSetEncoding = DEFAULT_CHAR_SET_ENCODING;
+			this.charSetEncoding = OMConstants.DEFAULT_CHAR_SET_ENCODING;
 
 		if (doOptimize) {
 			bufferedSoapOutStream = new ByteArrayOutputStream();
@@ -165,6 +162,14 @@
 
     public void setXmlVersion(String xmlVersion) {
         this.xmlVersion = xmlVersion;
+    }
+
+    public boolean isIgnoreXMLDeclaration() {
+        return ignoreXMLDeclaration;
+    }
+
+    public void ignoreXMLDeclaration(boolean ignoreXMLDeclaration) {
+        this.ignoreXMLDeclaration = ignoreXMLDeclaration;
     }
 
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
(original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
Mon Aug  1 19:08:35 2005
@@ -120,8 +120,14 @@
     }
 
     protected void serialize(OMOutputImpl omOutput, boolean cache) throws XMLStreamException
{
-//        omOutput.getXmlStreamWriter().writeStartDocument(omOutput.getCharSetEncoding(),
-//                omOutput.getXmlVersion());
+
+        if (!omOutput.isIgnoreXMLDeclaration()) {
+            String charSetEncoding = omOutput.getCharSetEncoding();
+            String xmlVersion = omOutput.getXmlVersion();
+            omOutput.getXmlStreamWriter().writeStartDocument(charSetEncoding == null ?
+                    OMConstants.DEFAULT_CHAR_SET_ENCODING : charSetEncoding,
+                    xmlVersion == null ? OMConstants.DEFAULT_XML_VERSION : xmlVersion);
+        }
         super.serialize(omOutput, cache);
     }
 }

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPEnvelopeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPEnvelopeTest.java?rev=226927&r1=226926&r2=226927&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPEnvelopeTest.java
(original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPEnvelopeTest.java
Mon Aug  1 19:08:35 2005
@@ -19,6 +19,9 @@
 import org.apache.axis2.soap.impl.llom.SOAPConstants;
 import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.om.impl.OMOutputImpl;
+
+import javax.xml.stream.XMLStreamException;
 
 public class SOAPEnvelopeTest extends SOAPTestCase {
     protected SOAPEnvelope soap11Envelope;



Mime
View raw message