axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r289289 [116/134] - in /webservices/axis2/trunk/java: ./ etc/ modules/addressing/ modules/addressing/src/META-INF/ modules/addressing/src/org/apache/axis2/handlers/addressing/ modules/addressing/test-resources/ modules/addressing/test/org/a...
Date Thu, 15 Sep 2005 19:07:03 GMT
Modified: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java Thu Sep 15 11:52:11 2005
@@ -1,100 +1,100 @@
-/*
- * 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.
- */
-
-package org.apache.wsdl;
-
-import org.apache.axis2.wsdl.WSDLVersionWrapper;
-import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
-import org.apache.wsdl.extensions.ExtensionConstants;
-import org.apache.wsdl.extensions.Schema;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import javax.wsdl.Definition;
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-
-/**
- * @author chathura@opensource.lk
- */
-public class MessageReuseTest extends AbstractTestCase {
-
-    private WSDLDescription womDescription;
-
-    private Definition wsdl4jDefinition;
-
-    public MessageReuseTest(String arg) {
-        super(arg);
-    }
-
-    protected void setUp() throws Exception {
-
-        WSDLVersionWrapper wsdlVersionWrapper = null;
-        if (null == this.womDescription) {
-            String path = getTestResourceFile("BookQuote.wsdl").getAbsolutePath();
-            wsdlVersionWrapper =
-                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
-                    .build(path);
-            this.womDescription = wsdlVersionWrapper.getDescription();
-        }
-        if (null == wsdl4jDefinition) {
-            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
-        }
-
-    }
-
-    public void testMultipartmessageReuse() throws Exception {
-
-        WSDLInterface interface1 = this.womDescription.getInterface(
-                new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote",
-                        "BookQuote"));
-        WSDLOperation operation1 = (WSDLOperation) interface1.getAllOperations()
-                .get("getBookPrice");
-        QName element1 = operation1.getInputMessage().getElement();
-        WSDLOperation operation2 = (WSDLOperation) interface1.getAllOperations()
-                .get("getBookPriceNonRobust");
-        QName element2 = operation2.getInputMessage().getElement();
-        assertEquals(element1, element2);
-
-        Iterator iterator = womDescription.getTypes().getExtensibilityElements()
-                .iterator();
-        Schema types = null;
-        while (iterator.hasNext()) {
-            WSDLExtensibilityElement temp = (WSDLExtensibilityElement) iterator.next();
-            if (ExtensionConstants.SCHEMA.equals(temp.getType())) {
-                types = (Schema) temp;
-            }
-        }
-        int numberOfBookQuote_getBookPrice = 0;
-        NodeList childNodes = types.getElement().getChildNodes();
-        for (int i = 0; i < childNodes.getLength(); i++) {
-            Node item = childNodes.item(i);
-            if (item instanceof Element) {
-                Element temp = (Element) item;
-                if ("complexType".equals(temp.getNodeName()) &&
-                        "BookQuote_getBookPrice".equals(
-                                temp.getAttribute("name"))) {
-                    numberOfBookQuote_getBookPrice++;
-                }
-
-            }
-        }
-        assertEquals(numberOfBookQuote_getBookPrice, 1);
-
-
-    }
+/*
+ * 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.
+ */
+
+package org.apache.wsdl;
+
+import org.apache.axis2.wsdl.WSDLVersionWrapper;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+import org.apache.wsdl.extensions.ExtensionConstants;
+import org.apache.wsdl.extensions.Schema;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+
+/**
+ * @author chathura@opensource.lk
+ */
+public class MessageReuseTest extends AbstractTestCase {
+
+    private WSDLDescription womDescription;
+
+    private Definition wsdl4jDefinition;
+
+    public MessageReuseTest(String arg) {
+        super(arg);
+    }
+
+    protected void setUp() throws Exception {
+
+        WSDLVersionWrapper wsdlVersionWrapper = null;
+        if (null == this.womDescription) {
+            String path = getTestResourceFile("BookQuote.wsdl").getAbsolutePath();
+            wsdlVersionWrapper =
+                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
+                    .build(path);
+            this.womDescription = wsdlVersionWrapper.getDescription();
+        }
+        if (null == wsdl4jDefinition) {
+            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
+        }
+
+    }
+
+    public void testMultipartmessageReuse() throws Exception {
+
+        WSDLInterface interface1 = this.womDescription.getInterface(
+                new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote",
+                        "BookQuote"));
+        WSDLOperation operation1 = (WSDLOperation) interface1.getAllOperations()
+                .get("getBookPrice");
+        QName element1 = operation1.getInputMessage().getElement();
+        WSDLOperation operation2 = (WSDLOperation) interface1.getAllOperations()
+                .get("getBookPriceNonRobust");
+        QName element2 = operation2.getInputMessage().getElement();
+        assertEquals(element1, element2);
+
+        Iterator iterator = womDescription.getTypes().getExtensibilityElements()
+                .iterator();
+        Schema types = null;
+        while (iterator.hasNext()) {
+            WSDLExtensibilityElement temp = (WSDLExtensibilityElement) iterator.next();
+            if (ExtensionConstants.SCHEMA.equals(temp.getType())) {
+                types = (Schema) temp;
+            }
+        }
+        int numberOfBookQuote_getBookPrice = 0;
+        NodeList childNodes = types.getElement().getChildNodes();
+        for (int i = 0; i < childNodes.getLength(); i++) {
+            Node item = childNodes.item(i);
+            if (item instanceof Element) {
+                Element temp = (Element) item;
+                if ("complexType".equals(temp.getNodeName()) &&
+                        "BookQuote_getBookPrice".equals(
+                                temp.getAttribute("name"))) {
+                    numberOfBookQuote_getBookPrice++;
+                }
+
+            }
+        }
+        assertEquals(numberOfBookQuote_getBookPrice, 1);
+
+
+    }
 }

