Author: heiko.braun(a)jboss.com
Date: 2006-12-06 10:52:34 -0500 (Wed, 06 Dec 2006)
New Revision: 1580
Modified:
trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/xop/XOPContext.java
trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentUnmarshallerImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
Log:
First working draft of JAX-WS MTOM capabilities
Modified: trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-06 15:32:32
UTC (rev 1579)
+++ trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-12-06 15:52:34
UTC (rev 1580)
@@ -114,6 +114,9 @@
// Maps the java method to the operation meta data
private Map<Method, OperationMetaData> opMetaDataCache = new HashMap<Method,
OperationMetaData>();
+ // JAX-WS default is false
+ private boolean mtomEnabled = false;
+
public EndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName,
Type type)
{
this.serviceMetaData = service;
@@ -283,15 +286,15 @@
{
if (parameterStyle == null)
{
- parameterStyle = ParameterStyle.WRAPPED;
+ this.parameterStyle = ParameterStyle.WRAPPED;
log.debug("Using default parameter style: " + parameterStyle);
}
- return parameterStyle;
+ return this.parameterStyle;
}
public void setParameterStyle(ParameterStyle value)
{
- if (value != null && parameterStyle != null &&
!parameterStyle.equals(value))
+ if (value != null && this.parameterStyle != null &&
!this.parameterStyle.equals(value))
throw new WSException("Mixed SOAP parameter styles not supported");
log.debug("setParameterStyle: " + value);
@@ -313,6 +316,14 @@
return type;
}
+ public boolean isMtomEnabled() {
+ return mtomEnabled;
+ }
+
+ public void setMtomEnabled(boolean mtomEnabled) {
+ this.mtomEnabled = mtomEnabled;
+ }
+
public String getAuthMethod()
{
return authMethod;
Modified: trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-06 15:32:32
UTC (rev 1579)
+++ trunk/src/main/java/org/jboss/ws/metadata/ParameterMetaData.java 2006-12-06 15:52:34
UTC (rev 1580)
@@ -37,6 +37,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.xop.jaxws.ReflectiveXOPScanner;
import org.jboss.ws.jaxrpc.ParameterWrapping;
import org.jboss.ws.jaxws.DynamicWrapperGenerator;
import org.jboss.ws.metadata.WrappedParameter.AccessorFactory;
@@ -171,12 +172,7 @@
String mimeType = convertXmlTypeToMimeType(xmlType);
setMimeTypes(mimeType);
this.isSwA = true;
- }
- else if(Constants.NS_SCHEMA_XSD.equals(xmlType.getNamespaceURI())
- && "base64Binary".equals(xmlType.getLocalPart()))
- {
- setXOP(true);
- }
+ }
}
public String getJavaTypeName()
@@ -386,8 +382,19 @@
javaType = getJavaType();
if (javaType == null)
throw new WSException("Cannot load java type: " + javaTypeName);
+
+ // check if the JavaType is an mtom parameter
+ // TODO: this should only apply to JAX-WS and needs to happen outside UMD
+ ReflectiveXOPScanner scanner = new ReflectiveXOPScanner();
+ String mimeType = scanner.scan(javaType);
+ if(mimeType!=null)
+ {
+ log.debug("MTOM parameter found: " + xmlName);
+ setXOP(true);
+ }
}
+
private ClassLoader getClassLoader()
{
ClassLoader loader =
opMetaData.getEndpointMetaData().getServiceMetaData().getUnifiedMetaData().getClassLoader();
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
15:32:32 UTC (rev 1579)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -50,7 +50,20 @@
String uri = anBindingType.value();
if (uri.length() > 0)
{
- epMetaData.setBindingId(uri);
+ // TODO: switch to JAX-WS 2.1
+ // This allows us to use constants here and reuse the orig. URI straigt away
+
if(uri.equals("http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true&q...
+ {
+ log.debug("MTOM enabled endpoint found");
+ epMetaData.setMtomEnabled(true);
+ epMetaData.setBindingId(uri.substring(0, uri.indexOf("?")));
+ }
+ else
+ {
+ epMetaData.setBindingId(uri);
+ }
+
+
}
}
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
15:32:32 UTC (rev 1579)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -657,6 +657,17 @@
if (anWebService == null)
throw new WSException("Interface does not have a @WebService annotation:
" + seiName);
+ else
+ {
+ if(anWebService.portName().length()>0
+ || anWebService.serviceName().length()>0
+ || anWebService.endpointInterface().length()>0
+ )
+ {
+ throw new WSException("The service endpoint interface MUST NOT
include the JSR-181 annotation" +
+ "elements portName, serviceName and endpointInterface of the
annotation @WebService.");
+ }
+ }
name = anWebService.name();
if (name.length() == 0)
Modified: trunk/src/main/java/org/jboss/ws/xop/XOPContext.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-06 15:32:32 UTC (rev
1579)
+++ trunk/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-06 15:52:34 UTC (rev
1580)
@@ -24,6 +24,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.xop.jaxrpc.XOPMarshallerImpl;
import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.jaxrpc.StubExt;
@@ -107,15 +108,27 @@
}
/**
- * Check if MTOM is disabled through a message context property.
+ * Check if MTOM is enabled.<br>
+ *
+ * With JAX-WS is depends on a endpoint property and defaults to FALSE,
+ * opposed to JAX-RPC where it defaults to TRUE and is set through a message context
property.
* (<code>org.jboss.ws.mtom.enabled</code>)<br>
- * Defaults to TRUE if the property is not set.
*/
public static boolean isMTOMEnabled()
{
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- Boolean mtomEnabled =
(Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
- return Boolean.TRUE.equals(mtomEnabled) || mtomEnabled == null;
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ boolean isJAXWS = msgContext.getEndpointMetaData().getType() ==
EndpointMetaData.Type.JAXWS;
+
+ if(isJAXWS)
+ {
+ return msgContext.getEndpointMetaData().isMtomEnabled();
+ }
+ else
+ {
+ Boolean mtomEnabled =
(Boolean)msgContext.getProperty(StubExt.PROPERTY_MTOM_ENABLED);
+ return Boolean.TRUE.equals(mtomEnabled) || mtomEnabled == null;
+ }
+
}
public static void setMTOMEnabled(boolean b)
Modified: trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentMarshallerImpl.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -1,46 +1,61 @@
package org.jboss.ws.xop.jaxws;
-import org.jboss.ws.xop.jaxrpc.XOPMarshallerImpl;
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.common.CommonMessageContext;
+import org.jboss.ws.soap.MessageContextAssociation;
+import org.jboss.ws.soap.SOAPMessageImpl;
+import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.WSException;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
-import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
+import javax.activation.DataHandler;
import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
+import javax.xml.soap.AttachmentPart;
-/**
- * Created by IntelliJ IDEA.
- * User: hbraun
- * Date: 01.12.2006
- * Time: 17:20:41
- * To change this template use File | Settings | File Templates.
- */
public class AttachmentMarshallerImpl extends AttachmentMarshaller {
- private XOPMarshaller delegate;
+ private static final Logger log = Logger.getLogger(AttachmentMarshallerImpl.class);
- public AttachmentMarshallerImpl() {
- super();
- delegate = new XOPMarshallerImpl();
- }
+ static
+ {
+ // Load JAF content handlers
+ ContentHandlerRegistry.register();
+ }
- public String addMtomAttachment(DataHandler dataHandler, String string, String
string1) {
- XOPObject xopObject = new XOPObject(dataHandler);
- xopObject.setContentType(dataHandler.getContentType());
- return delegate.addMtomAttachment(xopObject, string, string1);
- }
+ public AttachmentMarshallerImpl() {
+ super();
+ }
- public String addMtomAttachment(byte[] bytes, int i, int i1, String string, String
string1, String string2) {
- throw new WSException("Not yet implemented");
- }
+ public String addMtomAttachment(DataHandler dataHandler, String string, String
string1)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
- public String addSwaRefAttachment(DataHandler dataHandler) {
- throw new WSException("Not yet implemented");
- }
+ QName xmlName = new QName(string, string1);
+ log.debug("serialize: [xmlName=" + xmlName + "]");
+ String cid =
soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
+ AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
+ xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<'+cid+'>');
// RFC2392 requirement
+ soapMessage.addAttachmentPart(xopPart);
- public boolean isXOPPackage() {
- return XOPContext.isXOPMessage();
- }
+ log.debug("Created attachment part " +cid+", with content-type
" +xopPart.getContentType());
+
+ return "cid:" + cid;
+ }
+
+ public String addMtomAttachment(byte[] bytes, int i, int i1, String string, String
string1, String string2) {
+ throw new WSException("Not yet implemented");
+ }
+
+ public String addSwaRefAttachment(DataHandler dataHandler) {
+ throw new WSException("Not yet implemented");
+ }
+
+
+ public boolean isXOPPackage() {
+ return XOPContext.isXOPMessage();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentUnmarshallerImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/main/java/org/jboss/ws/xop/jaxws/AttachmentUnmarshallerImpl.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -1,42 +1,63 @@
package org.jboss.ws.xop.jaxws;
+import org.jboss.ws.WSException;
+import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
import org.jboss.ws.xop.XOPContext;
-import org.jboss.ws.xop.jaxrpc.XOPUnmarshallerImpl;
-import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
-import org.jboss.xb.binding.sunday.xop.XOPObject;
import javax.activation.DataHandler;
import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPException;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
-/**
- * Created by IntelliJ IDEA.
- * User: hbraun
- * Date: 01.12.2006
- * Time: 17:25:56
- * To change this template use File | Settings | File Templates.
- */
public class AttachmentUnmarshallerImpl extends AttachmentUnmarshaller {
+ static
+ {
+ // Load JAF content handlers
+ ContentHandlerRegistry.register();
+ }
- private XOPUnmarshaller delegate;
+ public AttachmentUnmarshallerImpl() {
+ super();
+ }
+ public boolean isXOPPackage() {
+ return XOPContext.isXOPMessage();
+ }
- public AttachmentUnmarshallerImpl() {
- super();
- delegate = new XOPUnmarshallerImpl();
- }
+ public DataHandler getAttachmentAsDataHandler(String cid)
+ {
+ try
+ {
+ AttachmentPart part = XOPContext.getAttachmentByCID(cid);
+ return part.getDataHandler();
+ }
+ catch(SOAPException e)
+ {
+ throw new WSException("Failed to access attachment part", e);
+ }
+ }
- public boolean isXOPPackage() {
- return XOPContext.isXOPMessage();
- }
+ public byte[] getAttachmentAsByteArray(String cid)
+ {
+ try
+ {
+ AttachmentPart part = XOPContext.getAttachmentByCID(cid);
+ DataHandler dh = part.getDataHandler();
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
- public DataHandler getAttachmentAsDataHandler(String string) {
- XOPObject xopObject = delegate.getAttachmentAsDataHandler(string);
- DataHandler dh = new DataHandler(xopObject.getContent(),
xopObject.getContentType());
- return dh;
- }
-
- public byte[] getAttachmentAsByteArray(String string) {
- return delegate.getAttachmentAsByteArray(string);
- }
+ return bout.toByteArray();
+ }
+ catch (SOAPException ex)
+ {
+ throw new WSException(ex);
+ }
+ catch(IOException e)
+ {
+ throw new WSException(e);
+ }
+ }
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHRequest.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -23,12 +23,9 @@
import javax.activation.DataHandler;
import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since 05.12.2006
- */
+@XmlType(name="request", namespace =
"http://org.jboss.ws/xop/doclit")
public class DHRequest {
@@ -42,7 +39,7 @@
private DataHandler dataHandler;
- @XmlMimeType("text/xml")
+ @XmlMimeType("image/jpeg")
public DataHandler getDataHandler() {
return dataHandler;
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/DHResponse.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -23,12 +23,9 @@
import javax.activation.DataHandler;
import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
-/**
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
- * @since 05.12.2006
- */
+@XmlType(name="response", namespace =
"http://org.jboss.ws/xop/doclit")
public class DHResponse {
@@ -42,7 +39,7 @@
this.dataHandler = dataHandler;
}
- @XmlMimeType("text/xml")
+ @XmlMimeType("image/jpeg")
public DataHandler getDataHandler() {
return dataHandler;
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpoint.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -3,11 +3,14 @@
import javax.ejb.Remote;
import javax.jws.WebMethod;
import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
@Remote
-@WebService
+@WebService(targetNamespace = "http://org.jboss.ws/xop/doclit")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle =
SOAPBinding.ParameterStyle.BARE)
+@BindingType(value="http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
public interface MTOMEndpoint {
- @WebMethod
public DHResponse echoDataHandler(DHRequest request);
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java
===================================================================
---
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-06
15:32:32 UTC (rev 1579)
+++
trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/MTOMEndpointBean.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -22,22 +22,34 @@
package org.jboss.test.ws.jaxws.xop.doclit;
import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.WSException;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.ejb.Stateless;
+import javax.xml.ws.BindingType;
+import javax.activation.DataHandler;
+import java.io.IOException;
@Stateless
-@WebService(name = "MTOMEndpoint", targetNamespace =
"http://org.jboss.ws/xop/doclit", serviceName = "MTOMService")
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle =
SOAPBinding.ParameterStyle.BARE)
+@WebService(name="MTOMEndpoint", serviceName = "MTOMService",
endpointInterface = "org.jboss.test.ws.jaxws.xop.doclit.MTOMEndpoint")
public class MTOMEndpointBean implements MTOMEndpoint {
+
+ public DHResponse echoDataHandler(DHRequest request) {
+ DataHandler dataHandler = request.getDataHandler();
- @WebMethod
- public DHResponse echoDataHandler(DHRequest request) {
-
- System.out.println("Recv " + request.getDataHandler().getContentType());
+ try
+ {
+ System.out.println("Recv " + dataHandler.getContentType());
+ System.out.println("Content is "+ dataHandler.getContent());
+ }
+ catch (IOException e)
+ {
+ throw new WSException(e);
+ }
+
return new DHResponse(
request.getDataHandler()
);
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-06
15:32:32 UTC (rev 1579)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/xop/doclit/XOPTestCase.java 2006-12-06
15:52:34 UTC (rev 1580)
@@ -28,9 +28,11 @@
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Binding;
+import javax.xml.ws.soap.SOAPBinding;
import javax.activation.DataHandler;
import java.net.URL;
import java.util.Map;
+import java.awt.image.BufferedImage;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -39,7 +41,7 @@
*/
public class XOPTestCase extends JBossWSTest {
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8081/jaxws-xop-doclit/MTOMEndpointBean";
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-xop-doclit/MTOMEndpointBean";
private MTOMEndpoint mtomWS;
@@ -56,17 +58,26 @@
javax.xml.ws.Service service = javax.xml.ws.Service.create(wsdlURL, serviceName);
mtomWS = service.getPort(MTOMEndpoint.class);
+
+ // enable MTOM
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)mtomWS).getBinding();
+ binding.setMTOMEnabled(true);
+
+ // debug request/reponse
+ /*
BindingProvider bp = (BindingProvider)mtomWS;
- Map<String,Object> context = bp.getRequestContext();
- context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, TARGET_ENDPOINT_ADDRESS);
+ Map<String,Object> context = bp.getRequestContext();
+ context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" +
getServerHost() + ":8081/jaxws-xop-doclit/MTOMEndpointBean");
+ */
}
public void testRequestResponseOptimized() throws Exception
{
- URL url = new URL("file:resources/jaxws/xop/shared/attach.xml");
- DataHandler dh = new DataHandler(url);
+ URL url = new URL("file:resources/jaxws/xop/shared/attach.jpeg");
+ DataHandler dh = new DataHandler(url);
DHResponse response = mtomWS.echoDataHandler(new DHRequest(dh));
assertNotNull(response);
- assertEquals(response.getDataHandler().getContentType(), "text/xml");
+ assertEquals(response.getDataHandler().getContentType(), "image/jpeg");
+ assertTrue(response.getDataHandler().getContent() instanceof BufferedImage);
}
}
\ No newline at end of file