Author: heiko.braun(a)jboss.com
Date: 2006-10-24 10:06:00 -0400 (Tue, 24 Oct 2006)
New Revision: 1296
Added:
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java
Removed:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java
Modified:
branches/jbossws-1.0/src/main/java/javax/xml/soap/AttachmentPart.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/MimeUtils.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPContext.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPScanner.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
branches/jbossws-1.0/src/main/resources/schema/j2ee_1_4.xsd
branches/jbossws-1.0/src/main/resources/schema/javaee_5.xsd
branches/jbossws-1.0/src/test/ant/build-interop-jars.xml
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/META-INF/jboss-client.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/WEB-INF/web.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/ConfidentialService.wsdl
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/TestService.wsdl
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/META-INF/jboss-client.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/schema.xsd
Log:
update MTOM to XB CR7. Added support for ContentAdapter
Modified: branches/jbossws-1.0/src/main/java/javax/xml/soap/AttachmentPart.java
===================================================================
--- branches/jbossws-1.0/src/main/java/javax/xml/soap/AttachmentPart.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/javax/xml/soap/AttachmentPart.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -195,7 +195,7 @@
/**
* Sets the given DataHandler object as the data handler for this AttachmentPart
object.
* Typically, on an incoming message, the data handler is automatically set.
- * When a message is being created and populated with content, the setDataHandler
method can be used to get data
+ * When a message is being created and populated with content, the setXopContent
method can be used to get data
* from various data sources into the message.
* @param dataHandler the DataHandler object to be set
* @throws IllegalArgumentException if there was a problem with the specified
DataHandler object
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -885,7 +885,7 @@
// When a potential XOP parameter is detected and
// the incomming request is actuall XOP encoded we flag
// the SOAP message a XOP packaged.
- if (paramMetaData.isXOP() && XOPContext.isMultipartXOP())
+ if (paramMetaData.isXOP() && XOPContext.isXOPEncodedRequest())
{
SOAPMessageImpl soapMessage =
(SOAPMessageImpl)MessageContextAssociation.peekMessageContext().getSOAPMessage();
soapMessage.setXOPMessage(true);
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/ServiceFactoryImpl.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -38,7 +38,8 @@
* Service class acts as a factory for:
* <ul>
* <li>Dynamic proxy for the target service endpoint.
- * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
remote operation on the target service endpoint.
+ * <li>Instance of the type javax.xml.rpc.Call for the dynamic invocation of a
+ * remote operation on the target service endpoint.
* <li>Instance of a generated stub class
* </ul>
*
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -35,6 +35,7 @@
import org.jboss.ws.WSException;
import org.jboss.xb.binding.SimpleTypeBindings;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
import org.w3c.dom.Element;
import java.io.IOException;
@@ -58,7 +59,7 @@
String valueStr = unwrapValueStr(xmlFragment);
- if(XOPContext.isXOPPackage())
+ if(XOPContext.isXOPMessage())
{
try
{
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -56,7 +56,7 @@
String xmlFragment = null;
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- if(XOPContext.isXOPPackage())
+ if(XOPContext.isXOPMessage())
{
XOPMarshaller xopMarshaller = new XOPMarshallerImpl();
XOPObject xopObject = new XOPObject(value);
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -45,7 +45,7 @@
QName xmlName = (QName)properties.get(JBossXBConstants.JBXB_ROOT_QNAME);
QName xmlType = (QName)properties.get(JBossXBConstants.JBXB_TYPE_QNAME);
- // Get the eagerly initialized SchameBinding from the ServiceMetaData
+ // Get the eagerly initialized SchemaBinding from the ServiceMetaData
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null)
{
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -23,15 +23,15 @@
// $Id$
-import java.io.InputStream;
-import java.util.HashMap;
-
import org.jboss.ws.WSException;
import org.jboss.ws.xop.XOPUnmarshallerImpl;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import java.io.InputStream;
+import java.util.HashMap;
+
/**
* An implementation of a JAXB Unmarshaller.
*
@@ -53,7 +53,10 @@
org.jboss.xb.binding.Unmarshaller unm =
UnmarshallerFactory.newInstance().newUnmarshaller();
SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties);
- schemaBinding.setXopUnmarshaller(new XOPUnmarshallerImpl());
+
+ XOPUnmarshallerImpl xopUnmarshaller = new XOPUnmarshallerImpl();
+ schemaBinding.setXopUnmarshaller(xopUnmarshaller);
+
try
{
return unm.unmarshal(is, schemaBinding);
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -30,6 +30,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.metadata.jaxrpcmapping.*;
import org.jboss.ws.utils.JBossWSEntityResolver;
+import org.jboss.ws.xop.JBossXBContentAdapter;
import org.jboss.xb.binding.metadata.ClassMetaData;
import org.jboss.xb.binding.metadata.PackageMetaData;
import org.jboss.xb.binding.metadata.PropertyMetaData;
@@ -79,7 +80,10 @@
{
bindSchemaToJava(schemaBinding, wsdlMapping);
}
-
+
+ // setup MTOM handler
+ JBossXBContentAdapter.register(schemaBinding);
+
return schemaBinding;
}
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -280,35 +280,7 @@
if (isAssignable == false)
{
- Object convertedObj = null;
-
- // XOP value handling:
- // xsd:base64Binaries are always turned into a DataHandler
- // through the XOPValueAdapter. This is necessary to support
- // inlined and optimized transmissions.
- //
- // TODO: This only works for simple types, what about complex types?
- // Within a complex type any bean property would turnout as a
DataHandler
- if (obj instanceof DataHandler)
- {
- try
- {
- convertedObj = ((DataHandler)obj).getContent();
- }
- catch (IOException e)
- {
- throw new WSException("Failed to convert unassignable
endpoint parameter", e);
- }
- }
-
- if (null == convertedObj || !JavaUtils.isAssignableFrom(javaType,
convertedObj.getClass())) // conversion failed
- {
- throw new WSException("Java type '" + javaType +
"' is not assignable from: " + objType.getName());
- }
- else
- {
- obj = convertedObj;
- }
+ throw new WSException("Java type '" + javaType +
"' is not assignable from: " + objType.getName());
}
}
@@ -1022,7 +994,7 @@
// element back to an xop:Include element and create the attachment part
log.debug("MTOM enabled: Restore XOP data");
- XOPContext.restoreXOPDataDOM(this);
+ XOPContext.restoreXOPDataDOM(this);
}
}
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -22,10 +22,12 @@
package org.jboss.ws.soap.attachment;
import org.jboss.ws.utils.MimeUtils;
+import org.jboss.ws.utils.IOUtils;
import javax.activation.ActivationDataFlavor;
import javax.activation.DataContentHandler;
import javax.activation.DataSource;
+import javax.activation.DataHandler;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.ByteArrayInputStream;
@@ -57,12 +59,15 @@
}
public void writeTo(Object object, String string, OutputStream outputStream) throws
IOException {
+
if(object instanceof byte[])
{
- // this actually depends on the SwapableMemoryDataSource
- // todo: why is not always a ByteArrayInputStream ?
outputStream.write((byte[])object);
}
+ else if(object instanceof DataHandler)
+ {
+ IOUtils.copyStream(outputStream, ((DataHandler)object).getInputStream());
+ }
else
{
MimeUtils.ByteArrayConverter converter =
MimeUtils.getConverterForJavaType(object.getClass());
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/MimeUtils.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/MimeUtils.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/MimeUtils.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -210,6 +210,7 @@
return converter;
}
+
public static class ImageConverter implements ByteArrayConverter
{
public Object readFrom(InputStream in) {
Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,212 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.xop;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.Constants;
+import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
+import org.jboss.ws.soap.attachment.SwapableMemoryDataSource;
+import org.jboss.ws.utils.IOUtils;
+import org.jboss.ws.utils.MimeUtils;
+import org.jboss.xb.binding.sunday.marshalling.MarshallingContext;
+import org.jboss.xb.binding.sunday.marshalling.TermBeforeMarshallingCallback;
+import org.jboss.xb.binding.sunday.unmarshalling.*;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.xml.namespace.QName;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+/**
+ * Adopts raw binary contents to java types.
+ * This class works in conjunction with the <code>XOPUnmarshallerImpl</code>
+ * and <code>XOPMarshallerImpl</code>.
+ *
+ * @see XOPUnmarshallerImpl
+ * @see XOPMarshallerImpl
+ *
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 19, 2006
+ */
+public class JBossXBContentAdapter implements TermBeforeMarshallingCallback,
TermBeforeSetParentCallback {
+
+ private static final Logger log = Logger.getLogger(JBossXBContentAdapter.class);
+ private static final QName XMIME_BASE_64 = new QName(Constants.NS_XML_MIME,
"base64Binary");
+ private static final QName XOP_INCLUDE = new QName(Constants.NS_XOP,
"Include");
+
+ static
+ {
+ // Load JAF content handlers
+ ContentHandlerRegistry.register();
+ }
+
+ /**
+ * When XOP is disabled we need to convert java types to byte[]
+ * before handing off to XB.
+ */
+ public Object beforeMarshalling(Object object, MarshallingContext marshallingContext)
{
+
+ boolean mtomDisabled = !XOPContext.isMTOMEnabled();
+ boolean convertableType = object!=null && !(object instanceof byte[]);
+
+ if( mtomDisabled && convertableType )
+ {
+ String contentType = MimeUtils.resolveMimeType(object);
+ log.debug("Adopt " + object.getClass() + " to byte[], contentType
" + contentType);
+
+ DataHandler dh = new DataHandler(object, contentType);
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ try
+ {
+ IOUtils.copyStream(bout, dh.getInputStream());
+ object = bout.toByteArray();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to adopt XOP content type", e);
+ }
+ }
+
+ return object;
+ }
+
+ /**
+ * When XOP is disabled (inlined request) we receive a byte[] from XB
+ * that needs to be converted in to java type
+ */
+ public Object beforeSetParent(Object object, UnmarshallingContext ctx) {
+
+ if(null==object)
+ return object;
+
+ // may be null when it's actually an encoded request ?!
+ Class targetClass = ctx.resolvePropertyType();
+
+ boolean isRegularMessage = !XOPContext.isXOPMessage();
+ boolean isSimpleType = (object instanceof byte[]);
+ boolean doTypesMatch = (targetClass!=null &&
targetClass.equals(object.getClass()));
+
+ // Handle inlined requests.
+ // In this case XB treats binaries as simple types that are unmarshalled to byte[]
+ // Still type conversion will be necessary.
+ if( isRegularMessage && isSimpleType && !doTypesMatch)
+ {
+ String contentType = MimeUtils.resolveMimeType(targetClass);
+ log.debug("Adopt byte[] to " + targetClass +", contentType
"+ contentType);
+
+ try
+ {
+ DataHandler dh = new DataHandler(
+ wrapAsDataSource(object, contentType)
+ );
+
+ if(targetClass.equals(DataHandler.class))
+ object = dh;
+ else
+ object = dh.getContent();
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to adopt XOP content type", e);
+ }
+ }
+
+ // Handle XOP encoded requests.
+ // XB will use the XOPUnmarshaller callback and receive a DataHandler instance.
+ // In this case we are be able to instantiate the correct content object
+ // from the data handler, with the exception of content-type
'application/octet-stream'.
+ // These attachments will be returned as DataHandler instances.
+ else if(XOPContext.isXOPMessage() && (object instanceof DataHandler))
+ {
+ try
+ {
+ DataHandler attachmentHandle = (DataHandler)object;
+
if(!attachmentHandle.getContentType().equals("application/octet-stream"))
+ {
+ DataHandler dh = new DataHandler(attachmentHandle.getDataSource());
+ object = dh.getContent();
+ }
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Failed to adopt XOP content type", e);
+ }
+ }
+
+ return object;
+ }
+
+ private DataSource wrapAsDataSource(Object object, String contentType) throws
IOException {
+
+ DataSource ds;
+
+ if(object instanceof byte[])
+ {
+ ds = new SwapableMemoryDataSource(new ByteArrayInputStream((byte[])object),
contentType);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Failed to wrap as data source:
"+object.getClass());
+ }
+
+ return ds;
+ }
+
+ /**
+ * A factory method that registers the XB (un)marshalling adapters with schema
binding.
+ * These adapters convert java types into byte[] and reverse,
+ * in order to match the jaxrpc-mapping declaration in case we receive or send an
inlined request.
+ */
+ public static void register(SchemaBinding schemaBinding)
+ {
+ JBossXBContentAdapter contentAdapter = new JBossXBContentAdapter();
+
+ // base64 simple types
+ TypeBinding base64Type =
schemaBinding.getType(org.jboss.xb.binding.Constants.QNAME_BASE64BINARY);
+ base64Type.setBeforeMarshallingCallback( contentAdapter );
+ base64Type.setBeforeSetParentCallback( contentAdapter );
+
+ // xmime complex types
+ TypeBinding xmimeBase64Type = schemaBinding.getType(XMIME_BASE_64);
+ if(xmimeBase64Type!=null)
+ {
+ xmimeBase64Type.setBeforeMarshallingCallback( contentAdapter );
+ xmimeBase64Type.setBeforeSetParentCallback( contentAdapter );
+
+ // xop:Include
+ ModelGroupBinding modelGroup =
(ModelGroupBinding)xmimeBase64Type.getParticle().getTerm();
+ ParticleBinding particle =
(ParticleBinding)modelGroup.getParticles().iterator().next();
+ ElementBinding xopInclude = (ElementBinding)particle.getTerm();
+
+ if(! xopInclude.getQName().equals(XOP_INCLUDE))
+ throw new WSException("Looks like the JBossXB XOP implementation has
changed, please open a JIRA issue");
+
+ xopInclude.setBeforeMarshallingCallback(contentAdapter);
+ xopInclude.setBeforeSetParentCallback(contentAdapter);
+ }
+ }
+
+}
Property changes on:
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPContext.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -28,8 +28,9 @@
import org.jboss.ws.jaxrpc.StubExt;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.soap.NameImpl;
+import org.jboss.ws.soap.SOAPElementImpl;
import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.utils.JavaUtils;
import org.jboss.ws.utils.MimeUtils;
@@ -40,9 +41,9 @@
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPBody;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Iterator;
@@ -66,11 +67,12 @@
private static final Logger log = Logger.getLogger(XOPContext.class);
private static final String NS_XOP_JBOSSWS = "http://org.jboss.ws/xop";
-
+
/**
- * Check if the current soap message flagged as a XOP package?
+ * Check if the current soap message flagged as a XOP package.
+ * This may differ from the wire format when jaxrpc handlers are in place.
*/
- public static boolean isXOPPackage() {
+ public static boolean isXOPMessage() {
boolean isXOP = false;
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if(msgContext!=null) {
@@ -83,7 +85,7 @@
/**
* Check if the wire format is actually a xop encoded multipart message
*/
- public static boolean isMultipartXOP()
+ public static boolean isXOPEncodedRequest()
{
boolean isMultippartXOP = false;
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
@@ -94,7 +96,7 @@
{
for(String value : contentType)
{
- if(value.indexOf("application/xop+xml") != -1)
+ if(value.indexOf(MimeConstants.TYPE_APPLICATION_XOP_XML) != -1)
{
isMultippartXOP = true;
break;
@@ -180,7 +182,7 @@
{
try
{
- if(!isXOPPackage() && isMTOMEnabled())
+ if(!isXOPMessage() && isMTOMEnabled())
{
CommonMessageContext msgContext =
MessageContextAssociation.peekMessageContext();
SOAPBody body = msgContext.getSOAPMessage().getSOAPBody();
@@ -245,6 +247,8 @@
SOAPElement xopInclude =
xopElement.addChildElement(Constants.NAME_XOP_INCLUDE);
xopInclude.setAttribute("href", cid);
log.debug("Restored xop:Include element on
[xmlName="+xopElement.getLocalName()+"]");
+
+ XOPContext.setXOPMessage(true);
}
catch (SOAPException e)
{
@@ -303,8 +307,6 @@
// leave soap object model in a valid state
setXOPMessage(false);
- //log.warn("Further MTOM processing disabled. The XOP encoding will not be
restored.");
- //setMTOMEnabled(false);
}
/**
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -23,14 +23,11 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.soap.MessageContextAssociation;
-
import org.jboss.ws.soap.SOAPMessageImpl;
-import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.WSException;
+import org.jboss.ws.soap.attachment.MimeConstants;
import org.jboss.xb.binding.sunday.xop.XOPMarshaller;
import org.jboss.xb.binding.sunday.xop.XOPObject;
@@ -39,7 +36,7 @@
import javax.xml.soap.AttachmentPart;
/**
- * The XOPMarshallerImpl allows callbacks from the binding layer towards the
+ * The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
* soap processing components in order to optimize binary processing.
*
* @see org.jboss.ws.xop.XOPUnmarshallerImpl
@@ -60,7 +57,7 @@
public boolean isXOPPackage()
{
- return XOPContext.isXOPPackage();
+ return XOPContext.isXOPMessage();
}
public String addMtomAttachment(XOPObject obj, String elementNamespace, String
elementName)
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPScanner.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPScanner.java 2006-10-24
13:50:36 UTC (rev 1295)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPScanner.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -23,8 +23,8 @@
import org.apache.xerces.xs.*;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
/**
* Scans complex type definitions for nested XOP type declarations.
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
===================================================================
---
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -22,17 +22,18 @@
package org.jboss.ws.xop;
import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.soap.attachment.ContentHandlerRegistry;
import org.jboss.xb.binding.sunday.xop.XOPObject;
import org.jboss.xb.binding.sunday.xop.XOPUnmarshaller;
import javax.activation.DataHandler;
+import javax.xml.namespace.QName;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPException;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
/**
* The XOPUnmarshallerImpl allows callbacks from the binding layer towards the
@@ -47,6 +48,7 @@
public class XOPUnmarshallerImpl implements XOPUnmarshaller {
private static final Logger log = Logger.getLogger(XOPUnmarshallerImpl.class);
+ private static final QName XOP_INCLUDE = new QName(Constants.NS_XOP,
"Include");
static
{
@@ -56,41 +58,27 @@
public boolean isXOPPackage()
{
- return XOPContext.isXOPPackage();
+ return XOPContext.isXOPMessage();
}
public XOPObject getAttachmentAsDataHandler(String cid)
- {
+ {
try
{
AttachmentPart part = XOPContext.getAttachmentByCID(cid);
- Object content = part.getDataHandler().getContent();
+ DataHandler dataHandler = part.getDataHandler();
+ String contentType = dataHandler.getContentType();
- // TODO: XB should actually be able to process any content
- if(content instanceof InputStream)
- {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- part.getDataHandler().writeTo(bout);
- content = bout.toByteArray();
- }
- else
- {
- throw new WSException("Unsupported content type " + content);
- }
+ // Wrapping the DataHandler shields XB from the JAF dependency
+ XOPObject xopObject = new XOPObject(dataHandler);
+ xopObject.setContentType(contentType);
- XOPObject xopObject = new XOPObject(content);
- xopObject.setContentType(part.getDataHandler().getContentType());
-
return xopObject;
}
catch(SOAPException e)
{
throw new WSException("Failed to access attachment part", e);
}
- catch(IOException e)
- {
- throw new WSException("Failed to extract attachment data", e);
- }
}
public byte[] getAttachmentAsByteArray(String cid)
Modified: branches/jbossws-1.0/src/main/resources/schema/j2ee_1_4.xsd
===================================================================
--- branches/jbossws-1.0/src/main/resources/schema/j2ee_1_4.xsd 2006-10-24 13:50:36 UTC
(rev 1295)
+++ branches/jbossws-1.0/src/main/resources/schema/j2ee_1_4.xsd 2006-10-24 14:06:00 UTC
(rev 1296)
@@ -59,7 +59,7 @@
application client;
web application;
enterprise bean;
- resource adapter;
+ resource adapterJBoss;
Deployment File may indicate one of the following:
ear file;
Modified: branches/jbossws-1.0/src/main/resources/schema/javaee_5.xsd
===================================================================
--- branches/jbossws-1.0/src/main/resources/schema/javaee_5.xsd 2006-10-24 13:50:36 UTC
(rev 1295)
+++ branches/jbossws-1.0/src/main/resources/schema/javaee_5.xsd 2006-10-24 14:06:00 UTC
(rev 1296)
@@ -61,7 +61,7 @@
application client;
web application;
enterprise bean;
- resource adapter;
+ resource adapterJBoss;
Deployment File may indicate one of the following:
ear file;
Modified: branches/jbossws-1.0/src/test/ant/build-interop-jars.xml
===================================================================
--- branches/jbossws-1.0/src/test/ant/build-interop-jars.xml 2006-10-24 13:50:36 UTC (rev
1295)
+++ branches/jbossws-1.0/src/test/ant/build-interop-jars.xml 2006-10-24 14:06:00 UTC (rev
1296)
@@ -374,7 +374,6 @@
<include name="webservices.xml"/>
<include name="wsdl/**.*"/>
<include name="jboss-web.xml"/>
- <include name="jboss-wsse-server.xml"/>
</webinf>
<fileset
dir="${test.resources.dir}/interop/microsoft/mtom/utf8">
<include name="*.*"/>
Deleted:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/JBWS1303TestCase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1303;
-
-// $Id$
-
-import javax.naming.InitialContext;
-import javax.xml.rpc.Service;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-
-/**
- * Unmarshall issue with xsi:type specified bean property
- *
- *
http://jira.jboss.org/jira/browse/JBWS-1303
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2006
- */
-public class JBWS1303TestCase extends JBossWSTest
-{
- private static LastMod_PortType port;
-
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(JBWS1303TestCase.class,
"jaxrpc-jbws1303.war, jaxrpc-jbws1303-client.jar");
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (LastMod_PortType)service.getPort(LastMod_PortType.class);
- }
- }
-
- public void testEndpoint() throws Exception
- {
- Lastmod lastmod = new Lastmod("yesterday");
- LastmodResponse lastmodRes = port.lastmod(lastmod);
- assertEquals("yesterday", lastmodRes.getTimeChanged());
- }
-}
Deleted:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws1303/ServerHandler.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1303;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.handler.GenericHandler;
-import javax.xml.rpc.handler.MessageContext;
-import javax.xml.rpc.handler.soap.SOAPMessageContext;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.ws.Constants;
-
-public class ServerHandler extends GenericHandler
-{
- public QName[] getHeaders()
- {
- return new QName[] {};
- }
-
- /**
- * <env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
- *
xmlns:xsi='http://www.w3c.org/2001/XMLSchema-instance'
- &
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- * <env:Header/>
- * <env:Body>
- * <lastmodResponse xmlns='http://netid.msu.edu:8080/lastmod.pl'>
- * <TimeChanged xsi:type='xsd:string'>yesterday</TimeChanged>
- * </lastmodResponse>
- * </env:Body>
- * </env:Envelope>
- */
- public boolean handleResponse(MessageContext msgContext)
- {
- try
- {
- SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
- SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
- soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_XSD,
Constants.NS_SCHEMA_XSD);
- soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_XSI,
Constants.NS_SCHEMA_XSI);
- SOAPElement bodyElement =
soapMessage.getSOAPBody().addChildElement("lastmodResponse");
- bodyElement.setAttribute("xmlns",
"http://netid.msu.edu:8080/lastmod.pl");
- SOAPElement soapElement = bodyElement.addChildElement("TimeChanged");
- soapElement.setAttribute("xsi:type", "xsd:string");
- soapElement.setValue("yesterday");
- ((SOAPMessageContext)msgContext).setMessage(soapMessage);
- }
- catch (Exception ex)
- {
- throw new RuntimeException(ex);
- }
- return true;
- }
-}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/marshall/MarshallDocLitTestCase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -28,11 +28,13 @@
import javax.naming.InitialContext;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.test.ws.jaxrpc.marshall.types.JavaBean;
+import org.jboss.ws.jaxrpc.StubExt;
/**
* Test standard JAX-RPC types.
@@ -60,7 +62,7 @@
InitialContext iniCtx = getInitialContext();
Service service =
(Service)iniCtx.lookup("java:comp/env/service/StandardTypes");
port = (StandardTypes)service.getPort(StandardTypes.class);
- }
+ }
}
public BigDecimal bigDecimalTest(BigDecimal param) throws Exception
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxrpc.samples.mtom;
import java.io.File;
+import java.io.FileInputStream;
import java.net.URL;
import javax.activation.DataHandler;
@@ -30,6 +31,8 @@
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.Stub;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
import junit.framework.Test;
@@ -83,11 +86,8 @@
//((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" +
getServerHost() + ":8081/jaxrpc-samples-mtom");
}
- /**
- * Send a byte[] XOP encoded.
- *
- */
- public void testSimpleBinary() throws Exception
+
+ /*public void testSimpleBinary() throws Exception
{
DataHandler dh = new DataHandler(
new
FileDataSource("resources/jaxrpc/samples/mtom/disguised_jpeg.xcf")
@@ -98,9 +98,6 @@
assertTrue("Content length is different", bytesIn.length ==
bytesOut.length);
}
- /**
- * Send a inlined message and expect a xop encoded response.
- */
public void testMTOMDisabledClientside() throws Exception
{
URL url = new File("resources/jaxrpc/samples/mtom/attach.jpeg").toURL();
@@ -116,34 +113,22 @@
assertEquals(bytesIn, bytesOut);
}
- /**
- * Send a multipart message with a 'image/jpeg' attachment part.
- * Uses a DataHandler as endpoint parameter and return type.
- */
- /*public void testAbstractParameterTypes() throws Exception
+ public void testAbstractParameterTypes() throws Exception
{
URL url = new File("resources/jaxrpc/samples/mtom/attach.jpeg").toURL();
DataHandler value = port.sendMimeImageJPEG("Some text message", new
DataHandler(url));
assertNotNull(value);
assertTrue("Wrong return content-type returned",
value.getContentType().equals("image/jpeg"));
- } */
+ }*/
- /**
- * Send a multipart message with a 'text/plain' attachment part.
- * Uses java.lang.String as endpoint parameter and return type.
- */
- /*public void testConcreteParameterTypes() throws Exception
+ public void testConcreteParameterTypes() throws Exception
{
String xoppart = "This is a plain text attachment.";
String value = port.sendMimeTextPlain("Some text message", xoppart);
assertNotNull(value);
assertEquals("Value mismatch", value, xoppart);
- } */
+ }
- /**
- * Send a multipart message with a 'text/xml' attachment part.
- * Uses a DataHandler as endpoint parameter, but javax.xml.transform.Source as return
value.
- */
/*public void testParameterConversion() throws Exception
{
FileInputStream stream = new
FileInputStream("resources/jaxrpc/samples/mtom/attach.xml");
@@ -152,13 +137,8 @@
Source value = port.sendMimeTextXML("Some text message", new
DataHandler(source, "text/xml"));
assertNotNull(value);
assertTrue("Wrong return value type", value instanceof Source);
- } */
+ }
- /**
- * Send a multipart message with a application/xml attachment part.
- * Uses a javax.xml.transform.Source as endpoint parameter, but
javax.activation.DataHandler as return value.
- */
- /*
public void testParameterConversionReverse() throws Exception
{
FileInputStream stream = new
FileInputStream("resources/jaxrpc/samples/mtom/attach.xml");
@@ -167,5 +147,5 @@
DataHandler value = port.sendMimeApplicationXML("Some text message",
source);
assertNotNull(value);
assertTrue("Wrong return value content-type",
value.getContentType().equals("application/xml"));
- } */
+ }*/
}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -21,10 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.xop;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.FileInputStream;
+import javax.xml.transform.stream.StreamSource;
+import javax.activation.DataHandler;
+import java.io.*;
+import java.awt.*;
+import java.net.URL;
+import java.net.MalformedURLException;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -49,4 +51,40 @@
is.close();
return bytes;
}
+
+ public static Image createTestImage()
+ {
+ Image image = null;
+ try
+ {
+ URL url = new
File("resources/jaxrpc/xop/shared/attach.jpeg").toURL();
+
+ image = null;
+ try
+ {
+ image = Toolkit.getDefaultToolkit().createImage(url);
+ }
+ catch (Throwable th)
+ {
+ //log.warn("Cannot create Image: " + th);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ return image;
+ }
+
+ public static StreamSource createTestSource()
+ {
+ return new StreamSource( new
ByteArrayInputStream("<some><nestedXml/></some>".getBytes()));
+ }
+
+ public static DataHandler createDataHandler()
+ {
+ DataHandler dataHandler = new
DataHandler("<more><nestedXML/></more>",
"application/octet-stream");
+ return dataHandler;
+ }
}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -65,6 +65,7 @@
WSSchemaUtils wsUtil = WSSchemaUtils.getInstance(new NamespaceRegistry(),
"http://jboss.org/test/ws/xop/doclit");
JBossXSModel schemaModel = wsUtil.getJBossXSModel(xsModel);
+ // test custom binary declaration
XSTypeDefinition xsType = schemaModel.getTypeDefinition(">PingMsg",
"http://jboss.org/test/ws/xop/doclit");
assertNotNull("Root type def not found", xsType);
@@ -79,6 +80,7 @@
scanner.reset();
+ // test the xmime binary declaration
xsType = schemaModel.getTypeDefinition(">PingMsgResponse",
"http://jboss.org/test/ws/xop/doclit");
assertNotNull("Root type def not found", xsType);
if (xsType instanceof XSComplexTypeDefinition)
@@ -92,12 +94,6 @@
public void testMSFTElementScan() throws Exception
{
- if (true)
- {
- System.out.println("FIXME: JBWS-1293");
- return;
- }
-
SchemaUtils utils = SchemaUtils.getInstance();
File f = new File("resources/jaxrpc/xop/schema.xsd");
assertTrue("Unable to load schema file " + f.getAbsolutePath(),
f.exists());
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -1,19 +1,12 @@
package org.jboss.test.ws.jaxrpc.xop.doclit;
-import org.jboss.ws.soap.MessageContextAssociation;
-import org.jboss.ws.common.CommonMessageContext;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.test.ws.jaxrpc.xop.shared.MTOMServiceBase;
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
import java.rmi.RemoteException;
-import java.util.StringTokenizer;
/**
* MTOM test service impl.
- * The 'message' param value determines wether or not the response
- * should be XOP encoded or not.
+ * The 'message' param value determines wether or not the response should be XOP
encoded.
*
* @author Heiko Braun, <heiko(a)openj.net>
* @since 11-Apr-2006
@@ -21,9 +14,22 @@
public class TestServiceImpl extends MTOMServiceBase implements TestService_PortType {
public PingMsgResponse ping(PingMsg pingMsg) throws RemoteException {
-
toggleXOP(pingMsg.getMessage());
return new PingMsgResponse(pingMsg.getXopContent());
-
}
+
+ public PingImageResponse pingImage(PingImage pingImage) throws RemoteException {
+ toggleXOP(pingImage.getMessage());
+ return new PingImageResponse(pingImage.getXopContent());
+ }
+
+ public PingSourceResponse pingSource(PingSource pingSource) throws RemoteException {
+ toggleXOP(pingSource.getMessage());
+ return new PingSourceResponse(pingSource.getXopContent());
+ }
+
+ public PingDataHandlerResponse pingDataHandler(PingDataHandler pingDataHandler) throws
RemoteException {
+ toggleXOP(pingDataHandler.getMessage());
+ return new PingDataHandlerResponse(pingDataHandler.getXopContent());
+ }
}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -5,7 +5,13 @@
//Auto Generated by jbossws - Please do not edit!!!
package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
+
public interface TestService_PortType extends java.rmi.Remote
{
- public org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse
ping(org.jboss.test.ws.jaxrpc.xop.shared.PingMsg pingMsg) throws
java.rmi.RemoteException;
+ public PingMsgResponse ping(PingMsg pingMsg) throws java.rmi.RemoteException;
+ public PingImageResponse pingImage(PingImage pingImage) throws
java.rmi.RemoteException;
+ public PingSourceResponse pingSource(PingSource pingSource) throws
java.rmi.RemoteException;
+ public PingDataHandlerResponse pingDataHandler(PingDataHandler pingDataHandler) throws
java.rmi.RemoteException;
}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -22,15 +22,16 @@
package org.jboss.test.ws.jaxrpc.xop.doclit;
import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
+import org.jboss.ws.jaxrpc.StubExt;
import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.jaxrpc.StubExt;
import javax.activation.DataHandler;
import javax.xml.rpc.Stub;
+import javax.xml.transform.Source;
import java.io.File;
+import java.awt.*;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -41,6 +42,7 @@
protected TestService_PortType port;
+ /*
public void testRequestResponseOptimized() throws Exception {
DataHandler dh = new DataHandler("Another plain text attachment",
"text/plain");
@@ -52,6 +54,7 @@
assertEquals("Content length doesn't match", bytesIn.length,
bytesOut.length);
}
+
public void testResponseOptimized() throws Exception {
byte[] bytesIn = XOPTestSupport.getBytesFromFile(new
File("resources/jaxrpc/samples/mtom/attach.jpeg"));
@@ -78,5 +81,100 @@
byte[] bytesOut = value.getXopContent();
assertNotNull("Return xopContent was null", bytesOut);
assertEquals("Content length doesn't match", bytesIn.length,
bytesOut.length);
+ } */
+
+ // ---------------------------------------------------------------------------------
+ // Test the before and after marshalling handlers
+
+ public void testImageResponseOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ // disable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingImage pingImage = new PingImage("0|1", image);
+ PingImageResponse response = port.pingImage(pingImage);
+ assertNotNull("Return xopContent was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
}
+
+ public void testImageRequestOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ // enable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingImage pingImage = new PingImage("1|0", image);
+ PingImageResponse response = port.pingImage(pingImage);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+
+ }
+
+ public void testSourceResponseOptimized() throws Exception {
+
+ Source source = XOPTestSupport.createTestSource();
+
+ // disable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("0|1");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = port.pingSource(pingSource);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+
+ }
+
+ public void testSourceRequestOptimized() throws Exception {
+
+ Source source = XOPTestSupport.createTestSource();
+
+ // enable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("1|0");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = port.pingSource(pingSource);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
+
+ public void testDHResponseOptimized() throws Exception {
+
+ DataHandler dh = XOPTestSupport.createDataHandler();
+
+ // disable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("0|1");
+
+ PingDataHandlerResponse response = port.pingDataHandler(reqest);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+
+ }
+
+ public void testDHRequestOptimized() throws Exception {
+
+ DataHandler dh = XOPTestSupport.createDataHandler();
+
+ // enable MTOM
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("1|0");
+
+ PingDataHandlerResponse response = port.pingDataHandler(reqest);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
}
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -42,7 +42,7 @@
protected TestService_PortType port;
- public void testRequestResponseOptimized() throws Exception {
+ /*public void testRequestResponseOptimized() throws Exception {
DataHandler dh = new DataHandler("Another plain text attachment",
"text/plain");
byte[] bytesIn = IOUtils.convertToBytes(dh);
@@ -62,7 +62,7 @@
byte[] bytesIn = XOPTestSupport.getBytesFromFile(new
File("resources/jaxrpc/samples/mtom/attach.jpeg"));
requestComplex(new PingMsg("1|0", bytesIn));
- }
+ }*/
private void requestComplex(PingMsg payload) throws Exception
{
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -24,6 +24,7 @@
import org.jboss.ws.common.CommonMessageContext;
import org.jboss.ws.soap.MessageContextAssociation;
import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.xop.XOPContext;
import java.util.StringTokenizer;
@@ -39,6 +40,11 @@
String responseOptimized = tok.nextToken();
System.out.println(requestOptimized+"|"+responseOptimized);
+ if(requestOptimized.equals("1") &&
!XOPContext.isXOPEncodedRequest())
+ {
+ throw new RuntimeException("Illegal state: No XOP encoded request
found");
+ }
+
if(responseOptimized.equals("0"))
{
CommonMessageContext ctx = MessageContextAssociation.peekMessageContext();
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import javax.activation.DataHandler;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 23, 2006
+ */
+public class PingDataHandler {
+ String message;
+ DataHandler xopContent;
+
+ public PingDataHandler() {
+ }
+
+ public PingDataHandler(DataHandler dataHandler) {
+ this.xopContent = dataHandler;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public DataHandler getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(DataHandler xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import javax.activation.DataHandler;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 23, 2006
+ */
+public class PingDataHandlerResponse {
+ DataHandler xopContent;
+
+ public PingDataHandlerResponse() {
+ }
+
+ public PingDataHandlerResponse(DataHandler dataHandler) {
+ this.xopContent = dataHandler;
+ }
+
+ public DataHandler getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(DataHandler xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import java.awt.*;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 17, 2006
+ */
+public class PingImage {
+
+ String message;
+ Image xopContent;
+
+ public PingImage() {
+ }
+
+ public PingImage(String message, Image xopContent) {
+ this.message = message;
+ this.xopContent = xopContent;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public Image getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(Image xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import java.awt.*;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 17, 2006
+ */
+public class PingImageResponse {
+
+ Image xopContent;
+
+ public PingImageResponse() {
+ }
+
+ public PingImageResponse(Image xopContent) {
+ this.xopContent = xopContent;
+ }
+
+ public Image getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(Image xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import javax.xml.transform.Source;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 19, 2006
+ */
+public class PingSource {
+ String message;
+ Source xopContent;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public Source getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(Source xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java 2006-10-24
14:06:00 UTC (rev 1296)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.test.ws.jaxrpc.xop.shared;
+
+import javax.xml.transform.Source;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id$
+ * @since Oct 19, 2006
+ */
+public class PingSourceResponse {
+
+ Source xopContent;
+
+ public PingSourceResponse() {
+ }
+
+ public PingSourceResponse(Source source) {
+ this.xopContent = source;
+ }
+
+ public Source getXopContent() {
+ return xopContent;
+ }
+
+ public void setXopContent(Source xopContent) {
+ this.xopContent = xopContent;
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/META-INF/jboss-client.xml
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/META-INF/jboss-client.xml 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/META-INF/jboss-client.xml 2006-10-24
14:06:00 UTC (rev 1296)
@@ -9,6 +9,7 @@
<service-ref>
<service-ref-name>service/TestService</service-ref-name>
+ <config-name>Standard MTOM disabled client</config-name>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-encoded-marshalltest/MarshallTest?wsdl</wsdl-override>
</service-ref>
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/WEB-INF/web.xml
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/WEB-INF/web.xml 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/encoded/marshalltest/WEB-INF/web.xml 2006-10-24
14:06:00 UTC (rev 1296)
@@ -2,7 +2,12 @@
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
-
+
+ <context-param>
+ <param-name>jbossws-config-name</param-name>
+ <param-value>Standard MTOM disabled endpoint</param-value>
+ </context-param>
+
<servlet>
<servlet-name>MarshallTest</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.encoded.marshalltest.MarshallTestImpl</servlet-class>
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/ConfidentialService.wsdl
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/ConfidentialService.wsdl 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/ConfidentialService.wsdl 2006-10-24
14:06:00 UTC (rev 1296)
@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions name='ConfidentialService'
targetNamespace='http://org.jboss.test.ws/jbws1190'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws/jbws1190'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types/>
- <message name='ConfidentialEndpoint_helloWorld'>
- <part name='String_1' type='xsd:string'/>
- </message>
- <message name='ConfidentialEndpoint_helloWorldResponse'>
- <part name='result' type='xsd:string'/>
- </message>
- <portType name='ConfidentialEndpoint'>
- <operation name='helloWorld' parameterOrder='String_1'>
- <input message='tns:ConfidentialEndpoint_helloWorld'/>
- <output message='tns:ConfidentialEndpoint_helloWorldResponse'/>
- </operation>
- </portType>
- <binding name='ConfidentialEndpointBinding'
type='tns:ConfidentialEndpoint'>
- <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='helloWorld'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
- </input>
- <output>
- <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='ConfidentialService'>
- <port binding='tns:ConfidentialEndpointBinding'
name='ConfidentialEndpointPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
+ <types/>
+ <message name='ConfidentialEndpoint_helloWorld'>
+ <part name='String_1' type='xsd:string'/>
+ </message>
+ <message name='ConfidentialEndpoint_helloWorldResponse'>
+ <part name='result' type='xsd:string'/>
+ </message>
+ <portType name='ConfidentialEndpoint'>
+ <operation name='helloWorld' parameterOrder='String_1'>
+ <input message='tns:ConfidentialEndpoint_helloWorld'/>
+ <output message='tns:ConfidentialEndpoint_helloWorldResponse'/>
+ </operation>
+ </portType>
+ <binding name='ConfidentialEndpointBinding'
type='tns:ConfidentialEndpoint'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='helloWorld'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='ConfidentialService'>
+ <port binding='tns:ConfidentialEndpointBinding'
name='ConfidentialEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
</definitions>
\ No newline at end of file
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/TestService.wsdl
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/TestService.wsdl 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws1190/WEB-INF/wsdl/TestService.wsdl 2006-10-24
14:06:00 UTC (rev 1296)
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions name='TestService'
targetNamespace='http://org.jboss.test.ws/jbws1190'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.test.ws/jbws1190'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types/>
- <message name='TestEndpoint_testAddress'>
- <part name='String_1' type='xsd:string'/>
- <part name='String_2' type='xsd:string'/>
- <part name='String_3' type='xsd:string'/>
- <part name='String_4' type='xsd:string'/>
- </message>
- <message name='TestEndpoint_testAddressResponse'/>
- <portType name='TestEndpoint'>
- <operation name='testAddress' parameterOrder='String_1 String_2 String_3
String_4'>
- <input message='tns:TestEndpoint_testAddress'/>
- <output message='tns:TestEndpoint_testAddressResponse'/>
- </operation>
- </portType>
- <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
- <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='testAddress'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
- </input>
- <output>
- <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='TestService'>
- <port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
+ <types/>
+ <message name='TestEndpoint_testAddress'>
+ <part name='String_1' type='xsd:string'/>
+ <part name='String_2' type='xsd:string'/>
+ <part name='String_3' type='xsd:string'/>
+ <part name='String_4' type='xsd:string'/>
+ </message>
+ <message name='TestEndpoint_testAddressResponse'/>
+ <portType name='TestEndpoint'>
+ <operation name='testAddress' parameterOrder='String_1 String_2
String_3 String_4'>
+ <input message='tns:TestEndpoint_testAddress'/>
+ <output message='tns:TestEndpoint_testAddressResponse'/>
+ </operation>
+ </portType>
+ <binding name='TestEndpointBinding' type='tns:TestEndpoint'>
+ <soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='testAddress'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1190'
use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='TestService'>
+ <port binding='tns:TestEndpointBinding'
name='TestEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
</definitions>
\ No newline at end of file
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/META-INF/jboss-client.xml
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/META-INF/jboss-client.xml 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/META-INF/jboss-client.xml 2006-10-24
14:06:00 UTC (rev 1296)
@@ -9,6 +9,7 @@
<service-ref>
<service-ref-name>service/StandardTypes</service-ref-name>
+ <config-name>Standard MTOM disabled client</config-name>
<wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-marshall-doclit?wsdl</wsdl-override>
</service-ref>
Modified: branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml 2006-10-24
14:06:00 UTC (rev 1296)
@@ -5,6 +5,11 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
+ <context-param>
+ <param-name>jbossws-config-name</param-name>
+ <param-value>Standard MTOM disabled endpoint</param-value>
+ </context-param>
+
<servlet>
<servlet-name>StandardTypes</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.marshall.StandardTypesBean</servlet-class>
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml 2006-10-24
14:06:00 UTC (rev 1296)
@@ -3,7 +3,7 @@
<package-type>org.jboss.test.ws.jaxrpc.xop.doclit</package-type>
<
namespaceURI>http://jboss.org/test/ws/xop/doclit</namespaceURI>
</package-mapping>
-
+
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsg</java-type>
<anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
@@ -28,6 +28,78 @@
</variable-mapping>
</java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingImage</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>message</java-variable-name>
+ <xml-element-name>message</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingImageResponse</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingSource</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>message</java-variable-name>
+ <xml-element-name>message</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingSourceResponse</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingDataHandler</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>message</java-variable-name>
+ <xml-element-name>message</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
+ <java-xml-type-mapping>
+
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingDataHandlerResponse</java-type>
+ <anonymous-type-qname
xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:&...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>xopContent</java-variable-name>
+ <xml-element-name>xopContent</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_Service</service-interface>
<wsdl-service-name
xmlns:serviceNS='http://jboss.org/test/ws/xop/doclit'>serviceN...
@@ -41,6 +113,7 @@
<service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType</service-endpoint-interface>
<wsdl-port-type
xmlns:portTypeNS='http://jboss.org/test/ws/xop/doclit'>portTyp...
<wsdl-binding
xmlns:bindingNS='http://jboss.org/test/ws/xop/doclit'>bindingN...
+
<service-endpoint-method-mapping>
<java-method-name>ping</java-method-name>
<wsdl-operation>ping</wsdl-operation>
@@ -59,5 +132,63 @@
<wsdl-message-part-name>parameters</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
+
+ <service-endpoint-method-mapping>
+ <java-method-name>pingImage</java-method-name>
+ <wsdl-operation>pingImage</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+
<param-type>org.jboss.test.ws.jaxrpc.xop.shared.PingImage</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+
<method-return-value>org.jboss.test.ws.jaxrpc.xop.shared.PingImageResponse</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+
+ <service-endpoint-method-mapping>
+ <java-method-name>pingSource</java-method-name>
+ <wsdl-operation>pingSource</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+
<param-type>org.jboss.test.ws.jaxrpc.xop.shared.PingSource</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+
<method-return-value>org.jboss.test.ws.jaxrpc.xop.shared.PingSourceResponse</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+
+ <service-endpoint-method-mapping>
+ <java-method-name>pingDataHandler</java-method-name>
+ <wsdl-operation>pingDataHandler</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+
<param-type>org.jboss.test.ws.jaxrpc.xop.shared.PingDataHandler</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+
<method-return-value>org.jboss.test.ws.jaxrpc.xop.shared.PingDataHandlerResponse</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgN...
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+
</service-endpoint-interface-mapping>
</java-wsdl-mapping>
\ No newline at end of file
Modified:
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
---
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl 2006-10-24
13:50:36 UTC (rev 1295)
+++
branches/jbossws-1.0/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl 2006-10-24
14:06:00 UTC (rev 1296)
@@ -16,6 +16,10 @@
<import
namespace="http://www.w3.org/2005/05/xmlmime"/>
+ <!--
+ the xmime:expectedContentType is missing.
+ this maps to byte[]
+ -->
<s:element name="PingMsg">
<s:complexType>
<s:sequence>
@@ -24,14 +28,94 @@
</s:sequence>
</s:complexType>
</s:element>
+
+ <!--
+ a known media type maps to specific java type.
+ in this case a byte[] as well
+ -->
<s:element name="PingMsgResponse">
<s:complexType>
<s:sequence>
- <s:element name="xopContent" minOccurs="0"
maxOccurs="1" xmime:expectedContentTypes="text/plain"
type="xmime:base64Binary"/>
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+
xmime:expectedContentTypes="application/octet-stream"
+ type="xmime:base64Binary"/>
</s:sequence>
</s:complexType>
</s:element>
+ <!--
+ a known media type that maps to java.awt.Image
+ -->
+ <s:element name="PingImage">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="message" minOccurs="0"
maxOccurs="1" type="s:string" />
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+ xmime:expectedContentTypes="image/jpeg"
+ type="xmime:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
+ <s:element name="PingImageResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+ xmime:expectedContentTypes="image/jpeg"
+ type="xmime:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
+ <!--
+ a preferred media type specified through xmime:contentType.
+ this would map to javax.transform.Source
+ -->
+ <s:element name="PingSource">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="message" minOccurs="0"
maxOccurs="1" type="s:string" />
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+ xmime:expectedContentTypes="image/jpeg,text/xml"
+ xmime:contentType="text/xml"
+ type="xmime:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
+ <s:element name="PingSourceResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+ xmime:expectedContentTypes="text/xml"
+ type="xmime:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
+ <!--
+ the preferred media type is not declared
+ binaries will be mapped to javax.activation.DataHandler
+ -->
+ <s:element name="PingDataHandler">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="message" minOccurs="0"
maxOccurs="1" type="s:string" />
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1"
+ xmime:expectedContentTypes="image/jpeg,text/xml"
+ type="xmime:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
+ <s:element name="PingDataHandlerResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element name="xopContent" minOccurs="0"
maxOccurs="1" type="s:base64Binary"/>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+
</s:schema>
</types>
@@ -42,11 +126,44 @@
<part name="parameters" element="s0:PingMsgResponse" />
</message>
+ <message name="PingImageIn">
+ <part name="parameters" element="s0:PingImage" />
+ </message>
+ <message name="PingImageOut">
+ <part name="parameters" element="s0:PingImageResponse"
/>
+ </message>
+
+ <message name="PingSourceIn">
+ <part name="parameters" element="s0:PingSource" />
+ </message>
+ <message name="PingSourceOut">
+ <part name="parameters" element="s0:PingSourceResponse"
/>
+ </message>
+
+ <message name="PingDataHandlerIn">
+ <part name="parameters" element="s0:PingDataHandler" />
+ </message>
+ <message name="PingDataHandlerOut">
+ <part name="parameters" element="s0:PingDataHandlerResponse"
/>
+ </message>
+
<portType name="TestService">
<operation name="ping">
<input message="s0:PingIn" />
<output message="s0:PingOut" />
</operation>
+ <operation name="pingImage">
+ <input message="s0:PingImageIn" />
+ <output message="s0:PingImageOut" />
+ </operation>
+ <operation name="pingSource">
+ <input message="s0:PingSourceIn" />
+ <output message="s0:PingSourceOut" />
+ </operation>
+ <operation name="pingDataHandler">
+ <input message="s0:PingDataHandlerIn" />
+ <output message="s0:PingDataHandlerOut" />
+ </operation>
</portType>
<binding name="TestServiceBinding" type="s0:TestService">
@@ -60,6 +177,33 @@
<soap:body use="literal" />
</output>
</operation>
+ <operation name="pingImage">
+ <soap:operation
soapAction="http://jboss.org/test/ws/xop/doclit/PingImage"
style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="pingSource">
+ <soap:operation
soapAction="http://jboss.org/test/ws/xop/doclit/PingSource"
style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ <operation name="pingDataHandler">
+ <soap:operation
soapAction="http://jboss.org/test/ws/xop/doclit/PingDataHandler"
style="document" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
</binding>
<service name="TestService">
Modified: branches/jbossws-1.0/src/test/resources/jaxrpc/xop/schema.xsd
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxrpc/xop/schema.xsd 2006-10-24 13:50:36 UTC
(rev 1295)
+++ branches/jbossws-1.0/src/test/resources/jaxrpc/xop/schema.xsd 2006-10-24 14:06:00 UTC
(rev 1296)
@@ -9,7 +9,7 @@
<s:complexType>
<s:sequence>
<s:element name="message" minOccurs="0"
maxOccurs="1" type="s:string" />
- <s:element name="imagejpeg"
xmime:contentType="image/jpeg" type="tns:XOPBinary"/>
+ <s:element name="xopContent"
xmime:contentType="image/jpeg" type="tns:XOPBinary"/>
</s:sequence>
</s:complexType>
</s:element>
@@ -17,7 +17,7 @@
<s:element name="PingMsgResponse">
<s:complexType>
<s:sequence>
- <s:element name="imagejpeg"
xmime:contentType="image/jpeg" type="xmime:base64Binary"/>
+ <s:element name="xopContent"
xmime:contentType="image/jpeg" type="xmime:base64Binary"/>
</s:sequence>
</s:complexType>
</s:element>
@@ -33,7 +33,7 @@
<s:element name="MSFTBinary">
<s:complexType>
<s:sequence>
- <s:element minOccurs="0" name="array"
nillable="true" type="s:base64Binary"/>
+ <s:element minOccurs="0" name="xopContent"
nillable="true" type="s:base64Binary"/>
</s:sequence>
</s:complexType>
</s:element>