Propchange: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/SOAPActionTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/SOAPActionTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/SOAPActionTest.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/SOAPActionTest.java Thu Sep 15 11:52:11 2005
@@ -1,80 +1,80 @@
-/*
- * 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.
- */
-
-package org.apache.wsdl;
-
-import org.apache.axis2.wsdl.WSDLVersionWrapper;
-import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
-import org.apache.wsdl.extensions.ExtensionConstants;
-import org.apache.wsdl.extensions.SOAPOperation;
-
-import javax.wsdl.Definition;
-import javax.xml.namespace.QName;
-import java.util.Iterator;
-
-/**
- * @author chathura@opensource.lk
- */
-public class SOAPActionTest extends AbstractTestCase {
-
-    private WSDLDescription womDescription = null;
-
-    private Definition wsdl4jDefinition = null;
-
-    public SOAPActionTest(String args) {
-        super(args);
-    }
-
-    protected void setUp() throws Exception {
-        super.setUp();
-        WSDLVersionWrapper wsdlVersionWrapper = null;
-        if (null == this.womDescription) {
-            String path = getTestResourceFile("InteropTestDocLit2.wsdl").getAbsolutePath();
-            wsdlVersionWrapper =
-                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
-                    .build(path);
-            this.womDescription = wsdlVersionWrapper.getDescription();
-
-        }
-        if (null == wsdl4jDefinition) {
-            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
-        }
-    }
-
-    public void testSOAPActionPopulation() {
-        WSDLBindingOperation bindingOperation = womDescription
-                .getFirstBinding().getBindingOperation(new QName(
-                        "http://soapinterop.org/WSDLInteropTestDocLit",
-                        "echoVoid"));
-        Iterator iterator = bindingOperation.getExtensibilityElements()
-                .iterator();
-        while (iterator.hasNext()) {
-            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator
-                    .next();
-            SOAPOperation soapOperation = null;
-            if (ExtensionConstants.SOAP_11_OPERATION.equals(element.getType())) {
-                soapOperation = (SOAPOperation) element;
-            }
-            if (soapOperation == null) {
-                fail();
-            } else {
-                assertEquals(soapOperation.getSoapAction(),
-                        "http://soapinterop.org/");
-            }
-        }
-    }
-
+/*
+ * 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.
+ */
+
+package org.apache.wsdl;
+
+import org.apache.axis2.wsdl.WSDLVersionWrapper;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+import org.apache.wsdl.extensions.ExtensionConstants;
+import org.apache.wsdl.extensions.SOAPOperation;
+
+import javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+import java.util.Iterator;
+
+/**
+ * @author chathura@opensource.lk
+ */
+public class SOAPActionTest extends AbstractTestCase {
+
+    private WSDLDescription womDescription = null;
+
+    private Definition wsdl4jDefinition = null;
+
+    public SOAPActionTest(String args) {
+        super(args);
+    }
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        WSDLVersionWrapper wsdlVersionWrapper = null;
+        if (null == this.womDescription) {
+            String path = getTestResourceFile("InteropTestDocLit2.wsdl").getAbsolutePath();
+            wsdlVersionWrapper =
+                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
+                    .build(path);
+            this.womDescription = wsdlVersionWrapper.getDescription();
+
+        }
+        if (null == wsdl4jDefinition) {
+            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
+        }
+    }
+
+    public void testSOAPActionPopulation() {
+        WSDLBindingOperation bindingOperation = womDescription
+                .getFirstBinding().getBindingOperation(new QName(
+                        "http://soapinterop.org/WSDLInteropTestDocLit",
+                        "echoVoid"));
+        Iterator iterator = bindingOperation.getExtensibilityElements()
+                .iterator();
+        while (iterator.hasNext()) {
+            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator
+                    .next();
+            SOAPOperation soapOperation = null;
+            if (ExtensionConstants.SOAP_11_OPERATION.equals(element.getType())) {
+                soapOperation = (SOAPOperation) element;
+            }
+            if (soapOperation == null) {
+                fail();
+            } else {
+                assertEquals(soapOperation.getSoapAction(),
+                        "http://soapinterop.org/");
+            }
+        }
+    }
+
 }

