Author: heiko.braun(a)jboss.com
Date: 2008-02-22 04:43:13 -0500 (Fri, 22 Feb 2008)
New Revision: 5767
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/FileTransferService.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
Fix JBWS-2000: Cunked encoding config has not been picked up and the AttachmentScanner did
pick wrong method annotations
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-02-22
09:41:03 UTC (rev 5766)
+++
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-02-22
09:43:13 UTC (rev 5767)
@@ -53,6 +53,7 @@
import org.jboss.ws.core.WSTimeoutException;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.metadata.config.EndpointProperty;
+import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.extensions.wsrm.transport.RMChannel;
import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
@@ -300,10 +301,10 @@
// May be overridden through endpoint config
if (msgContext != null)
{
- Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
+ CommonConfig config = msgContext.getEndpointMetaData().getConfig();
// chunksize settings
- String chunkSizeValue =
epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ String chunkSizeValue =
config.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) :
-1;
if (chunkSize > 0)
{
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java
===================================================================
---
stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2008-02-22
09:41:03 UTC (rev 5766)
+++
stack/native/trunk/src/main/java/org/jboss/ws/extensions/xop/jaxws/ReflectiveAttachmentRefScanner.java 2008-02-22
09:43:13 UTC (rev 5767)
@@ -165,7 +165,7 @@
}
else if(XmlMimeType.class == annotation.annotationType())
{
- XmlMimeType mimeTypeDecl = method.getAnnotation(XmlMimeType.class);
+ XmlMimeType mimeTypeDecl = ((XmlMimeType)annotation);
paramResult = new AttachmentScanResult(mimeTypeDecl.value(),
AttachmentScanResult.Type.XOP);
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/FileTransferService.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/FileTransferService.java 2008-02-22
09:41:03 UTC (rev 5766)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/FileTransferService.java 2008-02-22
09:43:13 UTC (rev 5767)
@@ -6,12 +6,14 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.ws.BindingType;
+import javax.xml.bind.annotation.XmlMimeType;
@WebService(name = "FileTransferService", targetNamespace =
"http://service.mtom.test.net/")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
-public interface FileTransferService {
+public interface FileTransferService
+{
@WebMethod
- boolean transferFile(String fileName, DataHandler contents);
+ boolean transferFile(String fileName,
@XmlMimeType("application/octet-stream") DataHandler contents);
}
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java 2008-02-22
09:41:03 UTC (rev 5766)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws2000/JBWS2000TestCase.java 2008-02-22
09:43:13 UTC (rev 5767)
@@ -25,6 +25,8 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
import javax.activation.DataHandler;
import junit.framework.Test;
@@ -54,14 +56,16 @@
QName serviceName = new
QName("http://service.mtom.test.net/",
"FileTransferServiceImplService");
Service service = Service.create(wsdlURL, serviceName);
port = service.getPort(FileTransferService.class);
+
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)port).getBinding();
+ binding.setMTOMEnabled(true);
}
}
public void testFileTransfer() throws Exception
{
- DataHandler dh = new DataHandler(
- new GeneratorDataSource(1024*1204*150)
- );
+ GeneratorDataSource source = new GeneratorDataSource(1024 * 1204 * 150);
+ DataHandler dh = new DataHandler(source);
boolean success = port.transferFile("JBWS2000.data", dh);
assertTrue("Failed to transfer file", success);
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2008-02-22
09:41:03 UTC (rev 5766)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2008-02-22
09:43:13 UTC (rev 5767)
@@ -29,8 +29,9 @@
import org.jboss.ws.extensions.xop.jaxws.AttachmentScanResult;
import javax.xml.bind.annotation.XmlMimeType;
-import java.awt.*;
+import java.awt.Image;
import java.lang.reflect.Method;
+import java.util.List;
/**
* Test the ReflectiveXOPScanner.
@@ -71,20 +72,20 @@
public void testAnnotatedParameter() throws Exception
{
- if(true)
+ /*if(true)
{
System.out.println("FIXME [JBWS-1460] @XmlMimeType on SEI parameter
declarations");
return;
- }
+ }*/
Method m = AnnotatedSEI.class.getMethod("foo", new Class[]
{byte[].class});
assertNotNull(m);
System.out.println(m.getParameterAnnotations().length);
- AttachmentScanResult mimeType = SCANNER.scanBean( m.getParameterTypes()[0]);
- assertNotNull("Unable to find xop declaration", mimeType);
- assertEquals("text/xml", mimeType.getMimeType());
+ List<AttachmentScanResult> mimeTypes =
ReflectiveAttachmentRefScanner.scanMethod( m );
+ assertNotNull("Unable to find xop declaration", mimeTypes.isEmpty());
+ assertEquals("text/xml", mimeTypes.get(0).getMimeType());
}
public void testSimpleRecursion() throws Exception