svn commit: r952925 - /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

2010-06-09 Thread azeez
Author: azeez
Date: Wed Jun  9 09:39:28 2010
New Revision: 952925

URL: http://svn.apache.org/viewvc?rev=952925&view=rev
Log:
Printing the filename as well

Modified:

axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=952925&r1=952924&r2=952925&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
 Wed Jun  9 09:39:28 2010
@@ -490,7 +490,8 @@ public class AxisConfiguration extends A
 // If we were already there, that's fine.  If not, fault!
 if (oldService != axisService) {
 throw new 
AxisFault(Messages.getMessage("twoservicecannothavesamename",
-
axisService.getName()));
+axisService.getName() +
+" [" + 
axisService.getFileName() + "]"));
 }
 }
 }




svn commit: r952971 - in /axis/axis2/java/core/trunk/modules: jaxws/src/org/apache/axis2/jaxws/message/impl/ jaxws/test/org/apache/axis2/jaxws/message/impl/ kernel/src/org/apache/axis2/util/

2010-06-09 Thread scheu
Author: scheu
Date: Wed Jun  9 12:02:06 2010
New Revision: 952971

URL: http://svn.apache.org/viewvc?rev=952971&view=rev
Log:
AXIS2-4733
Contributor: Phil Adams
Contributed WrappedDataHandler to allow Axis2 to set the appropriate 
content-type on a DataHandler.
Also added a validation test.

Added:

axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java

axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/WrappedDataHandler.java
Modified:

axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java?rev=952971&r1=952970&r2=952971&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
 Wed Jun  9 12:02:06 2010
@@ -37,6 +37,7 @@ import org.apache.axis2.jaxws.message.da
 import org.apache.axis2.jaxws.message.databinding.DataSourceBlock;
 import org.apache.axis2.jaxws.message.factory.MessageFactory;
 import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.util.WrappedDataHandler;
 
 import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.MimeHeader;
@@ -118,7 +119,7 @@ public class MessageFactoryImpl implemen
 m.setDoingSWA(true);
 while (it.hasNext()) {
 AttachmentPart ap = (AttachmentPart)it.next();
-m.addDataHandler(ap.getDataHandler(), ap.getContentId());
+m.addDataHandler(new 
WrappedDataHandler(ap.getDataHandler(), ap.getContentType()), 
ap.getContentId());
 }
 }
 return m;
@@ -144,5 +145,4 @@ public class MessageFactoryImpl implemen
 }
 return createFrom(block.getXMLStreamReader(true), protocol);
 }
-
 }

Added: 
axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java?rev=952971&view=auto
==
--- 
axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java
 Wed Jun  9 12:02:06 2010
@@ -0,0 +1,48 @@
+package org.apache.axis2.jaxws.message.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import java.net.URL;
+import javax.activation.DataHandler;
+
+import org.apache.axis2.util.WrappedDataHandler;
+
+import junit.framework.TestCase;
+
+/**
+ * Test the WrappedDataHandler class.
+ */
+public class WrappedDataHandlerTest extends TestCase {
+   
+   /**
+* Verify that the Wrapped DataHandler maintains the correct content-type 
value
+* for an XML document attachment.
+*/
+   public void testWrappedDataHandler() throws Exception {
+  URL xmlAttachment = new URL("file:./test-resources/xml/soapmessage.xml");
+
+  DataHandler dh = new DataHandler(xmlAttachment);
+  assertTrue(dh.getContentType().equals("application/xml"));
+
+  WrappedDataHandler wrappedDH = new WrappedDataHandler(dh, "text/xml");
+  assertTrue(wrappedDH.getContentType() != null);
+  assertTrue(wrappedDH.getContentType().equals("text/xml"));
+   }
+}

Added: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/WrappedDataHandler.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/WrappedDataHandler.java?rev=952971&view=auto
==
--- 
axis/axis2/jav

svn commit: r953088 - in /axis/axis2/java/core/trunk/modules: jaxws/src/org/apache/axis2/jaxws/message/impl/ jaxws/test/org/apache/axis2/jaxws/message/impl/ kernel/src/org/apache/axis2/util/

2010-06-09 Thread veithen
Author: veithen
Date: Wed Jun  9 17:32:32 2010
New Revision: 953088

URL: http://svn.apache.org/viewvc?rev=953088&view=rev
Log:
AXIS2-4733: Temporarily reverting r952971 since it causes a build failure.

Removed:

axis/axis2/java/core/trunk/modules/jaxws/test/org/apache/axis2/jaxws/message/impl/WrappedDataHandlerTest.java

axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/WrappedDataHandler.java
Modified:

axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java?rev=953088&r1=953087&r2=953088&view=diff
==
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/MessageFactoryImpl.java
 Wed Jun  9 17:32:32 2010
@@ -37,7 +37,6 @@ import org.apache.axis2.jaxws.message.da
 import org.apache.axis2.jaxws.message.databinding.DataSourceBlock;
 import org.apache.axis2.jaxws.message.factory.MessageFactory;
 import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.util.WrappedDataHandler;
 
 import javax.xml.soap.AttachmentPart;
 import javax.xml.soap.MimeHeader;
@@ -119,7 +118,7 @@ public class MessageFactoryImpl implemen
 m.setDoingSWA(true);
 while (it.hasNext()) {
 AttachmentPart ap = (AttachmentPart)it.next();
-m.addDataHandler(new 
WrappedDataHandler(ap.getDataHandler(), ap.getContentType()), 
ap.getContentId());
+m.addDataHandler(ap.getDataHandler(), ap.getContentId());
 }
 }
 return m;
@@ -145,4 +144,5 @@ public class MessageFactoryImpl implemen
 }
 return createFrom(block.getXMLStreamReader(true), protocol);
 }
+
 }