Propchange: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/SOAPActionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/WOMBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/WOMBuilderTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/WOMBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/WOMBuilderTest.java Thu Sep 15 11:52:11 2005
@@ -1,137 +1,137 @@
-/*
- * 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.
- */
-package org.apache.wsdl;
-
-
-import org.apache.axis2.wsdl.WSDLVersionWrapper;
-import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Operation;
-import javax.wsdl.PortType;
-import javax.wsdl.Service;
-import java.util.Iterator;
-
-/**
- * @author chathura@opensource.lk
- */
-public class WOMBuilderTest extends AbstractTestCase {
-
-    private WSDLDescription womDescription = null;
-
-    private Definition wsdl4jDefinition = null;
-
-    public WOMBuilderTest(String testName) {
-        super(testName);
-    }
-
-    private void initialize() throws Exception {
-
-        WSDLVersionWrapper wsdlVersionWrapper = null;
-        if (null == this.womDescription) {
-            String path = getTestResourceFile("InteropTest.wsdl").getAbsolutePath();
-			wsdlVersionWrapper =
-                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
-                    .build(path);
-            this.womDescription = wsdlVersionWrapper.getDescription();
-        }
-        if (null == wsdl4jDefinition) {
-            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
-        }
-    }
-
-    public void testTopLevelComponentCount() throws Exception {
-        this.initialize();
-        assertEquals(womDescription.getServices().size(),
-                wsdl4jDefinition.getServices().size());
-        assertEquals(womDescription.getWsdlInterfaces().size(),
-                wsdl4jDefinition.getPortTypes().size());
-        ;
-        assertEquals(womDescription.getServices().size(),
-                wsdl4jDefinition.getServices().size());
-        assertEquals(womDescription.getBindings().size(),
-                wsdl4jDefinition.getBindings().size());
-
-    }
-
-    public void testInterfacesComponent() throws Exception {
-        this.initialize();
-        Iterator interfaceIterator = this.womDescription.getWsdlInterfaces()
-                .values()
-                .iterator();
-        Iterator porttypeIterator = this.wsdl4jDefinition.getPortTypes()
-                .values()
-                .iterator();
-        while (interfaceIterator.hasNext() & porttypeIterator.hasNext()) {
-            WSDLInterface wsdlInterface = (WSDLInterface) interfaceIterator.next();
-            PortType porttype = (PortType) porttypeIterator.next();
-            assertEquals(wsdlInterface.getName(), porttype.getQName());
-            assertEquals(wsdlInterface.getTargetnamespace(),
-                    porttype.getQName().getNamespaceURI());
-            assertEquals(wsdlInterface.getAllOperations().size(),
-                    porttype.getOperations().size());
-            Iterator womOperationIterator = wsdlInterface.getAllOperations()
-                    .values()
-                    .iterator();
-            Iterator wsdl4jOprationIterator = porttype.getOperations()
-                    .iterator();
-            //Will only work if the order is retained in the iteration
-            while (wsdl4jOprationIterator.hasNext()) {
-                Operation wsdl4jOperation = (Operation) wsdl4jOprationIterator.next();
-                this.operationsWaliking(
-                        wsdlInterface.getOperation(wsdl4jOperation.getName()),
-                        wsdl4jOperation);
-            }
-            while (womOperationIterator.hasNext()) {
-                WSDLOperation womOperation = (WSDLOperation) womOperationIterator.next();
-                this.operationsWaliking(womOperation,
-                        porttype.getOperation(
-                                womOperation.getName().getLocalPart(),
-                                null,
-                                null));
-            }
-
-        }
-    }
-
-    public void testServiceComponent() throws Exception {
-        this.initialize();
-        Iterator womServiceIterator = this.womDescription.getServices().values()
-                .iterator();
-        Iterator wsdl4jServiceIterator = this.wsdl4jDefinition.getServices()
-                .values()
-                .iterator();
-
-        while (womServiceIterator.hasNext() & wsdl4jServiceIterator.hasNext()) {
-            WSDLService wsdlService = (WSDLService) womServiceIterator.next();
-            Service wsdl4jService = (Service) wsdl4jServiceIterator.next();
-            assertEquals(wsdlService.getName(), wsdl4jService.getQName());
-
-        }
-    }
-
-
-    private void operationsWaliking(WSDLOperation womOperation,
-                                    Operation wsdl4jOperation) {
-        assertEquals(womOperation.getName().getLocalPart(),
-                wsdl4jOperation.getName());
-        //System.out.println(womOperation.getMessageExchangePattern());
-
-
-    }
-
-
-}
+/*
+ * 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.
+ */
+package org.apache.wsdl;
+
+
+import org.apache.axis2.wsdl.WSDLVersionWrapper;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import java.util.Iterator;
+
+/**
+ * @author chathura@opensource.lk
+ */
+public class WOMBuilderTest extends AbstractTestCase {
+
+    private WSDLDescription womDescription = null;
+
+    private Definition wsdl4jDefinition = null;
+
+    public WOMBuilderTest(String testName) {
+        super(testName);
+    }
+
+    private void initialize() throws Exception {
+
+        WSDLVersionWrapper wsdlVersionWrapper = null;
+        if (null == this.womDescription) {
+            String path = getTestResourceFile("InteropTest.wsdl").getAbsolutePath();
+			wsdlVersionWrapper =
+                    WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11)
+                    .build(path);
+            this.womDescription = wsdlVersionWrapper.getDescription();
+        }
+        if (null == wsdl4jDefinition) {
+            this.wsdl4jDefinition = wsdlVersionWrapper.getDefinition();
+        }
+    }
+
+    public void testTopLevelComponentCount() throws Exception {
+        this.initialize();
+        assertEquals(womDescription.getServices().size(),
+                wsdl4jDefinition.getServices().size());
+        assertEquals(womDescription.getWsdlInterfaces().size(),
+                wsdl4jDefinition.getPortTypes().size());
+        ;
+        assertEquals(womDescription.getServices().size(),
+                wsdl4jDefinition.getServices().size());
+        assertEquals(womDescription.getBindings().size(),
+                wsdl4jDefinition.getBindings().size());
+
+    }
+
+    public void testInterfacesComponent() throws Exception {
+        this.initialize();
+        Iterator interfaceIterator = this.womDescription.getWsdlInterfaces()
+                .values()
+                .iterator();
+        Iterator porttypeIterator = this.wsdl4jDefinition.getPortTypes()
+                .values()
+                .iterator();
+        while (interfaceIterator.hasNext() & porttypeIterator.hasNext()) {
+            WSDLInterface wsdlInterface = (WSDLInterface) interfaceIterator.next();
+            PortType porttype = (PortType) porttypeIterator.next();
+            assertEquals(wsdlInterface.getName(), porttype.getQName());
+            assertEquals(wsdlInterface.getTargetnamespace(),
+                    porttype.getQName().getNamespaceURI());
+            assertEquals(wsdlInterface.getAllOperations().size(),
+                    porttype.getOperations().size());
+            Iterator womOperationIterator = wsdlInterface.getAllOperations()
+                    .values()
+                    .iterator();
+            Iterator wsdl4jOprationIterator = porttype.getOperations()
+                    .iterator();
+            //Will only work if the order is retained in the iteration
+            while (wsdl4jOprationIterator.hasNext()) {
+                Operation wsdl4jOperation = (Operation) wsdl4jOprationIterator.next();
+                this.operationsWaliking(
+                        wsdlInterface.getOperation(wsdl4jOperation.getName()),
+                        wsdl4jOperation);
+            }
+            while (womOperationIterator.hasNext()) {
+                WSDLOperation womOperation = (WSDLOperation) womOperationIterator.next();
+                this.operationsWaliking(womOperation,
+                        porttype.getOperation(
+                                womOperation.getName().getLocalPart(),
+                                null,
+                                null));
+            }
+
+        }
+    }
+
+    public void testServiceComponent() throws Exception {
+        this.initialize();
+        Iterator womServiceIterator = this.womDescription.getServices().values()
+                .iterator();
+        Iterator wsdl4jServiceIterator = this.wsdl4jDefinition.getServices()
+                .values()
+                .iterator();
+
+        while (womServiceIterator.hasNext() & wsdl4jServiceIterator.hasNext()) {
+            WSDLService wsdlService = (WSDLService) womServiceIterator.next();
+            Service wsdl4jService = (Service) wsdl4jServiceIterator.next();
+            assertEquals(wsdlService.getName(), wsdl4jService.getQName());
+
+        }
+    }
+
+
+    private void operationsWaliking(WSDLOperation womOperation,
+                                    Operation wsdl4jOperation) {
+        assertEquals(womOperation.getName().getLocalPart(),
+                wsdl4jOperation.getName());
+        //System.out.println(womOperation.getMessageExchangePattern());
+
+
+    }
+
+
+}

Propchange: webservices/axis2/trunk/java/modules/wsdl/test/org/apache/wsdl/WOMBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/xml/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/project.xml?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/project.xml (original)
+++ webservices/axis2/trunk/java/modules/xml/project.xml Thu Sep 15 11:52:11 2005
@@ -1,166 +1,166 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * 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.
- */
- -->
-<project>
-    <pomVersion>3</pomVersion>
-    <extend>../../etc/project.xml</extend>
-
-    <name>Apache Axis 2.0 - XML</name>
-    <id>axis2-xml</id>
-    <groupId>axis2</groupId>
-    <description>AXIOM, The Object Model of Axis 2.0. This helps Axis 2.0 to have a light weight, efficient object model on StAX</description>
-
-    <build>
-        <nagEmailAddress>axis-dev@ws.apache.org</nagEmailAddress>
-        <sourceDirectory>src</sourceDirectory>
-        <unitTestSourceDirectory>test</unitTestSourceDirectory>
-
-        <unitTest>
-            <excludes>
-                <exclude>**/*SpacesTest.java</exclude>
-                <exclude>**/*AbstractOMSerializationTest.java</exclude>
-            </excludes>
-            <includes>
-                <include>**/*Test.java</include>
-            </includes>
-
-            <resources>
-                <resource>
-                    <directory>${basedir}/test-resources</directory>
-                </resource>
-                <resource>
-                    <directory>conf</directory>
-                    <includes>
-                        <include>**/*.properties</include>
-                    </includes>
-                </resource>
-                <resource>
-                    <directory>src</directory>
-                    <includes>
-                        <include>**/*.properties</include>
-                        <include>**/*.xml</include>
-                    </includes>
-                </resource>
-            </resources>
-        </unitTest>
-
-        <resources>
-            <resource>
-                <directory>conf</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
-	
-    <reports>
-        <report>maven-junit-report-plugin</report>
-    </reports>
-
-    <dependencies>
-        <!-- external JARs -->
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-common</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.0.3</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax</artifactId>
-            <version>1.1.2-dev</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax-api</artifactId>
-            <version>1.0</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.8</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://dist.codehaus.org/stax/jars/</url>
-        </dependency>
-
-        <dependency>
-            <groupId>jaxen</groupId>
-            <artifactId>jaxen</artifactId>
-            <version>1.1-beta-7</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://www.ibiblio.org/maven/jaxen/jars/</url>
-        </dependency>
-        <dependency>
-            <groupId>xmlunit</groupId>
-            <artifactId>xmlunit</artifactId>
-            <version>1.0</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://www.ibiblio.org/maven/xmlunit/jars/</url>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo-spec</groupId>
-            <artifactId>geronimo-spec-javamail</artifactId>
-            <version>1.3.1-rc5</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        
-        <dependency>
-            <groupId>geronimo-spec</groupId>
-            <artifactId>geronimo-spec-activation</artifactId>
-            <version>1.0.2-rc4</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-    </dependencies>
-
-    <reports>
-        <report>maven-junit-report-plugin</report>
-    </reports>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * 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.
+ */
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <name>Apache Axis 2.0 - XML</name>
+    <id>axis2-xml</id>
+    <groupId>axis2</groupId>
+    <description>AXIOM, The Object Model of Axis 2.0. This helps Axis 2.0 to have a light weight, efficient object model on StAX</description>
+
+    <build>
+        <nagEmailAddress>axis-dev@ws.apache.org</nagEmailAddress>
+        <sourceDirectory>src</sourceDirectory>
+        <unitTestSourceDirectory>test</unitTestSourceDirectory>
+
+        <unitTest>
+            <excludes>
+                <exclude>**/*SpacesTest.java</exclude>
+                <exclude>**/*AbstractOMSerializationTest.java</exclude>
+            </excludes>
+            <includes>
+                <include>**/*Test.java</include>
+            </includes>
+
+            <resources>
+                <resource>
+                    <directory>${basedir}/test-resources</directory>
+                </resource>
+                <resource>
+                    <directory>conf</directory>
+                    <includes>
+                        <include>**/*.properties</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>src</directory>
+                    <includes>
+                        <include>**/*.properties</include>
+                        <include>**/*.xml</include>
+                    </includes>
+                </resource>
+            </resources>
+        </unitTest>
+
+        <resources>
+            <resource>
+                <directory>conf</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>src</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+	
+    <reports>
+        <report>maven-junit-report-plugin</report>
+    </reports>
+
+    <dependencies>
+        <!-- external JARs -->
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.0.3</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax</artifactId>
+            <version>1.1.2-dev</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.8</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.1-beta-7</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://www.ibiblio.org/maven/jaxen/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <version>1.0</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://www.ibiblio.org/maven/xmlunit/jars/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-javamail</artifactId>
+            <version>1.3.1-rc5</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-activation</artifactId>
+            <version>1.0.2-rc4</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+    </dependencies>
+
+    <reports>
+        <report>maven-junit-report-plugin</report>
+    </reports>
+</project>

Propchange: webservices/axis2/trunk/java/modules/xml/project.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/Base64.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/Base64.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/Base64.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/Base64.java Thu Sep 15 11:52:11 2005
@@ -1,293 +1,293 @@
-/*
-* 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.
-*/
-package org.apache.axis2.attachments;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-
-public class Base64 {
-    private static final char[] S_BASE64CHAR = {'A', 'B', 'C', 'D', 'E', 'F',
-                                                'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
-                                                'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
-                                                'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
-                                                't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
-                                                '6', '7', '8', '9', '+', '/'};
-
-    private static final char S_BASE64PAD = '=';
-
-    private static final byte[] S_DECODETABLE = new byte[128];
-
-    static {
-        for (int i = 0; i < S_DECODETABLE.length; i++)
-            S_DECODETABLE[i] = Byte.MAX_VALUE; // 127
-        for (int i = 0; i < S_BASE64CHAR.length; i++)
-                // 0 to 63
-            S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i;
-    }
-
-    private static int decode0(char[] ibuf, byte[] obuf, int wp) {
-        int outlen = 3;
-        if (ibuf[3] == S_BASE64PAD)
-            outlen = 2;
-        if (ibuf[2] == S_BASE64PAD)
-            outlen = 1;
-        int b0 = S_DECODETABLE[ibuf[0]];
-        int b1 = S_DECODETABLE[ibuf[1]];
-        int b2 = S_DECODETABLE[ibuf[2]];
-        int b3 = S_DECODETABLE[ibuf[3]];
-        switch (outlen) {
-            case 1:
-                obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                return 1;
-            case 2:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                return 2;
-            case 3:
-                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
-                obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
-                obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f);
-                return 3;
-            default:
-                throw new RuntimeException("internalError00");
-        }
-    }
-
-    /**
-     *  
-     */
-    public static byte[] decode(char[] data, int off, int len) {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[len / 4 * 3 + 3];
-        int obufcount = 0;
-        for (int i = off; i < off + len; i++) {
-            char ch = data[i];
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    obufcount += decode0(ibuf, obuf, obufcount);
-                }
-            }
-        }
-        if (obufcount == obuf.length)
-            return obuf;
-        byte[] ret = new byte[obufcount];
-        System.arraycopy(obuf, 0, ret, 0, obufcount);
-        return ret;
-    }
-
-    /**
-     *  
-     */
-    public static byte[] decode(String data) {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[data.length() / 4 * 3 + 3];
-        int obufcount = 0;
-        for (int i = 0; i < data.length(); i++) {
-            char ch = data.charAt(i);
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    obufcount += decode0(ibuf, obuf, obufcount);
-                }
-            }
-        }
-        if (obufcount == obuf.length)
-            return obuf;
-        byte[] ret = new byte[obufcount];
-        System.arraycopy(obuf, 0, ret, 0, obufcount);
-        return ret;
-    }
-
-    /**
-     *  
-     */
-    public static void decode(char[] data, int off, int len,
-                              OutputStream ostream) throws IOException {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[3];
-        for (int i = off; i < off + len; i++) {
-            char ch = data[i];
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    int obufcount = decode0(ibuf, obuf, 0);
-                    ostream.write(obuf, 0, obufcount);
-                }
-            }
-        }
-    }
-
-    /**
-     *  
-     */
-    public static void decode(String data, OutputStream ostream)
-            throws IOException {
-        char[] ibuf = new char[4];
-        int ibufcount = 0;
-        byte[] obuf = new byte[3];
-        for (int i = 0; i < data.length(); i++) {
-            char ch = data.charAt(i);
-            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
-                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
-                ibuf[ibufcount++] = ch;
-                if (ibufcount == ibuf.length) {
-                    ibufcount = 0;
-                    int obufcount = decode0(ibuf, obuf, 0);
-                    ostream.write(obuf, 0, obufcount);
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns base64 representation of specified byte array.
-     */
-    public static String encode(byte[] data) {
-        return encode(data, 0, data.length);
-    }
-
-    /**
-     * Returns base64 representation of specified byte array.
-     */
-    public static String encode(byte[] data, int off, int len) {
-        if (len <= 0)
-            return "";
-        char[] out = new char[len / 3 * 4 + 4];
-        int rindex = off;
-        int windex = 0;
-        int rest = len - off;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[windex++] = S_BASE64CHAR[i >> 18];
-            out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[windex++] = S_BASE64CHAR[i & 0x3f];
-            rindex += 3;
-            rest -= 3;
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[windex++] = S_BASE64CHAR[i >> 2];
-            out[windex++] = S_BASE64CHAR[(i << 4) & 0x3f];
-            out[windex++] = S_BASE64PAD;
-            out[windex++] = S_BASE64PAD;
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[windex++] = S_BASE64CHAR[i >> 10];
-            out[windex++] = S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[windex++] = S_BASE64CHAR[(i << 2) & 0x3f];
-            out[windex++] = S_BASE64PAD;
-        }
-        return new String(out, 0, windex);
-    }
-
-    /**
-     * Outputs base64 representation of the specified byte array to a byte
-     * stream.
-     */
-    public static void encode(byte[] data, int off, int len,
-                              OutputStream ostream) throws IOException {
-        if (len <= 0)
-            return;
-        byte[] out = new byte[4];
-        int rindex = off;
-        int rest = len - off;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[0] = (byte) S_BASE64CHAR[i >> 18];
-            out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[3] = (byte) S_BASE64CHAR[i & 0x3f];
-            ostream.write(out, 0, 4);
-            rindex += 3;
-            rest -= 3;
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[0] = (byte) S_BASE64CHAR[i >> 2];
-            out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f];
-            out[2] = (byte) S_BASE64PAD;
-            out[3] = (byte) S_BASE64PAD;
-            ostream.write(out, 0, 4);
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[0] = (byte) S_BASE64CHAR[i >> 10];
-            out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f];
-            out[3] = (byte) S_BASE64PAD;
-            ostream.write(out, 0, 4);
-        }
-    }
-
-    /**
-     * Outputs base64 representation of the specified byte array to a character
-     * stream.
-     */
-    public static void encode(byte[] data, int off, int len, Writer writer)
-            throws IOException {
-        if (len <= 0)
-            return;
-        char[] out = new char[4];
-        int rindex = off;
-        int rest = len - off;
-        int output = 0;
-        while (rest >= 3) {
-            int i = ((data[rindex] & 0xff) << 16)
-                    + ((data[rindex + 1] & 0xff) << 8)
-                    + (data[rindex + 2] & 0xff);
-            out[0] = S_BASE64CHAR[i >> 18];
-            out[1] = S_BASE64CHAR[(i >> 12) & 0x3f];
-            out[2] = S_BASE64CHAR[(i >> 6) & 0x3f];
-            out[3] = S_BASE64CHAR[i & 0x3f];
-            writer.write(out, 0, 4);
-            rindex += 3;
-            rest -= 3;
-            output += 4;
-            if (output % 76 == 0)
-                writer.write("\n");
-        }
-        if (rest == 1) {
-            int i = data[rindex] & 0xff;
-            out[0] = S_BASE64CHAR[i >> 2];
-            out[1] = S_BASE64CHAR[(i << 4) & 0x3f];
-            out[2] = S_BASE64PAD;
-            out[3] = S_BASE64PAD;
-            writer.write(out, 0, 4);
-        } else if (rest == 2) {
-            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
-            out[0] = S_BASE64CHAR[i >> 10];
-            out[1] = S_BASE64CHAR[(i >> 4) & 0x3f];
-            out[2] = S_BASE64CHAR[(i << 2) & 0x3f];
-            out[3] = S_BASE64PAD;
-            writer.write(out, 0, 4);
-        }
-    }
+/*
+* 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.
+*/
+package org.apache.axis2.attachments;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+
+public class Base64 {
+    private static final char[] S_BASE64CHAR = {'A', 'B', 'C', 'D', 'E', 'F',
+                                                'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
+                                                'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
+                                                'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
+                                                't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
+                                                '6', '7', '8', '9', '+', '/'};
+
+    private static final char S_BASE64PAD = '=';
+
+    private static final byte[] S_DECODETABLE = new byte[128];
+
+    static {
+        for (int i = 0; i < S_DECODETABLE.length; i++)
+            S_DECODETABLE[i] = Byte.MAX_VALUE; // 127
+        for (int i = 0; i < S_BASE64CHAR.length; i++)
+                // 0 to 63
+            S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i;
+    }
+
+    private static int decode0(char[] ibuf, byte[] obuf, int wp) {
+        int outlen = 3;
+        if (ibuf[3] == S_BASE64PAD)
+            outlen = 2;
+        if (ibuf[2] == S_BASE64PAD)
+            outlen = 1;
+        int b0 = S_DECODETABLE[ibuf[0]];
+        int b1 = S_DECODETABLE[ibuf[1]];
+        int b2 = S_DECODETABLE[ibuf[2]];
+        int b3 = S_DECODETABLE[ibuf[3]];
+        switch (outlen) {
+            case 1:
+                obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                return 1;
+            case 2:
+                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
+                return 2;
+            case 3:
+                obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
+                obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf);
+                obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f);
+                return 3;
+            default:
+                throw new RuntimeException("internalError00");
+        }
+    }
+
+    /**
+     *  
+     */
+    public static byte[] decode(char[] data, int off, int len) {
+        char[] ibuf = new char[4];
+        int ibufcount = 0;
+        byte[] obuf = new byte[len / 4 * 3 + 3];
+        int obufcount = 0;
+        for (int i = off; i < off + len; i++) {
+            char ch = data[i];
+            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
+                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
+                ibuf[ibufcount++] = ch;
+                if (ibufcount == ibuf.length) {
+                    ibufcount = 0;
+                    obufcount += decode0(ibuf, obuf, obufcount);
+                }
+            }
+        }
+        if (obufcount == obuf.length)
+            return obuf;
+        byte[] ret = new byte[obufcount];
+        System.arraycopy(obuf, 0, ret, 0, obufcount);
+        return ret;
+    }
+
+    /**
+     *  
+     */
+    public static byte[] decode(String data) {
+        char[] ibuf = new char[4];
+        int ibufcount = 0;
+        byte[] obuf = new byte[data.length() / 4 * 3 + 3];
+        int obufcount = 0;
+        for (int i = 0; i < data.length(); i++) {
+            char ch = data.charAt(i);
+            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
+                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
+                ibuf[ibufcount++] = ch;
+                if (ibufcount == ibuf.length) {
+                    ibufcount = 0;
+                    obufcount += decode0(ibuf, obuf, obufcount);
+                }
+            }
+        }
+        if (obufcount == obuf.length)
+            return obuf;
+        byte[] ret = new byte[obufcount];
+        System.arraycopy(obuf, 0, ret, 0, obufcount);
+        return ret;
+    }
+
+    /**
+     *  
+     */
+    public static void decode(char[] data, int off, int len,
+                              OutputStream ostream) throws IOException {
+        char[] ibuf = new char[4];
+        int ibufcount = 0;
+        byte[] obuf = new byte[3];
+        for (int i = off; i < off + len; i++) {
+            char ch = data[i];
+            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
+                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
+                ibuf[ibufcount++] = ch;
+                if (ibufcount == ibuf.length) {
+                    ibufcount = 0;
+                    int obufcount = decode0(ibuf, obuf, 0);
+                    ostream.write(obuf, 0, obufcount);
+                }
+            }
+        }
+    }
+
+    /**
+     *  
+     */
+    public static void decode(String data, OutputStream ostream)
+            throws IOException {
+        char[] ibuf = new char[4];
+        int ibufcount = 0;
+        byte[] obuf = new byte[3];
+        for (int i = 0; i < data.length(); i++) {
+            char ch = data.charAt(i);
+            if (ch == S_BASE64PAD || ch < S_DECODETABLE.length
+                    && S_DECODETABLE[ch] != Byte.MAX_VALUE) {
+                ibuf[ibufcount++] = ch;
+                if (ibufcount == ibuf.length) {
+                    ibufcount = 0;
+                    int obufcount = decode0(ibuf, obuf, 0);
+                    ostream.write(obuf, 0, obufcount);
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns base64 representation of specified byte array.
+     */
+    public static String encode(byte[] data) {
+        return encode(data, 0, data.length);
+    }
+
+    /**
+     * Returns base64 representation of specified byte array.
+     */
+    public static String encode(byte[] data, int off, int len) {
+        if (len <= 0)
+            return "";
+        char[] out = new char[len / 3 * 4 + 4];
+        int rindex = off;
+        int windex = 0;
+        int rest = len - off;
+        while (rest >= 3) {
+            int i = ((data[rindex] & 0xff) << 16)
+                    + ((data[rindex + 1] & 0xff) << 8)
+                    + (data[rindex + 2] & 0xff);
+            out[windex++] = S_BASE64CHAR[i >> 18];
+            out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f];
+            out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f];
+            out[windex++] = S_BASE64CHAR[i & 0x3f];
+            rindex += 3;
+            rest -= 3;
+        }
+        if (rest == 1) {
+            int i = data[rindex] & 0xff;
+            out[windex++] = S_BASE64CHAR[i >> 2];
+            out[windex++] = S_BASE64CHAR[(i << 4) & 0x3f];
+            out[windex++] = S_BASE64PAD;
+            out[windex++] = S_BASE64PAD;
+        } else if (rest == 2) {
+            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
+            out[windex++] = S_BASE64CHAR[i >> 10];
+            out[windex++] = S_BASE64CHAR[(i >> 4) & 0x3f];
+            out[windex++] = S_BASE64CHAR[(i << 2) & 0x3f];
+            out[windex++] = S_BASE64PAD;
+        }
+        return new String(out, 0, windex);
+    }
+
+    /**
+     * Outputs base64 representation of the specified byte array to a byte
+     * stream.
+     */
+    public static void encode(byte[] data, int off, int len,
+                              OutputStream ostream) throws IOException {
+        if (len <= 0)
+            return;
+        byte[] out = new byte[4];
+        int rindex = off;
+        int rest = len - off;
+        while (rest >= 3) {
+            int i = ((data[rindex] & 0xff) << 16)
+                    + ((data[rindex + 1] & 0xff) << 8)
+                    + (data[rindex + 2] & 0xff);
+            out[0] = (byte) S_BASE64CHAR[i >> 18];
+            out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f];
+            out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f];
+            out[3] = (byte) S_BASE64CHAR[i & 0x3f];
+            ostream.write(out, 0, 4);
+            rindex += 3;
+            rest -= 3;
+        }
+        if (rest == 1) {
+            int i = data[rindex] & 0xff;
+            out[0] = (byte) S_BASE64CHAR[i >> 2];
+            out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f];
+            out[2] = (byte) S_BASE64PAD;
+            out[3] = (byte) S_BASE64PAD;
+            ostream.write(out, 0, 4);
+        } else if (rest == 2) {
+            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
+            out[0] = (byte) S_BASE64CHAR[i >> 10];
+            out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f];
+            out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f];
+            out[3] = (byte) S_BASE64PAD;
+            ostream.write(out, 0, 4);
+        }
+    }
+
+    /**
+     * Outputs base64 representation of the specified byte array to a character
+     * stream.
+     */
+    public static void encode(byte[] data, int off, int len, Writer writer)
+            throws IOException {
+        if (len <= 0)
+            return;
+        char[] out = new char[4];
+        int rindex = off;
+        int rest = len - off;
+        int output = 0;
+        while (rest >= 3) {
+            int i = ((data[rindex] & 0xff) << 16)
+                    + ((data[rindex + 1] & 0xff) << 8)
+                    + (data[rindex + 2] & 0xff);
+            out[0] = S_BASE64CHAR[i >> 18];
+            out[1] = S_BASE64CHAR[(i >> 12) & 0x3f];
+            out[2] = S_BASE64CHAR[(i >> 6) & 0x3f];
+            out[3] = S_BASE64CHAR[i & 0x3f];
+            writer.write(out, 0, 4);
+            rindex += 3;
+            rest -= 3;
+            output += 4;
+            if (output % 76 == 0)
+                writer.write("\n");
+        }
+        if (rest == 1) {
+            int i = data[rindex] & 0xff;
+            out[0] = S_BASE64CHAR[i >> 2];
+            out[1] = S_BASE64CHAR[(i << 4) & 0x3f];
+            out[2] = S_BASE64PAD;
+            out[3] = S_BASE64PAD;
+            writer.write(out, 0, 4);
+        } else if (rest == 2) {
+            int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff);
+            out[0] = S_BASE64CHAR[i >> 10];
+            out[1] = S_BASE64CHAR[(i >> 4) & 0x3f];
+            out[2] = S_BASE64CHAR[(i << 2) & 0x3f];
+            out[3] = S_BASE64PAD;
+            writer.write(out, 0, 4);
+        }
+    }
 }

Propchange: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/Base64.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/ByteArrayDataSource.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/ByteArrayDataSource.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/ByteArrayDataSource.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/ByteArrayDataSource.java Thu Sep 15 11:52:11 2005
@@ -1,66 +1,66 @@
-/**
- * Copyright 2001-2004 The Apache Software Foundation.
- * <p/>
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.
- * <p/>
- */
-package org.apache.axis2.attachments;
-
-import javax.activation.DataSource;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-public class ByteArrayDataSource implements DataSource {
-
-    private byte[] data;
-
-    private String type;
-
-    public ByteArrayDataSource(byte[] data, String type) {
-        super();
-        this.data = data;
-        this.type = type;
-    }
-
-    public ByteArrayDataSource(byte[] data) {
-        super();
-        this.data = data;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getContentType() {
-        if (type == null)
-            return "application/octet-stream";
-        else
-            return type;
-    }
-
-    public InputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(data);
-    }
-
-    public String getName() {
-
-        return "ByteArrayDataSource";
-    }
-
-    public OutputStream getOutputStream() throws IOException {
-        throw new IOException("Not Supported");
-    }
-}
-
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+package org.apache.axis2.attachments;
+
+import javax.activation.DataSource;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class ByteArrayDataSource implements DataSource {
+
+    private byte[] data;
+
+    private String type;
+
+    public ByteArrayDataSource(byte[] data, String type) {
+        super();
+        this.data = data;
+        this.type = type;
+    }
+
+    public ByteArrayDataSource(byte[] data) {
+        super();
+        this.data = data;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getContentType() {
+        if (type == null)
+            return "application/octet-stream";
+        else
+            return type;
+    }
+
+    public InputStream getInputStream() throws IOException {
+        return new ByteArrayInputStream(data);
+    }
+
+    public String getName() {
+
+        return "ByteArrayDataSource";
+    }
+
+    public OutputStream getOutputStream() throws IOException {
+        throw new IOException("Not Supported");
+    }
+}
+

Propchange: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/ByteArrayDataSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEBodyPartInputStream.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEBodyPartInputStream.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEBodyPartInputStream.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEBodyPartInputStream.java Thu Sep 15 11:52:11 2005
@@ -1,105 +1,105 @@
-/**
- * Copyright 2001-2004 The Apache Software Foundation. <p/>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 <p/>
- * http://www.apache.org/licenses/LICENSE-2.0 <p/>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. <p/>
- */
-package org.apache.axis2.attachments;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PushbackInputStream;
-
-public class MIMEBodyPartInputStream extends InputStream {
-    PushbackInputStream inStream;
-
-    boolean boundaryFound = false;
-
-    MIMEHelper parent = null;
-
-    byte[] boundary;
-
-    public MIMEBodyPartInputStream(PushbackInputStream inStream, byte[] boundary) {
-        super();
-        this.inStream = inStream;
-        this.boundary = boundary;
-    }
-
-    public MIMEBodyPartInputStream(PushbackInputStream inStream,
-            byte[] boundary, MIMEHelper parent) {
-        this(inStream, boundary);
-        this.parent = parent;
-    }
-
-    public int read() throws IOException {
-        if (boundaryFound) {
-            return -1;
-        }
-        // read the next value from stream
-        int value = inStream.read();
-
-        // A problem occured because all the mime parts tends to have a /r/n at
-        // the end. Making it hard to transform them to correct DataSources.
-        // This logic introduced to handle it
-        //TODO look more in to this && for a better way to do this
-        if (value == 13) {
-            value = inStream.read();
-            if (value != 10) {
-                inStream.unread(value);
-                return 13;
-            } else {
-                value = inStream.read();
-                if ((byte) value != boundary[0]) {
-                    inStream.unread(value);
-                    inStream.unread(10);
-                    return 13;
-                }
-            }
-        } else if ((byte) value != boundary[0]) {
-            return value;
-        }
-
-        // read value is the first byte of the boundary. Start matching the
-        // next characters to find a boundary
-        int boundaryIndex = 0;
-        while ((boundaryIndex < (boundary.length - 1))
-                && ((byte) value == boundary[boundaryIndex])) {
-            value = inStream.read();
-            boundaryIndex++;
-        }
-
-        if (boundaryIndex == (boundary.length - 1)) { // boundary found
-            boundaryFound = true;
-            // read the end of line character
-            if ((value = inStream.read()) == 45) {
-                //check whether end of stream
-                //Last mime boundary should have a succeeding "--"
-                if ((value = inStream.read()) == 45 && parent!=null) {
-                    parent.setEndOfStream(true);
-                }
-            } else {
-                inStream.read();
-            }
-
-            return -1;
-        }
-
-        // Boundary not found. Restoring bytes skipped.
-        // write first skipped byte, push back the rest
-
-        if (value != -1) { // Stream might have ended
-            inStream.unread(value);
-        }
-        inStream.unread(boundary, 1, boundaryIndex - 1);
-        return boundary[0];
-    }
-    
-    public boolean getBoundaryStatus()
-    {
-        return boundaryFound;
-    }
+/**
+ * Copyright 2001-2004 The Apache Software Foundation. <p/>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 <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0 <p/>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. <p/>
+ */
+package org.apache.axis2.attachments;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PushbackInputStream;
+
+public class MIMEBodyPartInputStream extends InputStream {
+    PushbackInputStream inStream;
+
+    boolean boundaryFound = false;
+
+    MIMEHelper parent = null;
+
+    byte[] boundary;
+
+    public MIMEBodyPartInputStream(PushbackInputStream inStream, byte[] boundary) {
+        super();
+        this.inStream = inStream;
+        this.boundary = boundary;
+    }
+
+    public MIMEBodyPartInputStream(PushbackInputStream inStream,
+            byte[] boundary, MIMEHelper parent) {
+        this(inStream, boundary);
+        this.parent = parent;
+    }
+
+    public int read() throws IOException {
+        if (boundaryFound) {
+            return -1;
+        }
+        // read the next value from stream
+        int value = inStream.read();
+
+        // A problem occured because all the mime parts tends to have a /r/n at
+        // the end. Making it hard to transform them to correct DataSources.
+        // This logic introduced to handle it
+        //TODO look more in to this && for a better way to do this
+        if (value == 13) {
+            value = inStream.read();
+            if (value != 10) {
+                inStream.unread(value);
+                return 13;
+            } else {
+                value = inStream.read();
+                if ((byte) value != boundary[0]) {
+                    inStream.unread(value);
+                    inStream.unread(10);
+                    return 13;
+                }
+            }
+        } else if ((byte) value != boundary[0]) {
+            return value;
+        }
+
+        // read value is the first byte of the boundary. Start matching the
+        // next characters to find a boundary
+        int boundaryIndex = 0;
+        while ((boundaryIndex < (boundary.length - 1))
+                && ((byte) value == boundary[boundaryIndex])) {
+            value = inStream.read();
+            boundaryIndex++;
+        }
+
+        if (boundaryIndex == (boundary.length - 1)) { // boundary found
+            boundaryFound = true;
+            // read the end of line character
+            if ((value = inStream.read()) == 45) {
+                //check whether end of stream
+                //Last mime boundary should have a succeeding "--"
+                if ((value = inStream.read()) == 45 && parent!=null) {
+                    parent.setEndOfStream(true);
+                }
+            } else {
+                inStream.read();
+            }
+
+            return -1;
+        }
+
+        // Boundary not found. Restoring bytes skipped.
+        // write first skipped byte, push back the rest
+
+        if (value != -1) { // Stream might have ended
+            inStream.unread(value);
+        }
+        inStream.unread(boundary, 1, boundaryIndex - 1);
+        return boundary[0];
+    }
+    
+    public boolean getBoundaryStatus()
+    {
+        return boundaryFound;
+    }
 }

Propchange: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEBodyPartInputStream.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message