JBossWS SVN: r1529 - in trunk: . src/main/java/org/jboss/ws/common src/main/java/org/jboss/ws/jaxrpc/encoding src/main/java/org/jboss/ws/jbossxb src/main/java/org/jboss/ws/metadata src/main/java/org/jboss/ws/server src/main/java/org/jboss/ws/soap src/main/java/org/jboss/ws/soap/attachment src/main/java/org/jboss/ws/xop src/test/ant src/test/java/org/jboss/test/ws src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom src/test/java/org/jboss/test/ws/jaxrpc/xop src/test/java/org/jboss/test/ws/j
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-01 10:44:10 -0500 (Fri, 01 Dec 2006)
New Revision: 1529
Added:
trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java
trunk/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Employee.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecords.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/HRService.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Query.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Status.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPing.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingService.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPing.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingService.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java
trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/EmployeeService.wsdl
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/service-doclit.wsdl
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/wsdl0.wsdl
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/xsd0.xsd
trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/service-rpclit.wsdl
Removed:
trunk/.settings/
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTest.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTestImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_Service.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestServiceImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_PortType.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_Service.java
trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl
trunk/src/test/resources/jaxrpc/samples/mtom/attach.gif
trunk/src/test/resources/jaxrpc/samples/mtom/attach.html
trunk/src/test/resources/jaxrpc/samples/mtom/attach.jpeg
trunk/src/test/resources/jaxrpc/samples/mtom/attach.txt
trunk/src/test/resources/jaxrpc/samples/mtom/attach.xml
trunk/src/test/resources/jaxrpc/samples/mtom/disguised_jpeg.xcf
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl
trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/TestService.wsdl
Modified:
trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java
trunk/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java
trunk/src/main/java/org/jboss/ws/xop/XOPContext.java
trunk/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
trunk/src/main/java/org/jboss/ws/xop/XOPScanner.java
trunk/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
trunk/src/test/ant/build-jars-jaxrpc.xml
trunk/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPHandlerTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml
trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/jboss-client.xml
trunk/src/test/resources/jaxrpc/samples/mtom/WEB-INF/web.xml
trunk/src/test/resources/jaxrpc/samples/mtom/wstools-config.xml
trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/jboss-client.xml
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/web.xml
trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/jboss-client.xml
trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/jboss-client.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/jaxrpc-mapping.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/application-client.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/jboss-client.xml
trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/WEB-INF/webservices.xml
trunk/src/test/resources/jaxrpc/xop/schema.xsd
Log:
merged MTOM codebase from branch 1.x
Modified: trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/common/CommonSOAPBinding.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -787,7 +787,7 @@
// When a potential xop parameter is detected and MTOM is enabled
// we flag the SOAP message as a XOP package
- if (paramMetaData.isXOP() && XOPContext.isMTOMEnabled())
+ if (paramMetaData.isXOP() && XOPContext.isMTOMEnabled())
{
log.trace("Add parameter as XOP");
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
@@ -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: trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Deserializer.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -56,7 +56,7 @@
byte[] value = null;
String valueStr = unwrapValueStr(xmlFragment);
- if(XOPContext.isXOPPackage())
+ if(XOPContext.isXOPMessage())
{
try
{
Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/jaxrpc/encoding/Base64Serializer.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBSupport.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/jbossxb/JBossXBUnmarshallerImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -23,14 +23,13 @@
// $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 +52,9 @@
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: trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/jbossxb/SchemaBindingBuilder.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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;
@@ -80,6 +81,9 @@
bindSchemaToJava(schemaBinding, wsdlMapping);
}
+ // setup MTOM handler
+ JBossXBContentAdapter.register(schemaBinding);
+
return schemaBinding;
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -438,7 +438,7 @@
out++;
if (in > 1 || out > (oneWay ? 0 : 1))
- throw new WSException("The body of a documnet/literal bare message requires at most 1 input and at most 1 output (or 0 if oneway). method: " + javaName + " in: "
+ throw new WSException("The body of a document/literal bare message requires at most 1 input and at most 1 output (or 0 if oneway). method: " + javaName + " in: "
+ in + " out: " + out);
}
}
Modified: trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -38,6 +38,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
+import org.jboss.ws.xop.XOPContext;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.common.CommonBindingProvider;
import org.jboss.ws.common.CommonMessageContext;
@@ -260,6 +261,7 @@
// Set the outbound headers
if (headerSource != null)
{
+ XOPContext.eagerlyCreateAttachments();
resMessage.saveChanges();
headerSource.setMimeHeaders(resMessage.getMimeHeaders());
}
Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -47,6 +47,7 @@
import org.jboss.ws.binding.soap.SOAPMessageMarshaller;
import org.jboss.ws.binding.soap.SOAPMessageUnMarshaller;
import org.jboss.ws.jaxrpc.StubExt;
+import org.jboss.ws.xop.XOPContext;
/**
* SOAPConnection implementation
@@ -151,6 +152,13 @@
callProps = null;
}
+ // enforce xop transitions
+ // TODO: there should be a clear transition to an immutable object model
+ XOPContext.eagerlyCreateAttachments();
+
+ // save object model changes
+ if (reqMessage.saveRequired()) reqMessage.saveChanges();
+
try
{
// Get the invoker from Remoting for a given endpoint address
@@ -263,9 +271,6 @@
mimeHeaders.setHeader("SOAPAction", "\"\"");
}
- if (reqMessage.saveRequired())
- reqMessage.saveChanges();
-
Map<String, Object> metadata = new HashMap<String, Object>();
// We need to unmarshall faults (HTTP 500)
Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/soap/SOAPContentElement.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -23,21 +23,10 @@
// $Id$
-import java.io.IOException;
-import java.io.Writer;
-import java.lang.reflect.Array;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.binding.BindingException;
import org.jboss.ws.binding.DeserializerSupport;
import org.jboss.ws.binding.SerializationContext;
@@ -52,15 +41,24 @@
import org.jboss.ws.utils.DOMUtils;
import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.utils.JavaUtils;
+import org.jboss.ws.utils.MimeUtils;
import org.jboss.ws.xop.XOPContext;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.TypeInfo;
+import org.w3c.dom.*;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import java.io.IOException;
+import java.io.Writer;
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
+import java.util.Iterator;
+
/**
* A SOAPElement that gives access to its content as XML fragment or Java object.
*
@@ -287,27 +285,32 @@
if (isAssignable == false)
{
- Object convertedObj = null;
+ // handle XOP simple types, i.e. in RPC/LIT
+ try
+ {
+ String contentType = MimeUtils.resolveMimeType(javaType);
+ log.debug("Adopt DataHandler to " + javaType +", contentType "+ contentType);
- if (obj instanceof DataHandler)
- {
- try
+ DataSource ds = new SwapableMemoryDataSource(((DataHandler)obj).getInputStream(), contentType);
+ DataHandler dh = new DataHandler(ds);
+ obj = dh.getContent();
+
+ // 'application/octet-stream' will return a byte[] instead fo the stream
+ if(obj instanceof InputStream)
{
- convertedObj = ((DataHandler)obj).getContent();
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
+ obj = bout.toByteArray();
}
- catch (IOException e)
- {
- throw new WSException("Failed to convert unassignable endpoint parameter", e);
- }
}
-
- if (null == convertedObj || !JavaUtils.isAssignableFrom(javaType, convertedObj.getClass())) // conversion failed
+ catch (IOException e)
{
- throw new WSException("Java type '" + javaType + "' is not assignable from: " + objType.getName());
+ throw new WSException("Failed to adopt XOP content type", e);
}
- else
+
+ if(!JavaUtils.isAssignableFrom(javaType, obj.getClass()))
{
- obj = convertedObj;
+ throw new WSException("Java type '" + javaType + "' is not assignable from: " + objType.getName());
}
}
}
@@ -810,7 +813,7 @@
// DOM expansion should only happen when a handler accesses the DOM API.
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
+ if (msgContext != null && !UnifiedMetaData.isFinalRelease())
{
Boolean allowExpand = (Boolean)msgContext.getProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
if (Boolean.TRUE.equals(allowExpand) == false)
@@ -989,9 +992,9 @@
* When a SOAPContentElement transitions between dom-valid and xml-valid
* the XOP elements need to transition from XOP optimized to base64 and reverse.<p>
*
- * If MTOM is disabled through a message context property,
- * then we always enforce the inlined representation by expanding to DOM,
- * the same happens when a JAXRPC handler accesses the SOAPContentElement.<p>
+ * If MTOM is disabled through a message context property we always enforce the
+ * base64 representation by expanding to DOM, the same happens when a JAXRPC handler
+ * accesses the SOAPContentElement.<p>
*
* If the element is in dom-valid state (because a handlers accessed it), upon marshalling
* it's needs to be decided wether or not the <code>xop:Include</code> should be restored.
@@ -999,31 +1002,30 @@
*/
public void handleMTOMTransitions()
{
+ // MTOM processing is only required on XOP parameters
+ if( isXOPParameter() == false)
+ return;
- boolean mtomEnabled = isXOPParameter() && XOPContext.isMTOMEnabled();
-
- if (paramMetaData != null && mtomEnabled == false)
+ if ( !XOPContext.isMTOMEnabled() )
{
- // If MTOM is disabled, we force dom expansion.
- // This will inline any XOP include element
- // and remove the attachment part when transitioning.
+ // If MTOM is disabled, we force dom expansion on XOP parameters.
+ // This will inline any XOP include element and remove the attachment part.
// See SOAPFactoryImpl for details.
- log.debug("MTOM disabled: Enforce dom-valid state");
+ log.debug("MTOM disabled: Force inline XOP data");
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setProperty(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
expandToDOM();
}
- else if (isDOMValid && mtomEnabled)
+ else if ( isDOMValid && XOPContext.isMTOMEnabled() )
{
// When the DOM representation is valid,
- // and MTOM is enabled we need to convert the inlined
+ // but MTOM is enabled we need to convert the inlined
// element back to an xop:Include element and create the attachment part
log.debug("MTOM enabled: Restore XOP data");
XOPContext.restoreXOPDataDOM(this);
}
-
}
private boolean isXOPParameter()
Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/soap/SOAPMessageImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -213,27 +213,32 @@
{
try
{
- if (isXOPMessage() && !XOPContext.isMTOMEnabled() && attachments.size() > 0)
+ boolean hasAttachments = attachments.size() > 0;
+
+ if (isXOPMessage() && !XOPContext.isMTOMEnabled() && hasAttachments)
throw new IllegalStateException("XOP parameter not properly inlined");
-
- String contentType;
- if (isXOPMessage() && XOPContext.isMTOMEnabled())
+
+ // default content-type
+ String contentType = MimeConstants.TYPE_SOAP11 + "; charset=" + getCharSetEncoding();
+
+ if (hasAttachments)
{
- multipartRelatedEncoder = new MultipartRelatedXOPEncoder(this);
- multipartRelatedEncoder.encodeMultipartRelatedMessage();
- contentType = multipartRelatedEncoder.getContentType();
+ if (isXOPMessage() && XOPContext.isMTOMEnabled())
+ {
+ multipartRelatedEncoder = new MultipartRelatedXOPEncoder(this);
+ multipartRelatedEncoder.encodeMultipartRelatedMessage();
+ contentType = multipartRelatedEncoder.getContentType();
+ }
+ else
+ {
+ multipartRelatedEncoder = new MultipartRelatedSwAEncoder(this);
+ multipartRelatedEncoder.encodeMultipartRelatedMessage();
+ contentType = multipartRelatedEncoder.getContentType();
+ }
}
- else if (attachments.size() > 0)
- {
- multipartRelatedEncoder = new MultipartRelatedSwAEncoder(this);
- multipartRelatedEncoder.encodeMultipartRelatedMessage();
- contentType = multipartRelatedEncoder.getContentType();
- }
- else
- {
- contentType = MimeConstants.TYPE_SOAP11 + "; charset=" + getCharSetEncoding();
- }
+
mimeHeaders.setHeader(MimeConstants.CONTENT_TYPE, contentType);
+
}
catch (MessagingException ex)
{
@@ -406,4 +411,4 @@
iterator.remove();
}
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/soap/attachment/ByteArrayContentHandler.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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());
Added: trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/CreateAttachmentVisitor.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,89 @@
+/*
+* 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.ws.soap.SAAJVisitor;
+import org.jboss.ws.soap.SOAPElementImpl;
+import org.jboss.ws.soap.SOAPContentElement;
+
+import java.util.Iterator;
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: CreateAttachmentVisitor.java 1408 2006-11-07 13:42:25Z heiko.braun(a)jboss.com $
+ * @since Nov 7, 2006
+ */
+public class CreateAttachmentVisitor implements SAAJVisitor {
+ public void visitXOPElements(SOAPElementImpl root)
+ {
+ boolean isSCE = (root instanceof SOAPContentElement);
+
+ // don't expand SOAPContentElements
+ if(isSCE)
+ {
+ root.accept(this);
+ }
+ else
+ {
+ Iterator it = root.getChildElements();
+ while(it.hasNext())
+ {
+ final Object o = it.next();
+ if(o instanceof SOAPElementImpl)
+ visitXOPElements((SOAPElementImpl)o);
+ }
+ }
+ }
+
+ public void visitSOAPElement(SOAPElementImpl soapElement) {
+ // nada
+ }
+
+ public void visitSOAPContentElement(SOAPContentElement scElement) {
+ // Calling writeElement will enforce marshalling of this object
+ // Any attachment will be created while doing this.
+ try
+ {
+ scElement.writeElement( new NoopWriter() );
+ }
+ catch (IOException e)
+ {
+ //
+ }
+ }
+
+ class NoopWriter extends Writer {
+ public void write(char cbuf[], int off, int len) throws IOException {
+
+ }
+
+ public void flush() throws IOException {
+
+ }
+
+ public void close() throws IOException {
+
+ }
+ }
+}
Added: trunk/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/JBossXBContentAdapter.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,234 @@
+/*
+* 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.Constants;
+import org.jboss.ws.WSException;
+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.SchemaBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.TermBeforeSetParentCallback;
+import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding;
+import org.jboss.xb.binding.sunday.unmarshalling.UnmarshallingContext;
+
+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;
+import java.io.InputStream;
+
+/**
+ * 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: JBossXBContentAdapter.java 1322 2006-10-27 13:27:04Z heiko.braun(a)jboss.com $
+ * @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();
+
+ if(null==targetClass) {
+ throw new WSException("Failed to resolve target property type on "+ ctx.getParticle());
+ }
+
+ boolean isRegularMessage = !XOPContext.isXOPMessage();
+ boolean isSimpleType = (object instanceof byte[]);
+ boolean doTypesMatch = ( 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) && !doTypesMatch)
+ {
+ try
+ {
+ String contentType = MimeUtils.resolveMimeType(targetClass);
+ log.debug("Adopt DataHandler to " + targetClass +", contentType "+ contentType);
+
+ DataHandler dh = new DataHandler(
+ wrapAsDataSource(object, contentType)
+ );
+ object = dh.getContent();
+
+ // 'application/octet-stream' will return a byte[] instead fo the stream
+ if(object instanceof InputStream)
+ {
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ dh.writeTo(bout);
+ object = bout.toByteArray();
+ }
+ }
+ 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 if(object instanceof DataHandler)
+ {
+ ds = new SwapableMemoryDataSource(((DataHandler)object).getInputStream(), 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);
+ */
+ }
+ }
+
+}
Modified: trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/RestoreXOPElementVisitor.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -58,7 +58,9 @@
Iterator it = root.getChildElements();
while(it.hasNext())
{
- visitXOPElements((SOAPElementImpl)it.next());
+ final Object o = it.next();
+ if(o instanceof SOAPElementImpl)
+ visitXOPElements((SOAPElementImpl)o);
}
}
}
Modified: trunk/src/main/java/org/jboss/ws/xop/XOPContext.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/XOPContext.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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;
@@ -39,10 +40,7 @@
import javax.activation.DataHandler;
import javax.xml.namespace.QName;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPBody;
+import javax.xml.soap.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Iterator;
@@ -66,11 +64,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 +82,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 +93,7 @@
{
for(String value : contentType)
{
- if(value.indexOf("application/xop+xml") != -1)
+ if(value.indexOf(MimeConstants.TYPE_APPLICATION_XOP_XML) != -1)
{
isMultippartXOP = true;
break;
@@ -174,13 +173,45 @@
}
/**
+ * The XOP attachments need to be created before the actual message is written
+ * to an output stream. This is necessary because it changes the overall message content-type.
+ * If we would do this lazily (i.e. upon remoting callback) the previous content-type
+ * would already have been written.
+ *
+ * @see org.jboss.ws.soap.SOAPConnectionImpl#callInternal(javax.xml.soap.SOAPMessage, Object, boolean)
+ * @see org.jboss.ws.binding.soap.SOAPMessageMarshaller#write(Object, java.io.OutputStream)
+ */
+ public static void eagerlyCreateAttachments()
+ {
+ if(!isXOPMessage())
+ return;
+
+ try
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ SOAPMessage soapMessage = msgContext != null ? msgContext.getSOAPMessage() : null;
+ SOAPBody body = soapMessage!=null ? soapMessage.getSOAPBody() : null;
+
+ if(body!=null)
+ {
+ CreateAttachmentVisitor visitor = new CreateAttachmentVisitor();
+ visitor.visitXOPElements((SOAPElementImpl)body);
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WSException("Failed to eagerly create XOP attachments", e);
+ }
+ }
+
+ /**
* Visit the soap object model elements and restore xop data.
*/
public static void visitAndRestoreXOPData()
{
try
{
- if(!isXOPPackage() && isMTOMEnabled())
+ if(!isXOPMessage() && isMTOMEnabled())
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SOAPBody body = msgContext.getSOAPMessage().getSOAPBody();
@@ -245,6 +276,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 +336,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: trunk/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/XOPMarshallerImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/main/java/org/jboss/ws/xop/XOPScanner.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/XOPScanner.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/XOPScanner.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/main/java/org/jboss/ws/xop/XOPUnmarshallerImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/test/ant/build-jars-jaxrpc.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxrpc.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/ant/build-jars-jaxrpc.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -16,7 +16,7 @@
<!-- Building -->
<!-- ================================================================== -->
- <target name="build-jars" description="Build the deployments.">
+ <target name="build-jars" description="Build the jaxrpc deployments">
<!-- jaxrpc-anonymous -->
<war warfile="${build.tests.dir}/libs/jaxrpc-anonymous.war" webxml="${build.tests.dir}/resources/jaxrpc/anonymous/WEB-INF/web.xml">
@@ -1355,8 +1355,8 @@
<!-- jaxrpc-samples-mtom -->
<war warfile="${build.tests.dir}/libs/jaxrpc-samples-mtom.war" webxml="${build.tests.dir}/resources/jaxrpc/samples/mtom/WEB-INF/web.xml">
<classes dir="${build.tests.dir}/classes">
- <include name="org/jboss/test/ws/jaxrpc/samples/mtom/XOPTestImpl.class"/>
- <include name="org/jboss/test/ws/jaxrpc/samples/mtom/XOPTest.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/samples/mtom/**"/>
+ <exclude name="org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.class"/>
</classes>
<webinf dir="${build.tests.dir}/resources/jaxrpc/samples/mtom/WEB-INF">
<include name="jaxrpc-mapping.xml"/>
@@ -2063,7 +2063,7 @@
</metainf>
</jar>
- <!-- jaxrpc-xop-doclit -->
+ <!-- jaxrpc-xop-doclit without handlers -->
<war warfile="${build.tests.dir}/libs/jaxrpc-xop-doclit.war" webxml="${build.tests.dir}/resources/jaxrpc/xop/doclit/WEB-INF/web.xml">
<classes dir="${build.tests.dir}/classes">
<include name="org/jboss/test/ws/jaxrpc/xop/doclit/*.class"/>
Modified: trunk/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/JBossWSTestSetup.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -76,6 +76,7 @@
delegate.undeploy(archive);
}
}
+
if (isJ2EEClient)
{
URL archiveURL = delegate.getArchiveURL(archive);
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Employee.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Employee.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Employee.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,60 @@
+/*
+* 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.samples.mtom;
+
+import javax.activation.DataHandler;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: Employee.java 1323 2006-10-27 14:55:38Z heiko.braun(a)jboss.com $
+ * @since Oct 27, 2006
+ */
+public class Employee {
+
+ private String firstname;
+ private String lastname;
+ private DataHandler legacyData;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public DataHandler getLegacyData() {
+ return legacyData;
+ }
+
+ public void setLegacyData(DataHandler legacyData) {
+ this.legacyData = legacyData;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecords.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecords.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecords.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,47 @@
+/*
+ * 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.samples.mtom;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.Source;
+
+/**
+ * Service Endpoint Interface for XOP
+ *
+ * image/gif java.awt.Image
+ * image/jpeg java.awt.Image
+ * text/plain java.lang.String
+ * multipart/* javax.mail.internet.MimeMultipart
+ * text/xml javax.xml.transform.Source
+ * application/xml javax.xml.transform.Source
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Jan-2006
+ */
+public interface EmployeeRecords extends Remote
+{
+ public Status updateEmployee(Employee employee) throws RemoteException;
+ public Employee queryEmployee(Query query) throws RemoteException;
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/EmployeeRecordsImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,96 @@
+/*
+ * 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.samples.mtom;
+
+import java.io.IOException;
+import java.io.ByteArrayInputStream;
+import java.rmi.RemoteException;
+
+import javax.activation.DataHandler;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.utils.IOUtils;
+
+/**
+ * EmployeeRecords service endpoint
+ *
+ * @author Heiko.Braun(a)jboss.org
+ */
+public class EmployeeRecordsImpl implements EmployeeRecords
+{
+ public Status updateEmployee(Employee employee) throws RemoteException
+ {
+ try
+ {
+ DataHandler dataHandler = employee.getLegacyData();
+ String contentType = dataHandler.getContentType();
+
+ // Note: An MTOM request is ambiguous.
+ // Some vendors do XOP encoding dpending on a threshold.
+ // In that case you might receive an inlined request for
+ // an MTOM capable endpoint. The example below shows how deal with it.
+
+ if ("text/xml".equals(contentType))
+ {
+ StreamSource xmlStream = (StreamSource)dataHandler.getContent();
+ IOUtils.copyStream(System.out, xmlStream.getInputStream());
+ }
+ else if ("application/octet-stream".equals(contentType))
+ {
+ IOUtils.copyStream(System.out, dataHandler.getInputStream());
+ }
+
+ return new Status("OK");
+ }
+ catch (IOException e)
+ {
+ throw new RemoteException(e.getMessage());
+ }
+ }
+
+ public Employee queryEmployee(Query query) throws RemoteException
+ {
+ Employee employee = new Employee();
+ employee.setFirstname("Peter");
+ employee.setLastname("Pan");
+ employee.setLegacyData(getLegacyData());
+
+ return employee;
+ }
+
+ private DataHandler getLegacyData()
+ {
+ try
+ {
+ return new DataHandler(new StreamSource(new ByteArrayInputStream("<Payroll><Data/></Payroll>".getBytes())), "application/xml");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/HRService.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/HRService.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/HRService.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,33 @@
+/*
+* 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.samples.mtom;
+
+import javax.xml.rpc.ServiceException;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: HRService.java 1323 2006-10-27 14:55:38Z heiko.braun(a)jboss.com $
+ * @since Oct 27, 2006
+ */
+public interface HRService extends javax.xml.rpc.Service{
+ public EmployeeRecords getEmployeeRecordsPort() throws ServiceException;
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,125 @@
+/*
+ * 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.samples.mtom;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.Stub;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+import org.jboss.ws.jaxrpc.StubExt;
+
+/**
+ * Test SOAP with XOP through the JAXRPC dynamic proxy layer.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.org
+ * @since 18-Jan-2006
+ */
+public class MTOMTestCase extends JBossWSTest
+{
+ private static EmployeeRecords port;
+
+ /** Deploy the test ear */
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(MTOMTestCase.class, "jaxrpc-samples-mtom.war, jaxrpc-samples-mtom-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ if (port == null)
+ {
+ if (isTargetServerJBoss())
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestService");
+ port = (EmployeeRecords)service.getPort(EmployeeRecords.class);
+ }
+ else
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new File("resources/jaxrpc/samples/mtom/WEB-INF/wsdl/EmployeeService.wsdl").toURL();
+ URL mappingURL = new File("resources/jaxrpc/samples/mtom/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.ws/samples/mtom", "EmployeeService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ port = (EmployeeRecords)service.getPort(EmployeeRecords.class);
+ ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-samples-mtom");
+ }
+
+ }
+ }
+
+ public void testUpdate() throws Exception
+ {
+ Employee employee = new Employee();
+ employee.setFirstname("Peter");
+ employee.setLastname("Pan");
+ employee.setLegacyData(getLegacyData());
+
+ Status status = port.updateEmployee(employee);
+ assertEquals("OK", status.getCode());
+ }
+
+ public void testUpdateMTOMDisabled() throws Exception
+ {
+ setMTOMEnabled(Boolean.FALSE);
+ testUpdate();
+ }
+
+ public void testQuery() throws Exception
+ {
+ Query query = new Query("Peter", "Pan");
+ Employee employee = port.queryEmployee(query);
+ assertNotNull(employee);
+ assertNotNull(employee.getLegacyData());
+
+ StreamSource xmlStream = (StreamSource)employee.getLegacyData().getContent();
+ String content = new BufferedReader(new InputStreamReader(xmlStream.getInputStream())).readLine();
+ assertEquals("<Payroll><Data/></Payroll>", content);
+ }
+
+ private DataHandler getLegacyData()
+ {
+ return new DataHandler(new StreamSource(new ByteArrayInputStream("<Payroll><Data/></Payroll>".getBytes())), "application/xml");
+ }
+
+ private void setMTOMEnabled(Boolean b)
+ {
+ ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, b);
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Query.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Query.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Query.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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.samples.mtom;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: Query.java 1323 2006-10-27 14:55:38Z heiko.braun(a)jboss.com $
+ * @since Oct 27, 2006
+ */
+public class Query {
+
+ private String firstname;
+ private String lastname;
+
+ public Query() {
+ }
+
+ public Query(String firstname, String lastname) {
+ this.firstname = firstname;
+ this.lastname = lastname;
+ }
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Status.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Status.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/Status.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,46 @@
+/*
+* 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.samples.mtom;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @version $Id: Status.java 1323 2006-10-27 14:55:38Z heiko.braun(a)jboss.com $
+ * @since Oct 27, 2006
+ */
+public class Status {
+ private String code;
+
+ public Status() {
+ }
+
+ public Status(String code) {
+ this.code = code;
+ }
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPRpcTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,171 +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.samples.mtom;
-
-import java.io.File;
-import java.net.URL;
-
-import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
-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.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
-import org.jboss.ws.utils.IOUtils;
-
-/**
- * Test SOAP with XOP through the JAXRPC dynamic proxy layer.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.org
- * @since 18-Jan-2006
- */
-public class XOPRpcTestCase extends JBossWSTest
-{
- private static XOPTest port;
-
- /** Deploy the test ear */
- public static Test suite() throws Exception
- {
- return JBossWSTestSetup.newTestSetup(XOPRpcTestCase.class, "jaxrpc-samples-mtom.war, jaxrpc-samples-mtom-client.jar");
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- if (port == null)
- {
- if (isTargetServerJBoss())
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestService");
- port = (XOPTest)service.getPort(XOPTest.class);
- }
- else
- {
- ServiceFactoryImpl factory = new ServiceFactoryImpl();
- URL wsdlURL = new File("resources/jaxrpc/samples/mtom/WEB-INF/wsdl/TestService.wsdl").toURL();
- URL mappingURL = new File("resources/jaxrpc/samples/mtom/WEB-INF/jaxrpc-mapping.xml").toURL();
- QName qname = new QName("http://org.jboss.ws/samples/mtom", "XOPTest");
- Service service = factory.createService(wsdlURL, qname, mappingURL);
- port = (XOPTest)service.getPort(XOPTest.class);
- ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxrpc-samples-mtom");
- }
-
- }
-
- //((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8081/jaxrpc-samples-mtom");
- }
-
- /**
- * Send a byte[] XOP encoded.
- *
- */
- public void testSimpleBinary() throws Exception
- {
- DataHandler dh = new DataHandler(
- new FileDataSource("resources/jaxrpc/samples/mtom/disguised_jpeg.xcf")
- );
- byte[] bytesIn = IOUtils.convertToBytes(dh);
- byte[] bytesOut = port.sendOctets("Some text message", bytesIn);
- assertNotNull(bytesOut);
- 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();
-
- // disable MTOM
- ((Stub)port)._setProperty("org.jboss.ws.mtom.enabled", Boolean.FALSE);
-
- DataHandler dh = new DataHandler(url);
- byte[] bytesIn = IOUtils.convertToBytes(dh);
- byte[] bytesOut = port.sendOctets("MTOM disabled request", bytesIn);
- assertNotNull(bytesOut);
- assertTrue("Content length is different", bytesIn.length == bytesOut.length);
- 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
- {
- 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
- {
- 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");
- StreamSource source = new StreamSource(stream);
-
- 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");
- StreamSource source = new StreamSource(stream);
-
- DataHandler value = port.sendMimeApplicationXML("Some text message", source);
- assertNotNull(value);
- assertTrue("Wrong return value content-type", value.getContentType().equals("application/xml"));
- } */
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTest.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTest.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,62 +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.samples.mtom;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import javax.activation.DataHandler;
-import javax.xml.transform.Source;
-
-/**
- * Service Endpoint Interface for XOP
- *
- * image/gif java.awt.Image
- * image/jpeg java.awt.Image
- * text/plain java.lang.String
- * multipart/* javax.mail.internet.MimeMultipart
- * text/xml javax.xml.transform.Source
- * application/xml javax.xml.transform.Source
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Jan-2006
- */
-public interface XOPTest extends Remote
-{
- /** Service endpoint method for image/jpeg
- */
- DataHandler sendMimeImageJPEG(String message, DataHandler xoppart) throws RemoteException;
-
- /** Service endpoint method for text/plain
- */
- String sendMimeTextPlain(String message, String xoppart) throws RemoteException;
-
- /** Service endpoint method for text/xml
- */
- Source sendMimeTextXML(String message, DataHandler xoppart) throws RemoteException;
-
- /** Service endpoint method for application/xml
- */
- DataHandler sendMimeApplicationXML(String message, Source xoppart) throws RemoteException;
-
- byte[] sendOctets(String message, byte[] xoppart) throws RemoteException;
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTestImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTestImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/XOPTestImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,111 +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.samples.mtom;
-
-import java.io.IOException;
-import java.rmi.RemoteException;
-
-import javax.activation.DataHandler;
-import javax.xml.rpc.ServiceException;
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-import javax.xml.transform.Source;
-
-import org.jboss.ws.WSException;
-
-/**
- * Service Endpoint for XOP
- *
- * image/jpeg java.awt.Image
- * text/plain java.lang.String
- * text/xml javax.xml.transform.Source
- * application/xml javax.xml.transform.Source
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Heiko.Braun(a)jboss.org
- *
- * @since 18-Jan-2006
- */
-public class XOPTestImpl implements XOPTest, ServiceLifecycle
-{
- private ServletEndpointContext context;
-
- /**
- * Service endpoint method that processes inlined and optimized values.
- */
- public DataHandler sendMimeImageJPEG(String message, DataHandler xoppart) throws RemoteException
- {
- String expContentType = message.equals("MTOM disabled request") ? "application/octet-stream" : "image/jpeg";
-
- if(! xoppart.getContentType().equals(expContentType))
- throw new IllegalArgumentException("Wrong content-type: expected "+expContentType+", but was " + xoppart.getContentType());
- return xoppart;
- }
-
- /**
- * Service endpoint method for text/plain
- */
- public String sendMimeTextPlain(String message, String xoppart) throws RemoteException
- {
- return xoppart;
- }
-
- /**
- * Service endpoint method for text/xml
- */
- public Source sendMimeTextXML(String message, DataHandler xoppart) throws RemoteException
- {
- if(! xoppart.getContentType().equals("text/xml"))
- throw new IllegalArgumentException("Wrong content-type: expected 'text/xml', but was " + xoppart.getContentType());
- try
- {
- Source payload = (Source)xoppart.getContent();
- return payload;
- }
- catch (IOException e)
- {
- throw new WSException(e.getMessage());
- }
- }
-
- /**
- * Service endpoint method for application/xml
- */
- public DataHandler sendMimeApplicationXML(String message, Source xoppart) throws RemoteException
- {
- return new DataHandler(xoppart, "application/xml");
- }
-
- public byte[] sendOctets(String message, byte[] xoppart) throws RemoteException {
- return xoppart;
- }
-
- public void init(Object context) throws ServiceException
- {
- this.context = (ServletEndpointContext)context;
- }
-
- public void destroy()
- {
- this.context = null;
- }
-}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTestSupport.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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,47 @@
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()
+ {
+ try
+ {
+ URL url = new File("resources/jaxrpc/xop/shared/attach.jpeg").toURL();
+ return new DataHandler(url);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/XOPTypeDefTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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)
@@ -91,9 +93,7 @@
}
public void testMSFTElementScan() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
- if (true) return;
+ {
SchemaUtils utils = SchemaUtils.getInstance();
File f = new File("resources/jaxrpc/xop/schema.xsd");
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestServiceImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,29 +0,0 @@
-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 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.
- *
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 11-Apr-2006
- */
-public class TestServiceImpl extends MTOMServiceBase implements TestService_PortType {
-
- public PingMsgResponse ping(PingMsg pingMsg) throws RemoteException {
-
- toggleXOP(pingMsg.getMessage());
- return new PingMsgResponse(pingMsg.getXopContent());
-
- }
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_PortType.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,11 +0,0 @@
-/*
- * JBoss, the OpenSource EJB server
- * Distributable under LGPL license. See terms of license at gnu.org.
- */
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jaxrpc.xop.doclit;
-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;
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_Service.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_Service.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/TestService_Service.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,19 +0,0 @@
-/*
-* JBoss, the OpenSource EJB server
-* Distributable under LGPL license. See terms of license at gnu.org.
-*/
-
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jaxrpc.xop.doclit;
-
-
-import javax.xml.rpc.ServiceException;
-
-
-public interface TestService_Service extends javax.xml.rpc.Service
-{
-
- public org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType getTestServicePort() throws ServiceException;
-
-}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPBase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -22,44 +22,48 @@
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.awt.*;
import java.io.File;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
+ * @version $Id:XOPBase.java 1321 2006-10-27 11:47:18Z heiko.braun(a)jboss.com $
* @since Sep 25, 2006
*/
public abstract class XOPBase extends JBossWSTest {
- protected TestService_PortType port;
+ protected abstract XOPPing getPort();
+ // ---------------------------------------------------------------------------------
+ // Test raw binary data
+
public void testRequestResponseOptimized() throws Exception {
- DataHandler dh = new DataHandler("Another plain text attachment", "text/plain");
- byte[] bytesIn = IOUtils.convertToBytes(dh);
- PingMsgResponse value = port.ping(new PingMsg("1|1", bytesIn));
- assertNotNull("Return value was null", value);
- byte[] bytesOut = value.getXopContent();
- assertNotNull("Returned xopContent was null", bytesOut);
- assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
- }
+ DataHandler dh = new DataHandler("Another plain text attachment", "text/plain");
+ byte[] bytesIn = IOUtils.convertToBytes(dh);
+ PingMsgResponse value = getPort().ping(new PingMsg("1|1", bytesIn));
+ assertNotNull("Return value was null", value);
+ byte[] bytesOut = value.getXopContent();
+ assertNotNull("Returned xopContent was null", bytesOut);
+ 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"));
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/xop/shared/attach.jpeg"));
// disable MTOM
- ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
- PingMsgResponse value = port.ping(new PingMsg("0|1", bytesIn));
+ PingMsgResponse value = getPort().ping(new PingMsg("0|1", bytesIn));
assertNotNull("Return value was null",value);
byte[] bytesOut = value.getXopContent();
assertNotNull("Return xopContent was null", bytesOut);
@@ -68,15 +72,114 @@
public void testRequestOptimized() throws Exception {
- byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/samples/mtom/attach.jpeg"));
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/xop/shared/attach.jpeg"));
// reusing the stub means cleaning the previous state
- ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
- PingMsgResponse value = port.ping(new PingMsg("1|0", bytesIn));
+ PingMsgResponse value = getPort().ping(new PingMsg("1|0", bytesIn));
assertNotNull("Return value was null",value);
byte[] bytesOut = value.getXopContent();
assertNotNull("Return xopContent was null", bytesOut);
assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
}
+
+ // ---------------------------------------------------------------------------------
+ // Test concrete java types
+
+ public void testImageResponseOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ if(image!=null)
+ {
+ // disable MTOM
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingImage pingImage = new PingImage("0|1", image);
+ PingImageResponse response = getPort().pingImage(pingImage);
+ assertNotNull("Return xopContent was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
+ }
+
+ public void testImageRequestOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ if(image!=null)
+ {
+ // enable MTOM
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingImage pingImage = new PingImage("1|0", image);
+ PingImageResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("0|1");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("1|0");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("0|1");
+
+ PingDataHandlerResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("1|0");
+
+ PingDataHandlerResponse response = getPort().pingDataHandler(reqest);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPHandlerTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -23,18 +23,9 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.jaxrpc.StubExt;
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import javax.xml.rpc.Stub;
-import javax.activation.DataHandler;
-import java.io.File;
/**
* Test MTOM functionality with jaxrpc-handlers in place.<br>
@@ -47,6 +38,8 @@
*/
public class XOPHandlerTestCase extends XOPBase {
+ private XOPPing port;
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(XOPHandlerTestCase.class, "jaxrpc-xop-doclit_handler.war, jaxrpc-xop-doclit_handler-client.jar");
@@ -59,27 +52,13 @@
{
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPHandlerTestCase");
- port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ port = (XOPPing)service.getPort(XOPPing.class);
}
//((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-doclit_handler");
}
- @Override
- public void testRequestOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
+ protected XOPPing getPort() {
+ return port;
}
-
- @Override
- public void testRequestResponseOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
- }
-
- @Override
- public void testResponseOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
- }
-}
\ No newline at end of file
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPing.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPing.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPing.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,17 @@
+/*
+ * JBoss, the OpenSource EJB server
+ * Distributable under LGPL license. See terms of license at gnu.org.
+ */
+//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 XOPPing extends java.rmi.Remote
+{
+ 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;
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,36 @@
+package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+import org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing;
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
+
+import java.rmi.RemoteException;
+
+/**
+ * MTOM test service impl.
+ * 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
+ */
+public class XOPPingImpl extends MTOMServiceBase implements XOPPing {
+
+ 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());
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingService.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingService.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPPingService.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,19 @@
+/*
+* JBoss, the OpenSource EJB server
+* Distributable under LGPL license. See terms of license at gnu.org.
+*/
+
+//Auto Generated by jbossws - Please do not edit!!!
+
+package org.jboss.test.ws.jaxrpc.xop.doclit;
+
+
+import javax.xml.rpc.ServiceException;
+
+
+public interface XOPPingService extends javax.xml.rpc.Service
+{
+
+ public org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing getTestServicePort() throws ServiceException;
+
+}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/doclit/XOPTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -24,19 +24,11 @@
// $Id$
import junit.framework.Test;
-import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
-import javax.activation.DataHandler;
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
import javax.xml.rpc.Stub;
-import java.io.File;
/**
* Test MTOM functionaly without any jaxrpc handlers in place.
@@ -46,6 +38,8 @@
*/
public class XOPTestCase extends XOPBase {
+ private XOPPing port;
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(XOPTestCase.class, "jaxrpc-xop-doclit.war, jaxrpc-xop-doclit-client.jar");
@@ -58,10 +52,15 @@
{
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestCase");
- port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ port = (XOPPing)service.getPort(XOPPing.class);
}
//((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-doclit");
}
+ protected XOPPing getPort()
+ {
+ return port;
+ }
+
}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestServiceImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestServiceImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestServiceImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,32 +0,0 @@
-package org.jboss.test.ws.jaxrpc.xop.rpclit;
-
-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 java.rmi.RemoteException;
-import java.util.StringTokenizer;
-
-/**
- * @author Heiko Braun, <heiko(a)openj.net>
- * @since 11-Apr-2006
- */
-public class TestServiceImpl extends MTOMServiceBase implements TestService_PortType {
-
- public PingMsgResponse pingComplex(PingMsg pingMsg) throws RemoteException {
-
- String message = pingMsg.getMessage();
- toggleXOP(message);
-
- return new PingMsgResponse(pingMsg.getXopContent());
- }
-
- public byte[] pingSimple(String parameters, byte[] xopContent) throws RemoteException {
- toggleXOP(parameters);
- return xopContent;
- }
-
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_PortType.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_PortType.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_PortType.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,12 +0,0 @@
-/*
- * JBoss, the OpenSource EJB server
- * Distributable under LGPL license. See terms of license at gnu.org.
- */
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jaxrpc.xop.rpclit;
-public interface TestService_PortType extends java.rmi.Remote
-{
- public org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse pingComplex(org.jboss.test.ws.jaxrpc.xop.shared.PingMsg pingMsg) throws java.rmi.RemoteException;
- public byte[] pingSimple(String parameters, byte[] xopContent) throws java.rmi.RemoteException;
-}
Deleted: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_Service.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_Service.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/TestService_Service.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,17 +0,0 @@
-/*
-* JBoss, the OpenSource EJB server
-* Distributable under LGPL license. See terms of license at gnu.org.
-*/
-
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jaxrpc.xop.rpclit;
-
-
-import javax.xml.rpc.ServiceException;
-
-
-public interface TestService_Service extends javax.xml.rpc.Service
-{
- public org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType getTestServicePort() throws ServiceException;
-}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPBase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -22,25 +22,26 @@
package org.jboss.test.ws.jaxrpc.xop.rpclit;
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.util.StringTokenizer;
+import java.awt.*;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
- * @version $Id$
+ * @version $Id:XOPBase.java 1321 2006-10-27 11:47:18Z heiko.braun(a)jboss.com $
* @since Sep 25, 2006
*/
public abstract class XOPBase extends JBossWSTest {
- protected TestService_PortType port;
+ protected abstract XOPPing getPort();
public void testRequestResponseOptimized() throws Exception {
@@ -52,14 +53,14 @@
public void testResponseOptimized() throws Exception {
- byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/samples/mtom/attach.jpeg"));
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/xop/shared/attach.jpeg"));
requestComplex(new PingMsg("0|1", bytesIn));
}
public void testRequestOptimized() throws Exception {
- byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/samples/mtom/attach.jpeg"));
+ byte[] bytesIn = XOPTestSupport.getBytesFromFile(new File("resources/jaxrpc/xop/shared/attach.jpeg"));
requestComplex(new PingMsg("1|0", bytesIn));
}
@@ -68,36 +69,132 @@
{
StringTokenizer tok =new StringTokenizer(payload.getMessage(), "|");
boolean mtomEnabled = tok.nextToken().equals("1");
- ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(mtomEnabled));
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.valueOf(mtomEnabled));
- PingMsgResponse value = port.pingComplex(payload);
+ PingMsgResponse value = getPort().ping(payload);
assertNotNull("Return value was null",value);
byte[] bytesOut = value.getXopContent();
assertNotNull("Return xopContent was null", bytesOut);
assertEquals("Content length doesn't match", payload.getXopContent().length, bytesOut.length);
}
-// public void testSimpleTypesOptimized() throws Exception
-// {
-// DataHandler dh = new DataHandler("Simple type plain text attachment", "text/plain");
-// byte[] bytesIn = IOUtils.convertToBytes(dh);
-// ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
-// byte[] bytesOut = port.pingSimple("s1|s1", bytesIn);
-//
-// assertNotNull("Return xopContent was null", bytesOut);
-// assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
-// }
-//
-// public void testSimpleTypesResponseOptimized() throws Exception
-// {
-// DataHandler dh = new DataHandler("Simple type plain text attachment", "text/plain");
-// byte[] bytesIn = IOUtils.convertToBytes(dh);
-// ((Stub)port)._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
-//
-// byte[] bytesOut = port.pingSimple("s0|s1", bytesIn);
-//
-// assertNotNull("Return xopContent was null", bytesOut);
-// assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
-//
-// }
+ public void testSimpleTypesOptimized() throws Exception
+ {
+ DataHandler dh = new DataHandler("Simple type plain text attachment", "text/plain");
+ byte[] bytesIn = IOUtils.convertToBytes(dh);
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+ byte[] bytesOut = getPort().pingSimple("s1|s1", bytesIn);
+
+ assertNotNull("Return xopContent was null", bytesOut);
+ assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
+ }
+
+ public void testSimpleTypesResponseOptimized() throws Exception
+ {
+ DataHandler dh = new DataHandler("Simple type plain text attachment", "text/plain");
+ byte[] bytesIn = IOUtils.convertToBytes(dh);
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ byte[] bytesOut = getPort().pingSimple("s0|s1", bytesIn);
+
+ assertNotNull("Return xopContent was null", bytesOut);
+ assertEquals("Content length doesn't match", bytesIn.length, bytesOut.length);
+ }
+
+ public void testImageResponseOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ if(image!=null)
+ {
+ // disable MTOM
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingImage pingImage = new PingImage("0|1", image);
+ PingImageResponse response = getPort().pingImage(pingImage);
+ assertNotNull("Return xopContent was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
+ }
+
+ public void testImageRequestOptimized() throws Exception {
+
+ Image image = XOPTestSupport.createTestImage();
+
+ if(image!=null)
+ {
+ // enable MTOM
+ ((Stub)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingImage pingImage = new PingImage("1|0", image);
+ PingImageResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("0|1");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingSource pingSource = new PingSource();
+ pingSource.setMessage("1|0");
+ pingSource.setXopContent(source);
+
+ PingSourceResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.FALSE);
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("0|1");
+
+ PingDataHandlerResponse response = getPort().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)getPort())._setProperty(StubExt.PROPERTY_MTOM_ENABLED, Boolean.TRUE);
+
+ PingDataHandler reqest = new PingDataHandler(dh);
+ reqest.setMessage("1|0");
+
+ PingDataHandlerResponse response = getPort().pingDataHandler(reqest);
+ assertNotNull("Response was null", response);
+ assertNotNull("Return xopContent was null", response.getXopContent());
+ }
+
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPHandlerTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPHandlerTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPHandlerTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -23,18 +23,9 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.ws.utils.IOUtils;
-import org.jboss.ws.jaxrpc.StubExt;
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import javax.xml.rpc.Stub;
-import javax.activation.DataHandler;
-import java.io.File;
/**
* @author Heiko Braun <heiko.braun(a)jboss.com>
@@ -43,6 +34,8 @@
*/
public class XOPHandlerTestCase extends XOPBase {
+ private XOPPing port;
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(XOPHandlerTestCase.class, "jaxrpc-xop-rpclit_handler.war, jaxrpc-xop-rpclit_handler-client.jar");
@@ -55,27 +48,13 @@
{
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPHandlerTestCaseRPC");
- port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ port = (XOPPing)service.getPort(XOPPing.class);
}
//((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-rpclit_handler");
}
- @Override
- public void testRequestOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
+ protected XOPPing getPort() {
+ return port;
}
-
- @Override
- public void testRequestResponseOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
- }
-
- @Override
- public void testResponseOptimized() throws Exception
- {
- System.out.println("FIXME: [JBWS-1313] Fix XOP tests in trunk");
- }
}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPing.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPing.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPing.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,18 @@
+/*
+ * JBoss, the OpenSource EJB server
+ * Distributable under LGPL license. See terms of license at gnu.org.
+ */
+//Auto Generated by jbossws - Please do not edit!!!
+
+package org.jboss.test.ws.jaxrpc.xop.rpclit;
+
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
+
+public interface XOPPing 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 byte[] pingSimple(String parameters, byte[] xopContent) 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;
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingImpl.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingImpl.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,41 @@
+package org.jboss.test.ws.jaxrpc.xop.rpclit;
+
+import org.jboss.test.ws.jaxrpc.xop.shared.*;
+
+import java.rmi.RemoteException;
+
+/**
+ * @author Heiko Braun, <heiko(a)openj.net>
+ * @since 11-Apr-2006
+ */
+public class XOPPingImpl extends MTOMServiceBase implements XOPPing {
+
+ public PingMsgResponse ping(PingMsg pingMsg) throws RemoteException {
+
+ String message = pingMsg.getMessage();
+ toggleXOP(message);
+
+ return new PingMsgResponse(pingMsg.getXopContent());
+ }
+
+ public byte[] pingSimple(String parameters, byte[] xopContent) throws RemoteException {
+ toggleXOP(parameters);
+ return xopContent;
+ }
+
+ 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());
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingService.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingService.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPPingService.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,17 @@
+/*
+* JBoss, the OpenSource EJB server
+* Distributable under LGPL license. See terms of license at gnu.org.
+*/
+
+//Auto Generated by jbossws - Please do not edit!!!
+
+package org.jboss.test.ws.jaxrpc.xop.rpclit;
+
+
+import javax.xml.rpc.ServiceException;
+
+
+public interface XOPPingService extends javax.xml.rpc.Service
+{
+ public org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing getTestServicePort() throws ServiceException;
+}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPTestCase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/rpclit/XOPTestCase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -24,19 +24,10 @@
// $Id$
import junit.framework.Test;
-import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.test.ws.jaxrpc.xop.XOPTestSupport;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsg;
-import org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse;
-import org.jboss.ws.jaxrpc.StubExt;
-import org.jboss.ws.utils.IOUtils;
-import javax.activation.DataHandler;
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
-import javax.xml.rpc.Stub;
-import java.io.File;
/**
*
@@ -45,6 +36,8 @@
*/
public class XOPTestCase extends XOPBase {
+ private XOPPing port;
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(XOPTestCase.class, "jaxrpc-xop-rpclit.war, jaxrpc-xop-rpclit-client.jar");
@@ -57,10 +50,14 @@
{
InitialContext iniCtx = getInitialContext();
Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestCaseRPC");
- port = (TestService_PortType)service.getPort(TestService_PortType.class);
+ port = (XOPPing)service.getPort(XOPPing.class);
}
//((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8081/jaxrpc-xop-rpclit");
}
+ protected XOPPing getPort() {
+ return port;
+ }
+
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/MTOMServiceBase.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandler.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingDataHandler.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingDataHandlerResponse.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingDataHandlerResponse.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImage.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingImage.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingImageResponse.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingImageResponse.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSource.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingSource.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/xop/shared/PingSourceResponse.java 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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: PingSourceResponse.java 1296 2006-10-24 14:06:00Z heiko.braun(a)jboss.com $
+ * @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;
+ }
+}
Modified: trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/application-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/application-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -10,10 +10,10 @@
<service-ref>
<service-ref-name>service/XOPTestService</service-ref-name>
<service-interface>javax.xml.rpc.Service</service-interface>
- <wsdl-file>META-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>META-INF/wsdl/EmployeeService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.XOPTest</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.EmployeeRecords</service-endpoint-interface>
</port-component-ref>
</service-ref>
Modified: trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/jboss-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/jboss-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/META-INF/jboss-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,6 +1,8 @@
<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
Modified: trunk/src/test/resources/jaxrpc/samples/mtom/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/WEB-INF/web.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/WEB-INF/web.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -6,12 +6,12 @@
version="2.4">
<servlet>
- <servlet-name>XOPTestJSE</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.samples.mtom.XOPTestImpl</servlet-class>
+ <servlet-name>EmployeeEndpoint</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxrpc.samples.mtom.EmployeeRecordsImpl</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>XOPTestJSE</servlet-name>
+ <servlet-name>EmployeeEndpoint</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/attach.gif
===================================================================
(Binary files differ)
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/attach.html
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/attach.html 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/attach.html 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,40 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
-<head>
-<title>Welcome to the JAXM TCK, Version 1.1</title>
-</head>
-<body bgcolor="#ffffff">
-<CENTER><h1>Your Starting Point</h1></center><hr>
-
-
-<h2>Guide to Documentation</h2>
-
-<p>The <a href="COPYRIGHT-jaxm.html">JAXM Copyright</a> provides
- the copyright information notice for the JAXM TCK, Version 1.1.<p>
-
-<p>The <a href="ReleaseNotes-jaxm.html">JAXM ReleaseNotes</a> provide the
- information that you need to install, set up, and run the JAXM TCK, Version 1.1.<p>
-
-<p>The <a href="JAXMJavadocAssertions.html">Javadoc Assertion List</a> lists all the javadoc assertions that are tested by the JAXM TCK.
-
-<p>The <a href="JAXMSpecAssertions.html">Specification Assertion List</a> lists all the specification assertions that are tested by the JAXM TCK.
-
-<p>Additional documentation includes the JavaTest README file, ReleaseNotes
- file, and user's guide:
-
-<ul>
-<li><p>The <a href="JavaTest3.0/README-javatest.html">README</a> file contains
- basic information about the JavaTest, Version 3.0.2 harness.</p></li>
-
-<li><p>The <a href="JavaTest3.0/javatest.pdf"><em>JavaTest User's Guide</em></a>,
- in PDF format, contains information about using the test harness tool.</p></li>
-
-<li><p>The <a href="JavaTest3.0/ReleaseNotes-javatest.html">ReleaseNotes</a>
- provide information that is not contained in the <em>JavaTest User's
- Guide</em> manual, and which supercede any information in the manual.<p></li>
-</ul>
-
-<p> </p>
-<rule>
-<p><em>Copyright © 2002 Sun Microsystems, Inc. All rights reserved</em></p>
-</body>
-</html>
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/attach.jpeg
===================================================================
(Binary files differ)
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/attach.txt
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/attach.txt 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/attach.txt 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1 +0,0 @@
-This is a plain text attachment.
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/attach.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/attach.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/attach.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<mime-message>This is an xml attachment.</mime-message>
Deleted: trunk/src/test/resources/jaxrpc/samples/mtom/disguised_jpeg.xcf
===================================================================
(Binary files differ)
Modified: trunk/src/test/resources/jaxrpc/samples/mtom/wstools-config.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples/mtom/wstools-config.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples/mtom/wstools-config.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -8,7 +8,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
<java-wsdl>
- <service name="TestService" style="rpc" endpoint="org.jboss.test.ws.jaxrpc.samples.mtom.XOPTest">
+ <service name="TestService" style="rpc" endpoint="org.jboss.test.ws.jaxrpc.samples.mtom.EmployeeRecords">
<operation>
<name>sendMimeImageGIF</name>
<parameter>
Modified: trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/jaxrpc-mapping.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,184 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
-<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
- <package-mapping>
- <package-type>org.jboss.test.ws.jaxrpc.samples.mtom</package-type>
- <namespaceURI>http://org.jboss.ws/samples/mtom</namespaceURI>
- </package-mapping>
- <service-interface-mapping>
- <service-interface>org.jboss.test.ws.jaxrpc.samples.mtom.XOPTest_Service</service-interface>
- <wsdl-service-name xmlns:serviceNS="http://org.jboss.ws/samples/mtom">serviceNS:XOPTest</wsdl-service-name>
- <port-mapping>
- <port-name>XOPTestPort</port-name>
- <java-port-name>XOPTestPort</java-port-name>
- </port-mapping>
- </service-interface-mapping>
- <service-endpoint-interface-mapping>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.XOPTest</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS="http://org.jboss.ws/samples/mtom">portTypeNS:XOPTest</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS="http://org.jboss.ws/samples/mtom">bindingNS:XOPTestBinding</wsdl-binding>
+<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
- <service-endpoint-method-mapping>
- <java-method-name>sendMimeImageJPEG</java-method-name>
- <wsdl-operation>sendMimeImageJPEG</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeImageJPEG</wsdl-message>
- <wsdl-message-part-name>message</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.samples.mtom</package-type>
+ <namespaceURI>http://org.jboss.ws/samples/mtom</namespaceURI>
+ </package-mapping>
- <!-- BEGIN manual modification -->
- <method-param-parts-mapping>
- <param-position>1</param-position>
- <param-type>javax.activation.DataHandler</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeImageJPEG</wsdl-message>
- <wsdl-message-part-name>xoppart</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <!-- END manual modification -->
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.samples.mtom.Employee</java-type>
+ <anonymous-type-qname xmlns:typeNS='http://org.jboss.ws/samples/mtom'>typeNS:>Employee</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>firstname</java-variable-name>
+ <xml-element-name>firstname</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>lastname</java-variable-name>
+ <xml-element-name>lastname</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>legacyData</java-variable-name>
+ <xml-element-name>legacyData</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
- <wsdl-return-value-mapping>
- <method-return-value>javax.activation.DataHandler</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeImageJPEGResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.samples.mtom.Status</java-type>
+ <anonymous-type-qname xmlns:typeNS='http://org.jboss.ws/samples/mtom'>typeNS:>Status</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>code</java-variable-name>
+ <xml-element-name>code</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
- <service-endpoint-method-mapping>
- <java-method-name>sendMimeTextPlain</java-method-name>
- <wsdl-operation>sendMimeTextPlain</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextPlain</wsdl-message>
- <wsdl-message-part-name>message</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.samples.mtom.Query</java-type>
+ <anonymous-type-qname xmlns:typeNS='http://org.jboss.ws/samples/mtom'>typeNS:>Query</anonymous-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>firstname</java-variable-name>
+ <xml-element-name>firstname</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>lastname</java-variable-name>
+ <xml-element-name>lastname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
- <!-- BEGIN manual modification -->
- <method-param-parts-mapping>
- <param-position>1</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextPlain</wsdl-message>
- <wsdl-message-part-name>xoppart</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <!-- END manual modification -->
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jaxrpc.samples.mtom.HRService</service-interface>
+ <wsdl-service-name xmlns:serviceNS="http://org.jboss.ws/samples/mtom">serviceNS:EmployeeService</wsdl-service-name>
+ <port-mapping>
+ <port-name>EmployeeRecordsPort</port-name>
+ <java-port-name>EmployeeRecordsPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
- <wsdl-return-value-mapping>
- <method-return-value>java.lang.String</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextPlainResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.EmployeeRecords</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS="http://org.jboss.ws/samples/mtom">portTypeNS:EmployeeRecords</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS="http://org.jboss.ws/samples/mtom">bindingNS:EmployeeRecordsBinding</wsdl-binding>
- <service-endpoint-method-mapping>
- <java-method-name>sendMimeTextXML</java-method-name>
- <wsdl-operation>sendMimeTextXML</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextXML</wsdl-message>
- <wsdl-message-part-name>message</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>updateEmployee</java-method-name>
+ <wsdl-operation>updateEmployee</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jaxrpc.samples.mtom.Employee</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:UpdateRequest</wsdl-message>
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
- <!-- BEGIN manual modification -->
- <method-param-parts-mapping>
- <param-position>1</param-position>
- <param-type>javax.activation.DataHandler</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextXML</wsdl-message>
- <wsdl-message-part-name>xoppart</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <!-- END manual modification -->
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jaxrpc.samples.mtom.Status</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:UpdateResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
- <wsdl-return-value-mapping>
- <method-return-value>javax.xml.transform.Source</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeTextXMLResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
+ <service-endpoint-method-mapping>
+ <java-method-name>queryEmployee</java-method-name>
+ <wsdl-operation>queryEmployee</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jaxrpc.samples.mtom.Query</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:QueryRequest</wsdl-message>
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
- <service-endpoint-method-mapping>
- <java-method-name>sendMimeApplicationXML</java-method-name>
- <wsdl-operation>sendMimeApplicationXML</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
- <wsdl-message-part-name>message</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.samples.mtom.Employee</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:QueryResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
- <!-- BEGIN manual modification -->
- <method-param-parts-mapping>
- <param-position>1</param-position>
- <param-type>javax.xml.transform.Source</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
- <wsdl-message-part-name>xoppart</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <!-- END manual modification -->
+ </service-endpoint-interface-mapping>
- <wsdl-return-value-mapping>
- <method-return-value>javax.activation.DataHandler</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXMLResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
- <service-endpoint-method-mapping>
- <java-method-name>sendOctets</java-method-name>
- <wsdl-operation>sendOctets</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>java.lang.String</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
- <wsdl-message-part-name>message</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
-
- <!-- BEGIN manual modification -->
- <method-param-parts-mapping>
- <param-position>1</param-position>
- <param-type>byte[]</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXML</wsdl-message>
- <wsdl-message-part-name>xoppart</wsdl-message-part-name>
- <parameter-mode>IN</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- <!-- END manual modification -->
-
- <wsdl-return-value-mapping>
- <method-return-value>byte[]</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS="http://org.jboss.ws/samples/mtom">wsdlMsgNS:XOPTest_sendMimeApplicationXMLResponse</wsdl-message>
- <wsdl-message-part-name>result</wsdl-message-part-name>
- </wsdl-return-value-mapping>
- </service-endpoint-method-mapping>
-
- </service-endpoint-interface-mapping>
-
-
-</java-wsdl-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Modified: trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/webservices.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/webservices.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -8,14 +8,14 @@
<webservice-description>
<webservice-description-name>XOPTestService</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/EmployeeService.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
- <port-component-name>XOPTestPort</port-component-name>
- <wsdl-port>impl:XOPTestPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.XOPTest</service-endpoint-interface>
+ <port-component-name>EmployeeRecordsPort</port-component-name>
+ <wsdl-port>impl:EmployeeRecordsPort</wsdl-port>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.samples.mtom.EmployeeRecords</service-endpoint-interface>
<service-impl-bean>
- <servlet-link>XOPTestJSE</servlet-link>
+ <servlet-link>EmployeeEndpoint</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
Added: trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/EmployeeService.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/EmployeeService.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/EmployeeService.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="XOPTest" targetNamespace="http://org.jboss.ws/samples/mtom"
+ xmlns:tns="http://org.jboss.ws/samples/mtom"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://org.jboss.ws/samples/mtom"
+ xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
+
+ <import schemaLocation="http://www.w3.org/2005/05/xmlmime" namespace="http://www.w3.org/2005/05/xmlmime"/>
+
+ <element name="Employee">
+ <complexType>
+ <sequence>
+ <element name="firstname" type="xsd:string"/>
+ <element name="lastname" type="xsd:string"/>
+ <element name="legacyData" xmime:expectedContentTypes="text/xml" type="xmime:base64Binary"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="Status">
+ <complexType>
+ <sequence>
+ <element name="code" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="Query">
+ <complexType>
+ <sequence>
+ <element name="firstname" type="xsd:string"/>
+ <element name="lastname" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="UpdateRequest">
+ <part name="parameters" element="tns:Employee"/>
+ </message>
+
+ <message name="UpdateResponse">
+ <part name="result" element="tns:Status"/>
+ </message>
+
+ <message name="QueryRequest">
+ <part name="parameters" element="tns:Query"/>
+ </message>
+
+ <message name="QueryResponse">
+ <part name="result" element="tns:Employee"/>
+ </message>
+
+ <portType name="EmployeeRecords">
+ <operation name="updateEmployee">
+ <input message="tns:UpdateRequest"/>
+ <output message="tns:UpdateResponse"/>
+ </operation>
+ <operation name="queryEmployee">
+ <input message="tns:QueryRequest"/>
+ <output message="tns:QueryResponse"/>
+ </operation>
+ </portType>
+
+ <binding name="EmployeeRecordsBinding" type="tns:EmployeeRecords">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="updateEmployee">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+ </output>
+ </operation>
+ <operation name="queryEmployee">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="EmployeeService">
+ <port name="EmployeeRecordsPort" binding="tns:EmployeeRecordsBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
Deleted: trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/samples-override/mtom/WEB-INF/wsdl/TestService.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<definitions name="XOPTest" targetNamespace="http://org.jboss.ws/samples/mtom"
- xmlns:tns="http://org.jboss.ws/samples/mtom"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
-
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://org.jboss.ws/samples/mtom"
- xmlns:xmime="http://www.w3.org/2005/05/xmlmime">
- <import namespace="http://www.w3.org/2005/05/xmlmime"/>
- <complexType name="XOPBinary" >
- <simpleContent>
- <extension base="xsd:base64Binary" >
- <attribute ref="xmime:contentType"/>
- </extension>
- </simpleContent>
- </complexType>
- </schema>
- </types>
-
- <message name="XOPTest_sendMimeImageJPEG">
- <part name="message" type="xsd:string"/>
- <part name="xoppart" type="tns:XOPBinary"/>
- </message>
- <message name="XOPTest_sendMimeImageJPEGResponse">
- <part name="result" type="xmime:base64Binary"/>
- </message>
- <message name="XOPTest_sendMimeTextPlain">
- <part name="message" type="xsd:string"/>
- <part name="xoppart" type="tns:XOPBinary"/>
- </message>
- <message name="XOPTest_sendMimeTextPlainResponse">
- <part name="result" type="xmime:base64Binary"/>
- </message>
- <message name="XOPTest_sendMimeTextXML">
- <part name="message" type="xsd:string"/>
- <part name="xoppart" type="xmime:base64Binary"/>
- </message>
- <message name="XOPTest_sendMimeTextXMLResponse">
- <part name="result" type="xmime:base64Binary"/>
- </message>
- <message name="XOPTest_sendMimeApplicationXML">
- <part name="message" type="xsd:string"/>
- <part name="xoppart" type="xmime:base64Binary"/>
- </message>
- <message name="XOPTest_sendMimeApplicationXMLResponse">
- <part name="result" type="xmime:base64Binary"/>
- </message>
-
- <message name="XOPTest_sendOctets">
- <part name="message" type="xsd:string"/>
- <part name="xoppart" type="xsd:base64Binary"/>
- </message>
- <message name="XOPTest_sendOctetsResponse">
- <part name="result" type="xsd:base64Binary"/>
- </message>
-
- <portType name="XOPTest">
- <operation name="sendMimeImageJPEG">
- <input message="tns:XOPTest_sendMimeImageJPEG"/>
- <output message="tns:XOPTest_sendMimeImageJPEGResponse"/>
- </operation>
- <operation name="sendMimeTextPlain">
- <input message="tns:XOPTest_sendMimeTextPlain"/>
- <output message="tns:XOPTest_sendMimeTextPlainResponse"/>
- </operation>
- <operation name="sendMimeTextXML">
- <input message="tns:XOPTest_sendMimeTextXML"/>
- <output message="tns:XOPTest_sendMimeTextXMLResponse"/>
- </operation>
- <operation name="sendMimeApplicationXML">
- <input message="tns:XOPTest_sendMimeApplicationXML"/>
- <output message="tns:XOPTest_sendMimeApplicationXMLResponse"/>
- </operation>
-
- <operation name="sendOctets">
- <input message="tns:XOPTest_sendOctets"/>
- <output message="tns:XOPTest_sendOctetsResponse"/>
- </operation>
- </portType>
-
- <binding name="XOPTestBinding" type="tns:XOPTest">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
- <operation name="sendMimeImageJPEG">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </output>
- </operation>
- <operation name="sendMimeTextPlain">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </output>
- </operation>
- <operation name="sendMimeTextXML">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </output>
- </operation>
- <operation name="sendMimeApplicationXML">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </output>
- </operation>
- <operation name="sendOctets">
- <soap:operation soapAction=""/>
- <input>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </input>
- <output>
- <soap:body use="literal" namespace="http://org.jboss.ws/samples/mtom"/>
- </output>
- </operation>
- </binding>
-
- <service name="XOPTest">
- <port name="XOPTestPort" binding="tns:XOPTestBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
- </port>
- </service>
-</definitions>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/application-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/application-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -13,7 +13,7 @@
<wsdl-file>use overwrite in jboss-client.xml</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing</service-endpoint-interface>
</port-component-ref>
</service-ref>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/jboss-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/jboss-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/META-INF/jboss-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,6 +1,8 @@
<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/jaxrpc-mapping.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,12 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
<package-mapping>
<package-type>org.jboss.test.ws.jaxrpc.xop.doclit</package-type>
- <namespaceURI>http://jboss.org/test/ws/xop/doclit</namespaceURI>
+ <namespaceURI>http://jboss.org/test/ws/xop</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:>PingMsg</anonymous-type-qname>
+ <anonymous-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:>PingMsg</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>message</java-variable-name>
@@ -20,7 +20,7 @@
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse</java-type>
- <anonymous-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop/doclit'>typeNS:>PingMsgResponse</anonymous-type-qname>
+ <anonymous-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:>PingMsgResponse</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>xopContent</java-variable-name>
@@ -28,9 +28,81 @@
</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'>typeNS:>PingImage</anonymous-type-qname>
+ <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'>typeNS:>PingImageResponse</anonymous-type-qname>
+ <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'>typeNS:>PingSource</anonymous-type-qname>
+ <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'>typeNS:>PingSourceResponse</anonymous-type-qname>
+ <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'>typeNS:>PingDataHandler</anonymous-type-qname>
+ <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'>typeNS:>PingDataHandlerResponse</anonymous-type-qname>
+ <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'>serviceNS:TestService</wsdl-service-name>
+ <service-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPingService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://jboss.org/test/ws/xop'>serviceNS:TestService</wsdl-service-name>
<port-mapping>
<port-name>TestServicePort</port-name>
<java-port-name>TestServicePort</java-port-name>
@@ -38,9 +110,10 @@
</service-interface-mapping>
<service-endpoint-interface-mapping>
- <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'>portTypeNS:TestService</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://jboss.org/test/ws/xop/doclit'>bindingNS:TestServiceBinding</wsdl-binding>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://jboss.org/test/ws/xop'>portTypeNS:TestService</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://jboss.org/test/ws/xop'>bindingNS:TestServiceBinding</wsdl-binding>
+
<service-endpoint-method-mapping>
<java-method-name>ping</java-method-name>
<wsdl-operation>ping</wsdl-operation>
@@ -48,16 +121,74 @@
<param-position>0</param-position>
<param-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsg</param-type>
<wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgNS:PingIn</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:PingIn</wsdl-message>
<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.PingMsgResponse</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/doclit'>wsdlMsgNS:PingOut</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:PingOut</wsdl-message>
<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'>wsdlMsgNS:PingImageIn</wsdl-message>
+ <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'>wsdlMsgNS:PingImageOut</wsdl-message>
+ <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'>wsdlMsgNS:PingSourceIn</wsdl-message>
+ <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'>wsdlMsgNS:PingSourceOut</wsdl-message>
+ <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'>wsdlMsgNS:PingDataHandlerIn</wsdl-message>
+ <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'>wsdlMsgNS:PingDataHandlerOut</wsdl-message>
+ <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
+</java-wsdl-mapping>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/web.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/web.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -7,7 +7,7 @@
<servlet>
<servlet-name>TestService</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.xop.doclit.TestServiceImpl</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPingImpl</servlet-class>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/webservices.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/webservices.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://jboss.org/test/ws/xop/doclit"
+ xmlns:impl="http://jboss.org/test/ws/xop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
<webservice-description>
<webservice-description-name>XOP DOC/Lit without handlers</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/service-doclit.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>TestServicePort</port-component-name>
<wsdl-port>impl:TestServicePort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TestService</servlet-link>
</service-impl-bean>
Deleted: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/TestService.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:s="http://www.w3.org/2001/XMLSchema"
- xmlns:s0="http://jboss.org/test/ws/xop/doclit"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:tns="http://jboss.org/test/ws/xop/doclit"
- targetNamespace="http://jboss.org/test/ws/xop/doclit"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://jboss.org/test/ws/xop/doclit"
- xmlns:xmime="http://www.w3.org/2005/05/xmlmime" >
-
- <import namespace="http://www.w3.org/2005/05/xmlmime"/>
-
- <s:element name="PingMsg">
- <s:complexType>
- <s:sequence>
- <s:element name="message" minOccurs="0" maxOccurs="1" type="s:string" />
- <s:element name="xopContent" minOccurs="0" maxOccurs="1" type="s:base64Binary"/>
- </s:sequence>
- </s:complexType>
- </s:element>
- <s:element name="PingMsgResponse">
- <s:complexType>
- <s:sequence>
- <s:element name="xopContent" minOccurs="0" maxOccurs="1" xmime:expectedContentTypes="text/plain" type="xmime:base64Binary"/>
- </s:sequence>
- </s:complexType>
- </s:element>
-
- </s:schema>
- </types>
-
- <message name="PingIn">
- <part name="parameters" element="s0:PingMsg" />
- </message>
- <message name="PingOut">
- <part name="parameters" element="s0:PingMsgResponse" />
- </message>
-
- <portType name="TestService">
- <operation name="ping">
- <input message="s0:PingIn" />
- <output message="s0:PingOut" />
- </operation>
- </portType>
-
- <binding name="TestServiceBinding" type="s0:TestService">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="ping">
- <soap:operation soapAction="http://jboss.org/test/ws/xop/doclit/Ping" style="document" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="TestService">
- <port name="TestServicePort" binding="s0:TestServiceBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL" />
- </port>
- </service>
-</definitions>
\ No newline at end of file
Added: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/service-doclit.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/service-doclit.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/service-doclit.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://jboss.org/test/ws/xop"
+ targetNamespace="http://jboss.org/test/ws/xop"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xsd:import schemaLocation="xsd0.xsd"/>
+ </wsdl:types>
+
+ <wsdl:import namespace="http://jboss.org/test/ws/xop" location="wsdl0.wsdl"/>
+
+ <wsdl:binding name="TestServiceBinding" type="tns:TestService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="ping">
+ <soap:operation soapAction="http://jboss.org/test/ws/xop/Ping" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingImage">
+ <soap:operation soapAction="http://jboss.org/test/ws/xop/PingImage" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingSource">
+ <soap:operation soapAction="http://jboss.org/test/ws/xop/PingSource" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingDataHandler">
+ <soap:operation soapAction="http://jboss.org/test/ws/xop/PingDataHandler" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="TestService">
+ <wsdl:port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Added: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/wsdl0.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/wsdl0.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/wsdl0.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,60 @@
+<?xml version="1.0" ?>
+
+<wsdl:definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://jboss.org/test/ws/xop"
+ targetNamespace="http://jboss.org/test/ws/xop"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:message name="PingIn">
+ <wsdl:part name="parameters" element="tns:PingMsg" />
+ </wsdl:message>
+
+ <wsdl:message name="PingOut">
+ <wsdl:part name="parameters" element="tns:PingMsgResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="PingImageIn">
+ <wsdl:part name="parameters" element="tns:PingImage" />
+ </wsdl:message>
+ <wsdl:message name="PingImageOut">
+ <wsdl:part name="parameters" element="tns:PingImageResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="PingSourceIn">
+ <wsdl:part name="parameters" element="tns:PingSource" />
+ </wsdl:message>
+ <wsdl:message name="PingSourceOut">
+ <wsdl:part name="parameters" element="tns:PingSourceResponse" />
+ </wsdl:message>
+
+ <wsdl:message name="PingDataHandlerIn">
+ <wsdl:part name="parameters" element="tns:PingDataHandler" />
+ </wsdl:message>
+ <wsdl:message name="PingDataHandlerOut">
+ <wsdl:part name="parameters" element="tns:PingDataHandlerResponse" />
+ </wsdl:message>
+
+ <wsdl:portType name="TestService">
+ <wsdl:operation name="ping">
+ <wsdl:input message="tns:PingIn" />
+ <wsdl:output message="tns:PingOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingImage">
+ <wsdl:input message="tns:PingImageIn" />
+ <wsdl:output message="tns:PingImageOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingSource">
+ <wsdl:input message="tns:PingSourceIn" />
+ <wsdl:output message="tns:PingSourceOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingDataHandler">
+ <wsdl:input message="tns:PingDataHandlerIn" />
+ <wsdl:output message="tns:PingDataHandlerOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
\ No newline at end of file
Added: trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/xsd0.xsd
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/xsd0.xsd 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/WEB-INF/wsdl/xsd0.xsd 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,108 @@
+<?xml version="1.0" ?>
+<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://jboss.org/test/ws/xop"
+ xmlns:xmime="http://www.w3.org/2005/05/xmlmime" >
+
+ <s: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>
+ <s:element name="message" minOccurs="0" maxOccurs="1" type="s:string" />
+ <s:element name="xopContent" minOccurs="0" maxOccurs="1" type="s:base64Binary"/>
+ </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="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>
\ No newline at end of file
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/application-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/application-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -13,7 +13,7 @@
<wsdl-file>use overwrite in jboss-client.xml</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing</service-endpoint-interface>
</port-component-ref>
<handler>
<handler-name>XOPInlineHandler</handler-name>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/jboss-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/jboss-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/META-INF/jboss-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,6 +1,8 @@
<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
Modified: trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/WEB-INF/webservices.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/doclit/handlerconfig/WEB-INF/webservices.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://jboss.org/test/ws/xop/doclit"
+ xmlns:impl="http://jboss.org/test/ws/xop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
<webservice-description>
<webservice-description-name>XOP DOC/Lit with handlers</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/service-doclit.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>TestServicePort</port-component-name>
<wsdl-port>impl:TestServicePort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.doclit.XOPPing</service-endpoint-interface>
<handler>
<handler-name>XOPInlineHandler</handler-name>
<handler-class>org.jboss.test.ws.jaxrpc.xop.doclit.InlineHandler</handler-class>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/application-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/application-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -13,7 +13,7 @@
<wsdl-file>use overwrite in jboss-client.xml</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing</service-endpoint-interface>
</port-component-ref>
</service-ref>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/jboss-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/jboss-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/META-INF/jboss-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,6 +1,8 @@
<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/jaxrpc-mapping.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/jaxrpc-mapping.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -5,12 +5,16 @@
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
<package-mapping>
<package-type>org.jboss.test.ws.jaxrpc.xop.rpclit</package-type>
- <namespaceURI>http://jboss.org/test/ws/xop/rpclit</namespaceURI>
+ <namespaceURI>http://jboss.org/test/ws/xop</namespaceURI>
</package-mapping>
-
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jaxrpc.xop.shared</package-type>
+ <namespaceURI>http://jboss.org/test/ws/xop</namespaceURI>
+ </package-mapping>
+
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsg</java-type>
- <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop/rpclit'>typeNS:PingInType</root-type-qname>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingInType</root-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>message</java-variable-name>
@@ -24,7 +28,7 @@
<java-xml-type-mapping>
<java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsgResponse</java-type>
- <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop/rpclit'>typeNS:PingOutType</root-type-qname>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingOutType</root-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>xopContent</java-variable-name>
@@ -32,9 +36,81 @@
</variable-mapping>
</java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jaxrpc.xop.shared.PingImage</java-type>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingImageType</root-type-qname>
+ <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>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingImageOutType</root-type-qname>
+ <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>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingSourceType</root-type-qname>
+ <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>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingSourceOutType</root-type-qname>
+ <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>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingDataHandlerType</root-type-qname>
+ <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>
+ <root-type-qname xmlns:typeNS='http://jboss.org/test/ws/xop'>typeNS:PingDataHandlerOutType</root-type-qname>
+ <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.rpclit.TestService_Service</service-interface>
- <wsdl-service-name xmlns:serviceNS='http://jboss.org/test/ws/xop/rpclit'>serviceNS:TestService</wsdl-service-name>
+ <service-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPingService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://jboss.org/test/ws/xop'>serviceNS:TestService</wsdl-service-name>
<port-mapping>
<port-name>TestServicePort</port-name>
<java-port-name>TestServicePort</java-port-name>
@@ -42,25 +118,26 @@
</service-interface-mapping>
<service-endpoint-interface-mapping>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS='http://jboss.org/test/ws/xop/rpclit'>portTypeNS:TestService</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://jboss.org/test/ws/xop/rpclit'>bindingNS:TestServiceBinding</wsdl-binding>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://jboss.org/test/ws/xop'>portTypeNS:TestService</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://jboss.org/test/ws/xop'>bindingNS:TestServiceBinding</wsdl-binding>
+
<service-endpoint-method-mapping>
- <java-method-name>pingComplex</java-method-name>
- <wsdl-operation>pingComplex</wsdl-operation>
+ <java-method-name>ping</java-method-name>
+ <wsdl-operation>ping</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.jboss.test.ws.jaxrpc.xop.shared.PingMsg</param-type>
<wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/rpclit'>wsdlMsgNS:PingIn</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:PingIn</wsdl-message>
<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.PingMsgResponse</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/rpclit'>wsdlMsgNS:PingOut</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:PingOut</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
@@ -72,7 +149,7 @@
<param-position>0</param-position>
<param-type>java.lang.String</param-type>
<wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/rpclit'>wsdlMsgNS:OctetsIn</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:OctetsIn</wsdl-message>
<wsdl-message-part-name>message</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
@@ -81,16 +158,74 @@
<param-position>1</param-position>
<param-type>byte[]</param-type>
<wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/rpclit'>wsdlMsgNS:OctetsIn</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:OctetsIn</wsdl-message>
<wsdl-message-part-name>xopContent</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>byte[]</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop/rpclit'>wsdlMsgNS:OctetsOut</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/xop'>wsdlMsgNS:OctetsOut</wsdl-message>
<wsdl-message-part-name>result</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'>wsdlMsgNS:PingImageIn</wsdl-message>
+ <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'>wsdlMsgNS:PingImageOut</wsdl-message>
+ <wsdl-message-part-name>result</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'>wsdlMsgNS:PingSourceIn</wsdl-message>
+ <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'>wsdlMsgNS:PingSourceOut</wsdl-message>
+ <wsdl-message-part-name>result</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'>wsdlMsgNS:PingDataHandlerIn</wsdl-message>
+ <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'>wsdlMsgNS:PingDataHandlerOut</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+
</service-endpoint-interface-mapping>
-</java-wsdl-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -7,7 +7,7 @@
<servlet>
<servlet-name>TestService</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.xop.rpclit.TestServiceImpl</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPingImpl</servlet-class>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/webservices.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/webservices.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://jboss.org/test/ws/xop/rpclit"
+ xmlns:impl="http://jboss.org/test/ws/xop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
<webservice-description>
<webservice-description-name>XOP RPC/Lit without handlers</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/service-rpclit.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>TestServicePort</port-component-name>
<wsdl-port>impl:TestServicePort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TestService</servlet-link>
</service-impl-bean>
Deleted: trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/TestService.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/TestService.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<definitions
- xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:s="http://www.w3.org/2001/XMLSchema"
- xmlns:s0="http://jboss.org/test/ws/xop/rpclit"
- xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:tns="http://jboss.org/test/ws/xop/rpclit"
- targetNamespace="http://jboss.org/test/ws/xop/rpclit"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://jboss.org/test/ws/xop/rpclit"
- xmlns:xmime="http://www.w3.org/2005/05/xmlmime" >
-
- <import namespace="http://www.w3.org/2005/05/xmlmime"/>
-
- <s:complexType name="PingInType">
- <s:sequence>
- <s:element name="message" minOccurs="0" maxOccurs="1" type="s:string" />
- <s:element name="xopContent" minOccurs="0" maxOccurs="1" xmime:expectedContentTypes="text/plain" type="xmime:base64Binary"/>
- </s:sequence>
- </s:complexType>
-
- <s:complexType name="PingOutType">
- <s:sequence>
- <s:element name="xopContent" minOccurs="0" maxOccurs="1" xmime:expectedContentTypes="text/plain" type="s:base64Binary"/>
- </s:sequence>
- </s:complexType>
-
- </s:schema>
- </types>
-
- <message name="PingIn">
- <part name="parameters" type="tns:PingInType" />
- </message>
- <message name="PingOut">
- <part name="result" type="tns:PingOutType" />
- </message>
-
- <message name="OctetsIn">
- <part name="message" type="s:string" />
- <part name="xopContent" type="s:base64Binary" />
- </message>
- <message name="OctetsOut">
- <part name="result" type="s:base64Binary" />
- </message>
-
- <portType name="TestService">
- <operation name="pingComplex" parameterOrder='parameters'>
- <input message="tns:PingIn" />
- <output message="tns:PingOut" />
- </operation>
-
- <operation name="pingSimple">
- <input message="tns:OctetsIn" />
- <output message="tns:OctetsOut" />
- </operation>
- </portType>
-
- <binding name="TestServiceBinding" type="tns:TestService">
- <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
- <operation name="pingComplex">
- <soap:operation soapAction="" style="rpc" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- <operation name="pingSimple">
- <soap:operation soapAction="http://jboss.org/test/ws/xop/rpclit/PingSimple" style="rpc" />
- <input>
- <soap:body use="literal" />
- </input>
- <output>
- <soap:body use="literal" />
- </output>
- </operation>
- </binding>
-
- <service name="TestService">
- <port name="TestServicePort" binding="tns:TestServiceBinding">
- <soap:address location="REPLACE_WITH_ACTUAL_URL" />
- </port>
- </service>
-</definitions>
\ No newline at end of file
Added: trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/service-rpclit.wsdl
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/service-rpclit.wsdl 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/WEB-INF/wsdl/service-rpclit.wsdl 2006-12-01 15:44:10 UTC (rev 1529)
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:tns="http://jboss.org/test/ws/xop"
+ targetNamespace="http://jboss.org/test/ws/xop"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://jboss.org/test/ws/xop"
+ xmlns:xmime="http://www.w3.org/2005/05/xmlmime" >
+
+ <xsd:import namespace="http://www.w3.org/2005/05/xmlmime"/>
+
+ <xsd:complexType name="PingInType">
+ <xsd:sequence>
+ <xsd:element name="message" minOccurs="0" maxOccurs="1" type="xsd:string" />
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingOutType">
+ <xsd:sequence>
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingImageType">
+ <xsd:sequence>
+ <xsd:element name="message" minOccurs="0" maxOccurs="1" type="xsd:string" />
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingImageOutType">
+ <xsd:sequence>
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingSourceType">
+ <xsd:sequence>
+ <xsd:element name="message" minOccurs="0" maxOccurs="1" type="xsd:string" />
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingSourceOutType">
+ <xsd:sequence>
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingDataHandlerType">
+ <xsd:sequence>
+ <xsd:element name="message" minOccurs="0" maxOccurs="1" type="xsd:string" />
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="PingDataHandlerOutType">
+ <xsd:sequence>
+ <xsd:element name="xopContent" minOccurs="0" maxOccurs="1" type="xsd:base64Binary"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+
+ </wsdl:types>
+
+ <wsdl:message name="PingIn">
+ <wsdl:part name="parameters" type="tns:PingInType" />
+ </wsdl:message>
+
+ <wsdl:message name="PingOut">
+ <wsdl:part name="result" type="tns:PingOutType" />
+ </wsdl:message>
+
+ <wsdl:message name="OctetsIn">
+ <wsdl:part name="message" type="xsd:string" />
+ <wsdl:part name="xopContent" type="xsd:base64Binary" />
+ </wsdl:message>
+
+ <wsdl:message name="OctetsOut">
+ <wsdl:part name="result" type="xsd:base64Binary" />
+ </wsdl:message>
+
+ <wsdl:message name="PingImageIn">
+ <wsdl:part name="parameters" type="tns:PingImageType" />
+ </wsdl:message>
+ <wsdl:message name="PingImageOut">
+ <wsdl:part name="result" type="tns:PingImageOutType" />
+ </wsdl:message>
+
+ <wsdl:message name="PingSourceIn">
+ <wsdl:part name="parameters" type="tns:PingSourceType" />
+ </wsdl:message>
+ <wsdl:message name="PingSourceOut">
+ <wsdl:part name="result" type="tns:PingSourceOutType" />
+ </wsdl:message>
+
+ <wsdl:message name="PingDataHandlerIn">
+ <wsdl:part name="parameters" type="tns:PingDataHandlerType" />
+ </wsdl:message>
+ <wsdl:message name="PingDataHandlerOut">
+ <wsdl:part name="result" type="tns:PingDataHandlerOutType" />
+ </wsdl:message>
+
+ <wsdl:portType name="TestService">
+ <wsdl:operation name="ping">
+ <wsdl:input message="tns:PingIn" />
+ <wsdl:output message="tns:PingOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingSimple">
+ <wsdl:input message="tns:OctetsIn" />
+ <wsdl:output message="tns:OctetsOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingImage">
+ <wsdl:input message="tns:PingImageIn" />
+ <wsdl:output message="tns:PingImageOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingSource">
+ <wsdl:input message="tns:PingSourceIn" />
+ <wsdl:output message="tns:PingSourceOut" />
+ </wsdl:operation>
+ <wsdl:operation name="pingDataHandler">
+ <wsdl:input message="tns:PingDataHandlerIn" />
+ <wsdl:output message="tns:PingDataHandlerOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+
+ <wsdl:binding name="TestServiceBinding" type="tns:TestService">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
+ <wsdl:operation name="ping">
+ <soap:operation soapAction="" style="rpc" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingSimple">
+ <soap:operation soapAction="http://jboss.org/test/ws/xop/PingSimple" style="rpc" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingImage">
+ <soap:operation soapAction="" style="rpc" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingSource">
+ <soap:operation soapAction="" style="rpc" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingDataHandler">
+ <soap:operation soapAction="" style="rpc" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="TestService">
+ <wsdl:port name="TestServicePort" binding="tns:TestServiceBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/application-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/application-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/application-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -13,7 +13,7 @@
<wsdl-file>use overwrite in jboss-client.xml</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing</service-endpoint-interface>
</port-component-ref>
<handler>
<handler-name>XOPInlineHandler</handler-name>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/jboss-client.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/jboss-client.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/META-INF/jboss-client.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,6 +1,8 @@
<?xml version='1.0' encoding='UTF-8' ?>
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
+<!DOCTYPE jboss-client PUBLIC
+ "-//JBoss//DTD Application Client 4.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
Modified: trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/WEB-INF/webservices.xml
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/WEB-INF/webservices.xml 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/rpclit/handlerconfig/WEB-INF/webservices.xml 2006-12-01 15:44:10 UTC (rev 1529)
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://jboss.org/test/ws/xop/rpclit"
+ xmlns:impl="http://jboss.org/test/ws/xop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
version="1.1">
<webservice-description>
<webservice-description-name>XOP RPC/Lit with handlers</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/service-rpclit.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>TestServicePort</port-component-name>
<wsdl-port>impl:TestServicePort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.TestService_PortType</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.xop.rpclit.XOPPing</service-endpoint-interface>
<handler>
<handler-name>XOPInlineHandler</handler-name>
<handler-class>org.jboss.test.ws.jaxrpc.xop.rpclit.InlineHandler</handler-class>
Modified: trunk/src/test/resources/jaxrpc/xop/schema.xsd
===================================================================
--- trunk/src/test/resources/jaxrpc/xop/schema.xsd 2006-12-01 13:40:09 UTC (rev 1528)
+++ trunk/src/test/resources/jaxrpc/xop/schema.xsd 2006-12-01 15:44:10 UTC (rev 1529)
@@ -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>
18 years
JBossWS SVN: r1528 - in branches/jbossws-1.0: docs/user-guide/project/en/modules/installation src/ant
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-01 08:40:09 -0500 (Fri, 01 Dec 2006)
New Revision: 1528
Modified:
branches/jbossws-1.0/docs/user-guide/project/en/modules/installation/install-tomcat.xml
branches/jbossws-1.0/src/ant/build-release.xml
Log:
JBWS-1401 - Added required jars to distribution and updated user guide.
Modified: branches/jbossws-1.0/docs/user-guide/project/en/modules/installation/install-tomcat.xml
===================================================================
--- branches/jbossws-1.0/docs/user-guide/project/en/modules/installation/install-tomcat.xml 2006-12-01 03:53:14 UTC (rev 1527)
+++ branches/jbossws-1.0/docs/user-guide/project/en/modules/installation/install-tomcat.xml 2006-12-01 13:40:09 UTC (rev 1528)
@@ -25,16 +25,22 @@
</listitem>
<listitem>
<para>
- Copy activation.jar, mailapi.jar, log4j.jar to ${tomcat.home}/common/lib.
+ Copy the following jars to ${tomcat.home}/common/lib
+ <itemizedlist>
+ <listitem>activation.jar</listitem>
+ <listitem>jbossws-core.jar</listitem>
+ <listitem>jbossws-tomcat-integration.jar</listitem>
+ <listitem>jbossws-thirdparty.jar</listitem>
+ <listitem>jboss-jaxrpc.jar</listitem>
+ <listitem>jboss-jaxws.jar</listitem>
+ <listitem>jboss-saaj.jar</listitem>
+ <listitem>log4j.jar</listitem>
+ <listitem>mailapi.jar</listitem>
+ </itemizedlist>
</para>
</listitem>
<listitem>
<para>
- Copy jbossws-core.jar, jbossws-tomcat-integration.jar, jbossws-thirdparty.jar to ${tomcat.home}/common/lib.
- </para>
- </listitem>
- <listitem>
- <para>
Copy jbossws.war to ${tomcat.home}/webapps.
</para>
</listitem>
Modified: branches/jbossws-1.0/src/ant/build-release.xml
===================================================================
--- branches/jbossws-1.0/src/ant/build-release.xml 2006-12-01 03:53:14 UTC (rev 1527)
+++ branches/jbossws-1.0/src/ant/build-release.xml 2006-12-01 13:40:09 UTC (rev 1528)
@@ -182,6 +182,9 @@
<include name="jbossws-core.jar"/>
<include name="jbossws-tomcat-integration.jar"/>
<include name="jbossws-thirdparty.jar"/>
+ <include name="jboss-jaxws.jar"/>
+ <include name="jboss-jaxrpc.jar"/>
+ <include name="jboss-saaj.jar"/>
</fileset>
</copy>
<copy todir="${build.bin.dist}/lib/tomcat/webapps" overwrite="true">
18 years
JBossWS SVN: r1527 - in trunk/src: main/java/org/jboss/ws/integration/jboss50 main/java/org/jboss/ws/metadata/builder/jaxws main/java/org/jboss/ws/metadata/wsdl main/java/org/jboss/ws/tools/jaxws main/resources/jbossws.war/JBoss/WEB-INF test/java/org/jboss/test/ws/jaxws/anonymous test/java/org/jboss/test/ws/jaxws/binding test/java/org/jboss/test/ws/jaxws/context test/java/org/jboss/test/ws/jaxws/endpoint test/java/org/jboss/test/ws/jaxws/exception test/java/org/jboss/test/ws/jaxws/jbws1190
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-11-30 22:53:14 -0500 (Thu, 30 Nov 2006)
New Revision: 1527
Added:
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java
trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
trunk/src/main/resources/jbossws.war/JBoss/WEB-INF/web.xml
trunk/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointInterface.java
trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointInterface.java
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/RegistrationService.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/DocWrappedServiceImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/ExampleServiceImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/TestEndpointImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSEBean03.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderMgmtBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/cc/CCVerificationBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java
Log:
Re-add context servlets that were dropped during the merge from 1.0
Refactor WSDL11Writer to support multiple WSDL files
Fix processing of @WebService to be inline with the spec
Add support for differing namespaces on SEI and implementation bean
Added: trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -0,0 +1,46 @@
+/*
+ * 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.integration.jboss50;
+
+// $Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.CommonContextServlet;
+import org.jboss.ws.server.ServiceEndpointManagerFactory;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class JBossContextServlet extends CommonContextServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(JBossContextServlet.class);
+
+ protected void initServiceEndpointManager()
+ {
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossContextServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -0,0 +1,93 @@
+/*
+ * 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.integration.jboss50;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.server.ServiceEndpoint;
+import org.jboss.ws.server.ServiceEndpointManager;
+import org.jboss.ws.server.ServiceEndpointManagerFactory;
+
+/**
+ * A servlet that reports the serviceURL for a given service ID.
+ * <p/>
+ * When the web service client ENC is setup, it may contain port-component-link
+ * entries that point to service endpoints in the same top level deployment.
+ * The final serviceURL of those endpoints will become available after the
+ * reference to the javax.xml.rpc.Service is bound to JNDI.
+ * <p/>
+ * When the client does a lookup of the javax.xml.rpc.Service from JNDI the ObjectFactory
+ * will contact this servlet for the final serviceURL. It is acceptable that the client
+ * wsdl does not contain the correct serviceURL if the client is using the port-component-link element.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 29-May-2004
+ */
+public class PortComponentLinkServlet extends HttpServlet
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(PortComponentLinkServlet.class);
+
+ protected ServiceEndpointManager epManager;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ epManager = factory.getServiceEndpointManager();
+ }
+
+ /**
+ * Get the serviceURL as string for a given serviceID.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String pcLink = req.getParameter("pcLink");
+ if (pcLink == null)
+ throw new IllegalArgumentException("Cannot obtain request parameter 'pcLink'");
+
+ ServiceEndpoint serviceEndpoint = epManager.resolvePortComponentLink(pcLink);
+ ;
+ if (serviceEndpoint == null)
+ throw new WSException("Cannot resolve port-component-link: " + pcLink);
+
+ res.setContentType("text/plain");
+ PrintWriter out = res.getWriter();
+
+ String endpointAddress = serviceEndpoint.getServiceEndpointInfo().getServerEndpointMetaData().getEndpointAddress();
+ out.println(endpointAddress);
+
+ log.debug("Resolved " + pcLink + " to: " + endpointAddress);
+ out.close();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/integration/jboss50/PortComponentLinkServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -88,10 +88,10 @@
import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.metadata.wsdl.WSDLWriter;
+import org.jboss.ws.metadata.wsdl.WSDLWriter.ResolvedWriter;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.server.ServerConfig;
-import org.jboss.ws.server.ServerConfigFactory;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
import org.jboss.ws.utils.HolderUtils;
@@ -111,216 +111,290 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @since 15-Oct-2005
*/
+@SuppressWarnings("deprecation")
public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
{
+ private static class EndpointResult
+ {
+ private Class<?> klass;
+ private ServerEndpointMetaData semd;
+ private ServiceMetaData smd;
+ private String wsdlLocation;
+ }
+
// provide logging
private static final Logger log = Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
-
- private WrapperGenerator wrapperGenerator;
private List<Class> javaTypes = new ArrayList<Class>();
+ private JAXBRIContext jaxbCtx;
private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
- private JAXBRIContext jaxbCtx;
+ private WrapperGenerator wrapperGenerator;
+
public JAXWSWebServiceMetaDataBuilder()
{
}
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ private void addFault(OperationMetaData omd, Class<?> exception)
{
- WebService anWebService = sepClass.getAnnotation(WebService.class);
- if (anWebService == null)
- throw new WSException("Cannot obtain @WebService annotation from: " + sepClass.getName());
+ if (omd.isOneWay())
+ throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
+ + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
- try
- {
- Class<?> seiClass = null;
- String seiName = null;
+ WebFault annotation = exception.getAnnotation(WebFault.class);
- if (anWebService.endpointInterface().length() > 0)
- {
- seiName = anWebService.endpointInterface();
- seiClass = udi.classLoader.loadClass(seiName);
- anWebService = seiClass.getAnnotation(WebService.class);
+ String name;
+ String namespace;
+ String faultBeanName = null;
- if (anWebService == null)
- throw new WSException("Interface does not have a @WebService annotation: " + seiName);
- }
- else
- {
+ // Only the element name is effected by @WebFault, the type uses the same convention
+ QName xmlType = new QName(omd.getQName().getNamespaceURI(), exception.getSimpleName());
- WebService seiAnnotation = null;
+ /*
+ * If @WebFault is present, and the exception contains getFaultInfo, the
+ * return value should be used. Otherwise we need to generate the bean.
+ */
+ boolean generate = true;
+ if (annotation != null)
+ {
+ name = annotation.name();
+ namespace = annotation.targetNamespace();
+ if (namespace.length() == 0)
+ namespace = omd.getQName().getNamespaceURI();
- for (Class<?> potentialSEI : sepClass.getInterfaces())
- {
- if (potentialSEI.isAnnotationPresent(WebService.class))
- {
- seiClass = potentialSEI;
- seiName = seiClass.getName();
- seiAnnotation = sepClass.getAnnotation(WebService.class);
- break;
- }
- }
-
- if (seiAnnotation != null)
- anWebService = seiAnnotation;
+ Class<?> faultBean = getFaultInfo(exception);
+ if (faultBean != null)
+ {
+ generate = false;
+ faultBeanName = faultBean.getName();
}
+ }
+ else
+ {
+ name = xmlType.getLocalPart();
+ namespace = xmlType.getNamespaceURI();
+ }
- // Clear the java types, etc.
- resetMetaDataBuilder(udi.classLoader);
+ if (faultBeanName == null)
+ faultBeanName = JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) + ".jaxws." + exception.getSimpleName() + "Bean";
- Class<?> wsClass = (seiClass != null ? seiClass : sepClass);
+ QName xmlName = new QName(namespace, name);
- WSDLUtils wsdlUtils = WSDLUtils.getInstance();
+ FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
+ fmd.setFaultBeanName(faultBeanName);
- String name = anWebService.name();
- if (name.length() == 0)
- name = wsdlUtils.getJustClassName(wsClass);
+ if (generate)
+ wrapperGenerator.generate(fmd);
- String serviceName = anWebService.serviceName();
- if (serviceName.length() == 0)
- serviceName = name + "Service";
+ javaTypes.add(fmd.getFaultBean());
+ typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
- String targetNS = anWebService.targetNamespace();
- if (targetNS.length() == 0)
- targetNS = wsdlUtils.getTypeNamespace(wsClass);
+ omd.addFault(fmd);
+ }
- String portName = anWebService.portName();
- if (portName.length() == 0)
- portName = name + "Port";
+ private String convertToVariable(String localName)
+ {
+ return JAXBRIContext.mangleNameToVariableName(localName);
+ }
- ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(targetNS, serviceName));
- wsMetaData.addService(serviceMetaData);
+ private String[] convertTypeArguments(Class rawType, Type type)
+ {
+ if (!Collection.class.isAssignableFrom(rawType) && !Map.class.isAssignableFrom(rawType))
+ return null;
- // Setup the ServerEndpointMetaData
- QName portQName = new QName(targetNS, portName);
- QName portTypeQName = new QName(targetNS, name);
- ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, portQName, portTypeQName, EndpointMetaData.Type.JAXWS);
- sepMetaData.setLinkName(linkName);
+ if (!(type instanceof ParameterizedType))
+ return null;
- // Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration = MetaDataBuilder.getWsSecurityConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
+ ParameterizedType paramType = (ParameterizedType)type;
+ Type[] arguments = paramType.getActualTypeArguments();
+ String[] ret = new String[arguments.length];
+ for (int i = 0; i < arguments.length; i++)
+ ret[i] = JavaUtils.erasure(arguments[i]).getName();
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
+ return ret;
+ }
- serviceMetaData.addEndpoint(sepMetaData);
+ private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method method)
+ {
+ String requestWrapperType = null;
+ QName xmlName = operation.getQName();
+ QName xmlType = xmlName;
+ if (method.isAnnotationPresent(RequestWrapper.class))
+ {
+ RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
- // Process an optional @SOAPBinding annotation
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(sepMetaData, wsClass);
+ String localName = anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(sepMetaData, wsClass);
+ if (anReqWrapper.className().length() > 0)
+ requestWrapperType = anReqWrapper.className();
+ }
- // Init the transport guarantee
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
-
- // Process web methods
- processWebMethods(sepMetaData, wsClass);
+ // Conformance 3.18, the default value must be the same as the method name
+ if (requestWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
+ requestWrapperType = packageName + "." + JavaUtils.capitalize(method.getName());
+ }
- // Initialize types
- createJAXBContext(sepMetaData);
- populateXmlTypes(sepMetaData);
+ // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type name
+ ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName, xmlType, requestWrapperType);
+ wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.addParameter(wrapperParameter);
- // Process or generate WSDL
- String wsdlLocation = anWebService.wsdlLocation();
- processOrGenerateWSDL(wsClass, serviceMetaData, wsdlLocation, sepMetaData);
+ return wrapperParameter;
+ }
- // Read the generated WSDL and initialize the schema model
- // FIXME - This should be removed
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
+ private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method method)
+ {
+ QName operationQName = operation.getQName();
+ QName xmlName = new QName(operationQName.getNamespaceURI(), operationQName.getLocalPart() + "Response");
+ QName xmlType = xmlName;
- // Set the endpoint address
- processPortComponent(udi, wsClass, linkName, sepMetaData);
+ String responseWrapperType = null;
+ if (method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
+ String localName = anResWrapper.localName().length() > 0 ? anResWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
- // replace the SOAP address
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
+ if (anResWrapper.className().length() > 0)
+ responseWrapperType = anResWrapper.className();
+ }
- // Process an optional @SOAPMessageHandlers annotation
- if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- log.warn("@SOAPMessageHandlers is deprecated as of JSR-181 2.0 with no replacement.");
+ if (responseWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
+ responseWrapperType = packageName + "." + JavaUtils.capitalize(method.getName()) + "Response";
+ }
- // Add pre handlers
- WSEndpointConfigJAXWS jaxrpcConfig = (WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.PRE));
+ ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType, responseWrapperType);
+ retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.setReturnParameter(retMetaData);
- // Process an optional @HandlerChain annotation
- if (sepClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, sepClass);
- else if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(sepMetaData, wsClass);
+ return retMetaData;
+ }
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.POST));
+ private Class<?> getFaultInfo(Class<?> exception)
+ {
+ try
+ {
+ Method method = exception.getMethod("getFaultInfo");
+ Class<?> returnType = method.getReturnType();
+ if (returnType == void.class)
+ return null;
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
+ return returnType;
}
- catch (RuntimeException rte)
+ catch (SecurityException e)
{
- throw rte;
+ throw new WSException("Unexpected security exception: " + e.getMessage(), e);
}
- catch (Exception ex)
+ catch (NoSuchMethodException e)
{
- throw new WSException("Cannot build meta data: " + ex.getMessage(), ex);
+ return null;
}
}
- protected void resetMetaDataBuilder(ClassLoader loader)
+ private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
{
- wrapperGenerator = new DynamicWrapperGenerator(loader);
- javaTypes.clear();
- typeRefs.clear();
- jaxbCtx = null;
+ if (anWebParam != null)
+ {
+ if (anWebParam.mode() == WebParam.Mode.INOUT)
+ return ParameterMode.INOUT;
+ if (anWebParam.mode() == WebParam.Mode.OUT)
+ return ParameterMode.OUT;
+ }
+
+ return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT : ParameterMode.IN;
}
- protected void createJAXBContext(EndpointMetaData epMetaData)
+ private WebParam getWebParamAnnotation(Method method, int pos)
{
- try
+ for (Annotation annotation : method.getParameterAnnotations()[pos])
+ if (annotation instanceof WebParam)
+ return (WebParam)annotation;
+
+ return null;
+ }
+
+ private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType, WebParam webParam)
+ {
+ String namespace = null;
+ String name = null;
+ boolean header = false;
+
+ if (webParam != null)
{
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
- jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
+ if (webParam.targetNamespace().length() > 0)
+ namespace = webParam.targetNamespace();
+
+ if (webParam.name().length() > 0)
+ name = webParam.name();
+
+ header = webParam.header();
}
- catch (JAXBException ex)
- {
- throw new IllegalStateException("Cannot build JAXB context", ex);
- }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ? opMetaData.getQName().getLocalPart() : "arg" + index;
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
}
- protected void populateXmlTypes(EndpointMetaData epMetaData)
+ private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult anWebResult)
{
- for (OperationMetaData operation : epMetaData.getOperations())
+ String name = null;
+ String namespace = null;
+ boolean header = false;
+
+ if (anWebResult != null)
{
- // parameters
- for (ParameterMetaData paramMetaData : operation.getParameters())
- {
- populateXmlType(paramMetaData);
- }
+ if (anWebResult.targetNamespace().length() > 0)
+ namespace = anWebResult.targetNamespace();
- // return value
- ParameterMetaData returnParameter = operation.getReturnParameter();
- if (returnParameter != null)
- populateXmlType(returnParameter);
+ if (anWebResult.name().length() > 0)
+ name = anWebResult.name();
- // faults
- for (FaultMetaData faultMetaData : operation.getFaults())
- {
- populateXmlType(faultMetaData);
- }
+ header = anWebResult.header();
}
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ? opMetaData.getResponseName().getLocalPart() : "return";
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
}
+ private void populateXmlType(FaultMetaData faultMetaData)
+ {
+ EndpointMetaData epMetaData = faultMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlType = faultMetaData.getXmlType();
+ String faultBeanName = faultMetaData.getFaultBeanName();
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
+ }
+
private void populateXmlType(ParameterMetaData paramMetaData)
{
EndpointMetaData epMetaData = paramMetaData.getOperationMetaData().getEndpointMetaData();
@@ -358,86 +432,26 @@
types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
}
- private void populateXmlType(FaultMetaData faultMetaData)
+ /**
+ * Process operation meta data extensions.
+ */
+ private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData opMetaData)
{
- EndpointMetaData epMetaData = faultMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+ // Until there is a addressing annotion we fallback to implicit action asosciation
+ // TODO: figure out a way to assign message name instead of IN and OUT
+ String tns = epMetaData.getQName().getNamespaceURI();
+ String portTypeName = epMetaData.getQName().getLocalPart();
- QName xmlType = faultMetaData.getXmlType();
- String faultBeanName = faultMetaData.getFaultBeanName();
+ AddressingProperties ADDR = new AddressingPropertiesImpl();
+ AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
- }
+ if (!opMetaData.isOneWay())
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/OUT");
- protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?> wsClass)
- {
- SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
-
- SOAPBinding.Style attrStyle = anSoapBinding.style();
- Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
- epMetaData.setStyle(style);
-
- SOAPBinding.Use attrUse = anSoapBinding.use();
- if (attrUse == SOAPBinding.Use.ENCODED)
- throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
-
- epMetaData.setEncodingStyle(Use.LITERAL);
-
- ParameterStyle paramStyle = anSoapBinding.parameterStyle();
- epMetaData.setParameterStyle(paramStyle);
+ opMetaData.addExtension(addrExt);
}
- private WebParam getWebParamAnnotation(Method method, int pos)
- {
- for (Annotation annotation : method.getParameterAnnotations()[pos])
- if (annotation instanceof WebParam)
- return (WebParam)annotation;
-
- return null;
- }
-
- // If the implementation bean does not implement a service endpoint interface and
- // there are no @WebMethod annotations in the implementation bean (excluding
- // @WebMethod annotations used to exclude inherited @WebMethods), all public
- // methods other than those inherited from java.lang.Object will be exposed as Web
- // Service operations, subject to the inheritance rules specified in Common
- // Annotations for the Java Platform [12], section 2.1.
- protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
- {
- epMetaData.clearOperations();
-
- // Process @WebMethod annotations
- int webMethodCount = 0;
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && (annotation != null || wsClass.isInterface()))
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
-
- // @WebService should expose all inherited methods if @WebMethod is never specified
- if (webMethodCount == 0 && !wsClass.isInterface())
- {
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && method.getDeclaringClass() != Object.class)
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
- }
-
- if (webMethodCount == 0)
- throw new WSException("No exposable methods found");
- }
-
private void processWebMethod(EndpointMetaData epMetaData, Method method)
{
String javaName = method.getName();
@@ -446,10 +460,6 @@
if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
return;
- ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
- TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
- String targetNS = epMetaData.getQName().getNamespaceURI();
-
// reflection defaults
String soapAction = "";
String operationName = method.getName();
@@ -465,6 +475,7 @@
}
}
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
OperationMetaData opMetaData = new OperationMetaData(epMetaData, new QName(targetNS, operationName), javaName);
opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
opMetaData.setSOAPAction(soapAction);
@@ -609,86 +620,111 @@
processMetaExtensions(epMetaData, opMetaData);
}
- private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
+ private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?> sepClass, ClassLoader loader) throws ClassNotFoundException
{
- if (anWebParam != null)
- {
- if (anWebParam.mode() == WebParam.Mode.INOUT)
- return ParameterMode.INOUT;
- if (anWebParam.mode() == WebParam.Mode.OUT)
- return ParameterMode.OUT;
- }
+ WebService anWebService = sepClass.getAnnotation(WebService.class);
+ if (anWebService == null)
+ throw new WSException("Cannot obtain @WebService annotation from: " + sepClass.getName());
- return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT : ParameterMode.IN;
- }
+ Class<?> seiClass = null;
+ String seiName = null;
+ WSDLUtils wsdlUtils = WSDLUtils.getInstance();
- private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method method)
- {
- QName operationQName = operation.getQName();
- QName xmlName = new QName(operationQName.getNamespaceURI(), operationQName.getLocalPart() + "Response");
- QName xmlType = xmlName;
+ String name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(sepClass);
- String responseWrapperType = null;
- if (method.isAnnotationPresent(ResponseWrapper.class))
+ String serviceName = anWebService.serviceName();
+ if (serviceName.length() == 0)
+ serviceName = name + "Service";
+
+ String serviceNS = anWebService.targetNamespace();
+ if (serviceNS.length() == 0)
+ serviceNS = wsdlUtils.getTypeNamespace(sepClass);
+
+ String portName = anWebService.portName();
+ if (portName.length() == 0)
+ portName = name + "Port";
+
+ String wsdlLocation = anWebService.wsdlLocation();
+ String interfaceNS = serviceNS;
+
+ if (anWebService.endpointInterface().length() > 0)
{
- ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
+ seiName = anWebService.endpointInterface();
+ seiClass = loader.loadClass(seiName);
+ anWebService = seiClass.getAnnotation(WebService.class);
- String localName = anResWrapper.localName().length() > 0 ? anResWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
+ if (anWebService == null)
+ throw new WSException("Interface does not have a @WebService annotation: " + seiName);
- if (anResWrapper.className().length() > 0)
- responseWrapperType = anResWrapper.className();
- }
+ name = anWebService.name();
+ if (name.length() == 0)
+ name = WSDLUtils.getJustClassName(seiClass);
- if (responseWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
- responseWrapperType = packageName + "." + JavaUtils.capitalize(method.getName()) + "Response";
+ interfaceNS = anWebService.targetNamespace();
+ if (interfaceNS.length() == 0)
+ interfaceNS = wsdlUtils.getTypeNamespace(seiClass);
+
+ // The spec states that WSDL location should be allowed on an SEI, although it
+ // makes far more sense on the implementation bean, so we ALWAYS override the SEI
+ // when wsdlLocation is defined on the bean
+
+ if (wsdlLocation.length() == 0)
+ wsdlLocation = anWebService.wsdlLocation();
}
- ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType, responseWrapperType);
- retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.setReturnParameter(retMetaData);
+ // Setup the ServerEndpointMetaData
+ QName portQName = new QName(serviceNS, portName);
+ QName portTypeQName = new QName(interfaceNS, name);
- return retMetaData;
+ EndpointResult result = new EndpointResult();
+ result.smd = new ServiceMetaData(wsMetaData, new QName(serviceNS, serviceName));
+ result.semd = new ServerEndpointMetaData(result.smd, portQName, portTypeQName, EndpointMetaData.Type.JAXWS);
+ result.klass = (seiClass != null ? seiClass : sepClass);
+ result.wsdlLocation = wsdlLocation;
+
+ result.smd.addEndpoint(result.semd);
+ wsMetaData.addService(result.smd);
+
+ return result;
}
- private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method method)
+ protected void createJAXBContext(EndpointMetaData epMetaData)
{
- String requestWrapperType = null;
- QName xmlName = operation.getQName();
- QName xmlType = xmlName;
- if (method.isAnnotationPresent(RequestWrapper.class))
+ try
{
- RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
-
- String localName = anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anReqWrapper.className().length() > 0)
- requestWrapperType = anReqWrapper.className();
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
+ jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
}
-
- // Conformance 3.18, the default value must be the same as the method name
- if (requestWrapperType == null)
+ catch (JAXBException ex)
{
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
- requestWrapperType = packageName + "." + JavaUtils.capitalize(method.getName());
+ throw new IllegalStateException("Cannot build JAXB context", ex);
}
+ }
- // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type name
- ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName, xmlType, requestWrapperType);
- wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.addParameter(wrapperParameter);
+ protected void populateXmlTypes(EndpointMetaData epMetaData)
+ {
+ for (OperationMetaData operation : epMetaData.getOperations())
+ {
+ // parameters
+ for (ParameterMetaData paramMetaData : operation.getParameters())
+ {
+ populateXmlType(paramMetaData);
+ }
- return wrapperParameter;
- }
+ // return value
+ ParameterMetaData returnParameter = operation.getReturnParameter();
+ if (returnParameter != null)
+ populateXmlType(returnParameter);
- private String convertToVariable(String localName)
- {
- return JAXBRIContext.mangleNameToVariableName(localName);
+ // faults
+ for (FaultMetaData faultMetaData : operation.getFaults())
+ {
+ populateXmlType(faultMetaData);
+ }
+ }
}
/**
@@ -790,222 +826,212 @@
}
}
- private QName getWebParamName(OperationMetaData opMetaData, int index, Class javaType, WebParam webParam)
+ protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, String wsdlLocation, EndpointMetaData epMetaData)
{
- String namespace = null;
- String name = null;
- boolean header = false;
-
- if (webParam != null)
+ if (wsdlLocation.length() > 0)
{
- if (webParam.targetNamespace().length() > 0)
- namespace = webParam.targetNamespace();
+ serviceMetaData.setWsdlFile(wsdlLocation);
+ }
+ else
+ {
+ try
+ {
+ String serviceName = serviceMetaData.getServiceName().getLocalPart();
- if (webParam.name().length() > 0)
- name = webParam.name();
+ WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
+ WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
- header = webParam.header();
- }
+ // Ensure that types are only in the interface qname
+ wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
+ final File tmpdir = IOUtils.createTempDirectory();
+ File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl", tmpdir);
+ wsdlTmpFile.deleteOnExit();
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
+ Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile, Constants.DEFAULT_XML_CHARSET);
+ wsdlDefinitions.write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriter.WriterResolver()
+ {
+ public ResolvedWriter resolve(String suggestedFile) throws IOException
+ {
+ File newTmpFile = File.createTempFile(suggestedFile, ".wsdl", tmpdir);
+ newTmpFile.deleteOnExit();
+ WSDLWriter.ResolvedWriter resolvedWriter = new WSDLWriter.ResolvedWriter();
+ resolvedWriter.actualFile = newTmpFile.getName();
+ resolvedWriter.charset = Constants.DEFAULT_XML_CHARSET;
+ resolvedWriter.writer = IOUtils.getCharsetFileWriter(newTmpFile, Constants.DEFAULT_XML_CHARSET);
+ return resolvedWriter;
+ }
+ });
+ writer.close();
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ? opMetaData.getQName().getLocalPart() : "arg" + index;
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot write generated wsdl", e);
+ }
+ }
}
- private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult anWebResult)
+ protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?> wsClass)
{
- String name = null;
- String namespace = null;
- boolean header = false;
+ SOAPBinding anSoapBinding = (SOAPBinding)wsClass.getAnnotation(SOAPBinding.class);
- if (anWebResult != null)
- {
- if (anWebResult.targetNamespace().length() > 0)
- namespace = anWebResult.targetNamespace();
+ SOAPBinding.Style attrStyle = anSoapBinding.style();
+ Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
+ epMetaData.setStyle(style);
- if (anWebResult.name().length() > 0)
- name = anWebResult.name();
+ SOAPBinding.Use attrUse = anSoapBinding.use();
+ if (attrUse == SOAPBinding.Use.ENCODED)
+ throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
- header = anWebResult.header();
- }
+ epMetaData.setEncodingStyle(Use.LITERAL);
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ? opMetaData.getResponseName().getLocalPart() : "return";
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ ParameterStyle paramStyle = anSoapBinding.parameterStyle();
+ epMetaData.setParameterStyle(paramStyle);
}
- private void addFault(OperationMetaData omd, Class<?> exception)
+ // If the implementation bean does not implement a service endpoint interface and
+ // there are no @WebMethod annotations in the implementation bean (excluding
+ // @WebMethod annotations used to exclude inherited @WebMethods), all public
+ // methods other than those inherited from java.lang.Object will be exposed as Web
+ // Service operations, subject to the inheritance rules specified in Common
+ // Annotations for the Java Platform [12], section 2.1.
+ protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
{
- if (omd.isOneWay())
- throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
- + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
+ epMetaData.clearOperations();
- WebFault annotation = exception.getAnnotation(WebFault.class);
-
- String name;
- String namespace;
- String faultBeanName = null;
-
- // Only the element name is effected by @WebFault, the type uses the same convention
- QName xmlType = new QName(omd.getQName().getNamespaceURI(), exception.getSimpleName());
-
- /*
- * If @WebFault is present, and the exception contains getFaultInfo, the
- * return value should be used. Otherwise we need to generate the bean.
- */
- boolean generate = true;
- if (annotation != null)
+ // Process @WebMethod annotations
+ int webMethodCount = 0;
+ for (Method method : wsClass.getMethods())
{
- name = annotation.name();
- namespace = annotation.targetNamespace();
- if (namespace.length() == 0)
- namespace = omd.getQName().getNamespaceURI();
-
- Class<?> faultBean = getFaultInfo(exception);
- if (faultBean != null)
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && (annotation != null || wsClass.isInterface()))
{
- generate = false;
- faultBeanName = faultBean.getName();
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
}
}
- else
+
+ // @WebService should expose all inherited methods if @WebMethod is never specified
+ if (webMethodCount == 0 && !wsClass.isInterface())
{
- name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && method.getDeclaringClass() != Object.class)
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
}
- if (faultBeanName == null)
- faultBeanName = JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) + ".jaxws." + exception.getSimpleName() + "Bean";
+ if (webMethodCount == 0)
+ throw new WSException("No exposable methods found");
+ }
- QName xmlName = new QName(namespace, name);
-
- FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
- fmd.setFaultBeanName(faultBeanName);
-
- if (generate)
- wrapperGenerator.generate(fmd);
-
- javaTypes.add(fmd.getFaultBean());
- typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
-
- omd.addFault(fmd);
+ protected void resetMetaDataBuilder(ClassLoader loader)
+ {
+ wrapperGenerator = new DynamicWrapperGenerator(loader);
+ javaTypes.clear();
+ typeRefs.clear();
+ jaxbCtx = null;
}
- private Class<?> getFaultInfo(Class<?> exception)
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
{
try
{
- Method method = exception.getMethod("getFaultInfo");
- Class<?> returnType = method.getReturnType();
- if (returnType == void.class)
- return null;
+ EndpointResult result = processWebService(wsMetaData, sepClass, udi.classLoader);
- return returnType;
- }
- catch (SecurityException e)
- {
- throw new WSException("Unexpected security exception: " + e.getMessage(), e);
- }
- catch (NoSuchMethodException e)
- {
- return null;
- }
- }
+ // Clear the java types, etc.
+ resetMetaDataBuilder(udi.classLoader);
- private String[] convertTypeArguments(Class rawType, Type type)
- {
- if (!Collection.class.isAssignableFrom(rawType) && !Map.class.isAssignableFrom(rawType))
- return null;
+ ServerEndpointMetaData sepMetaData = result.semd;
+ ServiceMetaData serviceMetaData = result.smd;
+ Class<?> wsClass = result.klass;
+ sepMetaData.setLinkName(linkName);
- if (!(type instanceof ParameterizedType))
- return null;
+ // Assign the WS-Security configuration,
+ WSSecurityConfiguration securityConfiguration = MetaDataBuilder.getWsSecurityConfiguration(udi);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
- ParameterizedType paramType = (ParameterizedType)type;
- Type[] arguments = paramType.getActualTypeArguments();
- String[] ret = new String[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- ret[i] = JavaUtils.erasure(arguments[i]).getName();
+ sepMetaData.setServiceEndpointImplName(sepClass.getName());
+ sepMetaData.setServiceEndpointInterfaceName(wsClass.getName());
- return ret;
- }
+ // Process an optional @SOAPBinding annotation
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ processSOAPBinding(sepMetaData, wsClass);
- /**
- * Process operation meta data extensions.
- */
- private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData opMetaData)
- {
- // Until there is a addressing annotion we fallback to implicit action asosciation
- // TODO: figure out a way to assign message name instead of IN and OUT
- String tns = epMetaData.getQName().getNamespaceURI();
- String portTypeName = epMetaData.getQName().getLocalPart();
+ // Process an optional @BindingType annotation
+ if (wsClass.isAnnotationPresent(BindingType.class))
+ processBindingType(sepMetaData, wsClass);
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
- addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
+ // Init the transport guarantee
+ initTransportGuaranteeJSE(udi, sepMetaData, linkName);
- if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/OUT");
+ // Process web methods
+ processWebMethods(sepMetaData, wsClass);
- opMetaData.addExtension(addrExt);
- }
+ // Initialize types
+ createJAXBContext(sepMetaData);
+ populateXmlTypes(sepMetaData);
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, String wsdlLocation, EndpointMetaData epMetaData)
- {
- if (wsdlLocation.length() > 0)
- {
- serviceMetaData.setWsdlFile(wsdlLocation);
- }
- else
- {
- try
- {
- String serviceName = serviceMetaData.getServiceName().getLocalPart();
+ // Process or generate WSDL
+ processOrGenerateWSDL(wsClass, serviceMetaData, result.wsdlLocation, sepMetaData);
- WSDLGenerator generator = new JAXBWSDLGenerator(jaxbCtx);
- WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
+ // Read the generated WSDL and initialize the schema model
+ // FIXME - This should be removed
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() + "/jbossws");
- tmpdir.mkdirs();
+ // Set the endpoint address
+ processPortComponent(udi, wsClass, linkName, sepMetaData);
- File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl", tmpdir);
- wsdlTmpFile.deleteOnExit();
+ // Init the endpoint address
+ MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
- Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile, Constants.DEFAULT_XML_CHARSET);
- wsdlDefinitions.write(writer, Constants.DEFAULT_XML_CHARSET);
- writer.close();
+ // replace the SOAP address
+ MetaDataBuilder.replaceAddressLocation(sepMetaData);
- serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (IOException e)
- {
- throw new WSException("Cannot write generated wsdl", e);
- }
+ // Process an optional @SOAPMessageHandlers annotation
+ if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
+
+ // Add pre handlers
+ WSEndpointConfigJAXWS jaxrpcConfig = (WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.PRE));
+
+ // Process an optional @HandlerChain annotation
+ if (sepClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, sepClass);
+ else if (wsClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(sepMetaData, wsClass);
+
+ // Add post handlers
+ sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.POST));
+
+ // init service endpoint id
+ ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
+
+ return sepMetaData;
}
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot build meta data: " + ex.getMessage(), ex);
+ }
}
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL11Writer.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -63,8 +63,14 @@
write(writer, null);
}
+
public void write(Writer writer, String charset) throws IOException
{
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WriterResolver resolver) throws IOException
+ {
// Write out the wsdl-1.1 represention (only path to obtain is from WSDL11Reader)
if (wsdl.getWsdlOneOneDefinition() != null)
{
@@ -88,31 +94,69 @@
//Detect the WSDL Style early
wsdlStyle = utils.getWSDLStyle(wsdl);
- writtenFaultMessages.clear();
+ StringBuilder importBuffer = new StringBuilder();
+ for (WSDLImport wsdlImport : wsdl.getImports())
+ {
+ if (resolver == null)
+ continue;
- appendDefinitions(buffer);
- appendTypes(buffer);
- appendMessages(buffer);
- appendPortTypes(buffer);
- appendBindings(buffer);
- appendServices(buffer);
+ ResolvedWriter resolved = resolver.resolve(wsdlImport.getLocation());
+ if (resolved == null)
+ continue;
- buffer.append("</definitions>");
- Element element = DOMUtils.parse(buffer.toString());
+ String namespace = wsdlImport.getNamespace();
+ importBuffer.append("<import namespace='" + namespace + "' location='" + resolved.actualFile + "'/>");
+ if (resolved != null)
+ {
+ StringBuilder builder = new StringBuilder();
- if (charset != null)
- writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
- new DOMWriter(writer).setPrettyprint(true).print(element);
+ appendDefinitions(builder, namespace);
+ appendBody(builder, namespace);
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ resolved.writer.close();
+ }
+ }
+
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ if (importBuffer.length() > 0)
+ buffer.append(importBuffer);
+
+ appendBody(buffer, wsdl.getTargetNamespace());
+ writeBuilder(buffer, writer, charset);
}
}
- protected void appendMessages(StringBuilder buffer)
+ private void writeBuilder(StringBuilder builder, Writer writer, String charset) throws IOException
{
+ Element element = DOMUtils.parse(builder.toString());
+
+ if (charset != null)
+ writer.write("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\n");
+ new DOMWriter(writer).setPrettyprint(true).print(element);
+ }
+
+ protected void appendBody(StringBuilder builder, String namespace)
+ {
+ writtenFaultMessages.clear();
+
+ appendTypes(builder, namespace);
+ appendMessages(builder, namespace);
+ appendInterfaces(builder, namespace);
+ appendBindings(builder, namespace);
+ appendServices(builder, namespace);
+ builder.append("</definitions>");
+ }
+
+ protected void appendMessages(StringBuilder buffer, String namespace)
+ {
WSDLInterface[] interfaces = wsdl.getInterfaces();
int len = interfaces != null ? interfaces.length : 0;
for (int i = 0; i < len; i++)
{
WSDLInterface intf = interfaces[i];
+ if (! namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
WSDLInterfaceOperation[] operations = intf.getSortedOperations();
int lenOps = operations.length;
for (int j = 0; j < lenOps; j++)
@@ -240,21 +284,19 @@
return null;
}
- protected void appendInterfaces(StringBuilder buffer)
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
{
- }
-
- protected void appendPortTypes(StringBuilder buffer)
- {
WSDLInterface[] intfs = wsdl.getInterfaces();
for (int i = 0; i < intfs.length; i++)
{
WSDLInterface intf = intfs[i];
- if (i == 0)
- buffer.append("<portType name='" + intf.getName() + "'>");
+ if (!namespace.equals(intf.getQName().getNamespaceURI()))
+ continue;
+
+ buffer.append("<portType name='" + intf.getName() + "'>");
appendPortOperations(buffer, intf);
+ buffer.append("</portType>");
}
- buffer.append("</portType>");
}
private String getParameterOrder(WSDLInterfaceOperation operation)
@@ -275,7 +317,7 @@
protected void appendPortOperations(StringBuilder buffer, WSDLInterface intf)
{
- String targetPrefix = wsdl.getTargetPrefix();
+ String prefix = wsdl.getPrefix(intf.getQName().getNamespaceURI());
WSDLInterfaceOperation[] operations = intf.getSortedOperations();
for (int i = 0; i < operations.length; i++)
{
@@ -289,7 +331,7 @@
String opname = operation.getName().toString();
String interfaceName = operation.getWsdlInterface().getName().toString();
- String msgEl = targetPrefix + ":" + interfaceName + "_" + opname;
+ String msgEl = prefix + ":" + interfaceName + "_" + opname;
buffer.append("<input message='" + msgEl + "'>").append("</input>");
@@ -311,12 +353,14 @@
}
}
- protected void appendBindings(StringBuilder buffer)
+ protected void appendBindings(StringBuilder buffer, String namespace)
{
WSDLBinding[] bindings = wsdl.getBindings();
for (int i = 0; i < bindings.length; i++)
{
WSDLBinding binding = bindings[i];
+ if (!namespace.equals(binding.getQName().getNamespaceURI()))
+ continue;
buffer.append("<binding name='" + binding.getName() + "' type='" + getQNameRef(binding.getInterfaceName()) + "'>");
//TODO:Need to derive the WSDLStyle from the Style attribute of InterfaceOperation
if (wsdlStyle == null)
@@ -438,7 +482,7 @@
return pattern;
}
- protected void appendServices(StringBuilder buffer)
+ protected void appendServices(StringBuilder buffer, String namespace)
{
WSDLService[] services = wsdl.getServices();
int len = services.length;
@@ -446,6 +490,8 @@
{
WSDLService service = services[i];
+ if (!namespace.equals(service.getQName().getNamespaceURI()))
+ continue;
buffer.append("<service name='" + service.getName() + "'>");
WSDLEndpoint[] endpoints = service.getEndpoints();
int lenend = endpoints.length;
@@ -464,8 +510,7 @@
String name = endpoint.getName().toString();
QName endpointBinding = endpoint.getBinding();
String prefix = endpointBinding.getPrefix();
- if (prefix == null || prefix == "")
- prefix = wsdl.getTargetPrefix();
+ prefix = wsdl.getPrefix(endpointBinding.getNamespaceURI());
String ebname = prefix + ":" + endpointBinding.getLocalPart();
buffer.append("<port name='" + name + "' binding='" + ebname + "'>");
buffer.append("<" + soapPrefix + ":address location='" + endpoint.getAddress() + "'/>");
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDL20Writer.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -46,7 +46,7 @@
}
- protected void appendInterfaces(StringBuilder buffer)
+ protected void appendInterfaces(StringBuilder buffer, String namespace)
{
WSDLInterface[] interfaces = wsdl.getInterfaces();
for (int i = 0; i < interfaces.length; i++)
@@ -137,7 +137,7 @@
}
}
- protected void appendBindings(StringBuilder buffer)
+ protected void appendBindings(StringBuilder buffer, String namespace)
{
WSDLBinding[] bindings = wsdl.getBindings();
for (int i = 0; i < bindings.length; i++)
@@ -165,7 +165,7 @@
}
}
- protected void appendServices(StringBuilder buffer)
+ protected void appendServices(StringBuilder buffer, String namespace)
{
WSDLService[] services = wsdl.getServices();
for (int i = 0; i < services.length; i++)
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -38,6 +38,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
+import org.jboss.ws.metadata.wsdl.WSDLWriter.WriterResolver;
import org.jboss.xb.binding.NamespaceRegistry;
import org.w3c.dom.Document;
@@ -302,10 +303,15 @@
/** Write the wsdl definition to the given writer, clients should not care about the wsdl version. */
public void write(Writer writer, String charset) throws IOException
{
+ write(writer, charset, null);
+ }
+
+ public void write(Writer writer, String charset, WriterResolver resolver) throws IOException
+ {
if (Constants.NS_WSDL11.equals(wsdlNamespace))
{
WSDL11Writer wsdl11Writer = new WSDL11Writer(this);
- wsdl11Writer.write(writer, charset);
+ wsdl11Writer.write(writer, charset, resolver);
}
else if (Constants.NS_WSDL20.equals(wsdlNamespace))
{
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLTypes.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -44,6 +44,7 @@
static private final Logger log = Logger.getLogger(WSDLTypes.class);
private WSDLDefinitions wsdlDefinitions;
+ private String namespace;
public abstract QName getXMLType(QName name);
@@ -56,4 +57,20 @@
{
wsdlDefinitions = parent;
}
+
+ /**
+ * Gets the namespace associate with this types declaration. Currently this is used to filter
+ * which WSDL file receives this types definition. Null means all files.
+ *
+ * @return the namespace associated with this type definition
+ */
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLUtils.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -535,13 +535,13 @@
* @return just the classname
*/
- public String getJustClassName(Class cls)
+ public static String getJustClassName(Class cls)
{
if (cls == null) return null;
if (cls.isArray())
{
Class c = cls.getComponentType();
- return this.getJustClassName(c.getName());
+ return getJustClassName(c.getName());
}
return getJustClassName(cls.getName());
@@ -553,7 +553,7 @@
* @param classname
* @return just the classname
*/
- public String getJustClassName(String classname)
+ public static String getJustClassName(String classname)
{
int index = classname.lastIndexOf(".");
if (index < 0)
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLWriter.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -59,6 +59,18 @@
*/
protected boolean includeSchemaInWSDL = true;
+ public static class ResolvedWriter
+ {
+ public String actualFile;
+ public String charset;
+ public Writer writer;
+ }
+
+ public static interface WriterResolver
+ {
+ public ResolvedWriter resolve(String suggestedFile) throws IOException;
+ }
+
/** Use WSDLDefinitions.writeWSDL instead. */
protected WSDLWriter(WSDLDefinitions wsdl)
{
@@ -73,11 +85,11 @@
StringBuilder buffer = new StringBuilder();
buffer.append(Constants.XML_HEADER);
- appendDefinitions(buffer);
- appendTypes(buffer);
- appendInterfaces(buffer);
- appendBindings(buffer);
- appendServices(buffer);
+ appendDefinitions(buffer, wsdl.getTargetNamespace());
+ appendTypes(buffer, wsdl.getTargetNamespace());
+ appendInterfaces(buffer, wsdl.getTargetNamespace());
+ appendBindings(buffer, wsdl.getTargetNamespace());
+ appendServices(buffer, wsdl.getTargetNamespace());
buffer.append("</definitions>");
@@ -85,7 +97,7 @@
new DOMWriter(writer).setPrettyprint(true).print(element);
}
- protected void appendDefinitions(StringBuilder buffer)
+ protected void appendDefinitions(StringBuilder buffer, String namespace)
{
buffer.append("<definitions");
//Append service name as done by wscompile, if there is just one
@@ -95,8 +107,9 @@
WSDLService ser = services[0];
buffer.append(" name='" + ser.getName() + "'");
}
- buffer.append(" targetNamespace='" + wsdl.getTargetNamespace() + "'");
+ buffer.append(" targetNamespace='" + namespace + "'");
buffer.append(" xmlns='" + wsdl.getWsdlNamespace() + "'");
+
Iterator it = wsdl.getRegisteredNamespaceURIs();
while (it.hasNext())
{
@@ -112,9 +125,13 @@
buffer.append(">");
}
- protected void appendTypes(StringBuilder buffer)
+ protected void appendTypes(StringBuilder buffer, String namespace)
{
WSDLTypes wsdlTypes = wsdl.getWsdlTypes();
+ // If the type section is bound to a particular namespace, verify it mataches, otherwise skip
+ if (wsdlTypes.getNamespace() != null && !wsdlTypes.getNamespace().equals(namespace))
+ return;
+
if (wsdlTypes instanceof XSModelTypes)
{
buffer.append("<types>");
@@ -132,11 +149,11 @@
}
}
- protected abstract void appendInterfaces(StringBuilder buffer);
+ protected abstract void appendInterfaces(StringBuilder buffer, String namespace);
- protected abstract void appendBindings(StringBuilder buffer);
+ protected abstract void appendBindings(StringBuilder buffer, String namespace);
- protected abstract void appendServices(StringBuilder buffer);
+ protected abstract void appendServices(StringBuilder buffer, String namespace);
/** Get a prefixed name of form prefix:localPart */
protected String getQNameRef(QName qname)
Modified: trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -42,6 +42,7 @@
import org.jboss.ws.metadata.wsdl.WSDLBindingOperationOutput;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLImport;
import org.jboss.ws.metadata.wsdl.WSDLInterface;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault;
import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation;
@@ -82,6 +83,16 @@
wsdlInterface.setName(new NCName(interfaceQName));
wsdl.addInterface(wsdlInterface);
+ // Add imports
+ if (!interfaceQName.getNamespaceURI().equals(endpoint.getServiceMetaData().getServiceName().getNamespaceURI()))
+ {
+ WSDLImport wsdlImport = new WSDLImport(wsdl);
+ wsdlImport.setLocation(interfaceQName.getLocalPart() + "_PortType");
+ wsdlImport.setNamespace(interfaceQName.getNamespaceURI());
+ wsdl.addImport(wsdlImport);
+ wsdl.registerNamespaceURI(interfaceQName.getNamespaceURI(), null);
+ }
+
WSDLBinding wsdlBinding = new WSDLBinding(wsdl);
QName bindingQName = new QName(interfaceQName.getNamespaceURI(), interfaceQName.getLocalPart() + "Binding");
wsdlBinding.setQName(bindingQName);
Modified: trunk/src/main/resources/jbossws.war/JBoss/WEB-INF/web.xml
===================================================================
--- trunk/src/main/resources/jbossws.war/JBoss/WEB-INF/web.xml 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/main/resources/jbossws.war/JBoss/WEB-INF/web.xml 2006-12-01 03:53:14 UTC (rev 1527)
@@ -14,12 +14,12 @@
<servlet>
<servlet-name>ContextServlet</servlet-name>
- <servlet-class>org.jboss.ws.integration.jboss.JBossContextServlet</servlet-class>
+ <servlet-class>org.jboss.ws.integration.jboss50.JBossContextServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>PortComponentLinkServlet</servlet-name>
- <servlet-class>org.jboss.ws.integration.jboss.PortComponentLinkServlet</servlet-class>
+ <servlet-class>org.jboss.ws.integration.jboss50.PortComponentLinkServlet</servlet-class>
</servlet>
<!-- now the mappings -->
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/anonymous/AnonymousImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -30,7 +30,7 @@
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @version $Revision$
*/
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.anonymous.Anonymous")
+@WebService(endpointInterface="org.jboss.test.ws.jaxws.anonymous.Anonymous", serviceName="AnonymousService")
public class AnonymousImpl implements Anonymous
{
public AnonymousResponse echoAnonymous(AnonymousRequest request)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPEndpointBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -38,7 +38,7 @@
import org.jboss.logging.Logger;
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.binding.SOAPEndpoint")
+@WebService(name="SOAPEndpoint", targetNamespace="http://org.jboss.ws/jaxws/binding", endpointInterface = "org.jboss.test.ws.jaxws.binding.SOAPEndpoint")
public class SOAPEndpointBean implements SOAPEndpoint
{
private static Logger log = Logger.getLogger(SOAPEndpointBean.class);
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -32,7 +32,7 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.context.EndpointInterface")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.context.EndpointInterface", serviceName = "TestService", targetNamespace = "http://org.jboss.ws/jaxws/context")
public class EndpointBean
{
@Resource
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointInterface.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointInterface.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/context/EndpointInterface.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -27,7 +27,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-@WebService(name = "EndpointInterface", targetNamespace = "http://org.jboss.ws/jaxws/context", serviceName = "TestService")
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/context")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface extends Remote
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -31,7 +31,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.endpoint.EndpointInterface")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.endpoint.EndpointInterface", targetNamespace = "http://org.jboss.ws/jaxws/endpoint", serviceName = "TestService")
public class EndpointBean implements EndpointInterface
{
public String echo(String input)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointInterface.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointInterface.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointInterface.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -34,7 +34,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(name = "EndpointInterface", targetNamespace = "http://org.jboss.ws/jaxws/endpoint", serviceName = "TestService")
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface extends Remote
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionTestCase.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -54,7 +54,7 @@
{
super.setUp();
- QName serviceName = new QName(targetNS, "ExceptionEndpointService");
+ QName serviceName = new QName(targetNS, "ExceptionEndpointImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-exception/ExceptionEndpointService?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -28,11 +28,11 @@
import javax.jws.soap.SOAPBinding;
/**
- *
+ *
* @author darran.lofthouse(a)jboss.com
* @since 19-October-2006
*/
-@WebService(serviceName = "TestService", targetNamespace = "http://org.jboss/test/ws/jbws1190")
+@WebService(targetNamespace = "http://org.jboss/test/ws/jbws1190")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface TestEndpoint extends Remote
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -35,11 +35,11 @@
import org.jboss.ws.server.ServerConfigFactory;
/**
- *
+ *
* @author darran.lofthouse(a)jboss.com
* @since 19-October-2006
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint", targetNamespace = "http://org.jboss/test/ws/jbws1190", name="Test")
public class TestEndpointImpl implements TestEndpoint
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -23,7 +23,7 @@
import javax.jws.WebService;
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.jbws1357.JBWS1357")
+@WebService(endpointInterface="org.jboss.test.ws.jaxws.jbws1357.JBWS1357", name="JBWS1357")
public class JBWS1357Impl implements JBWS1357
{
public String echo(String message)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -33,12 +33,12 @@
import org.jboss.ws.annotation.PortComponent;
/**
- *
+ *
* @author darran.lofthouse(a)jboss.com
* @since Nov 2, 2006
*/
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws981.EndpointInterface")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws981.EndpointInterface", targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws981", serviceName = "TestService")
public class EJB3Bean implements EJB3RemoteInterface
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -14,7 +14,7 @@
import org.jboss.ws.annotation.PortComponent;
-@WebService(targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws981", serviceName = "TestService")
+@WebService(targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws981")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@PortComponent(virtualHosts = { "localhost", "www.jboss.org" })
public interface EndpointInterface
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/RegistrationService.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/RegistrationService.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/complex/RegistrationService.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -40,7 +40,7 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @version $Revision$
*/
-@WebService (endpointInterface = "org.jboss.test.ws.jaxws.jsr181.complex.Registration")
+@WebService (endpointInterface = "org.jboss.test.ws.jaxws.jsr181.complex.Registration", serviceName="RegistrationService")
public class RegistrationService implements Registration
{
// Provide logging
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/DocWrappedServiceImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/DocWrappedServiceImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/DocWrappedServiceImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -37,7 +37,7 @@
* @since 16-Oct-2005
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrapped")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrapped", name="DocWrapped")
public class DocWrappedServiceImpl implements DocWrapped
{
// Provide logging
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/ExampleServiceImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/ExampleServiceImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/soapbinding/ExampleServiceImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -34,7 +34,7 @@
* @since 16-Oct-2005
*/
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.jsr181.soapbinding.ExampleSEI")
+@WebService(endpointInterface="org.jboss.test.ws.jaxws.jsr181.soapbinding.ExampleSEI", name="Example")
public class ExampleServiceImpl
{
// Provide logging
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/TestEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/TestEndpointImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webmethod/TestEndpointImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -34,7 +34,7 @@
* @since 12-Aug-2005
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.webmethod.TestEndpoint")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.webmethod.TestEndpoint", name="TestEndpoint")
public class TestEndpointImpl
{
// Provide logging
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -35,7 +35,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
+@WebService(name = "EndpointInterface", targetNamespace = "http://foo")
@PortComponent(contextRoot="/jsr181", urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface03 extends Remote
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSEBean03.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSEBean03.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSEBean03.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -25,13 +25,13 @@
/**
* Test the JSR-181 javax.jws.WebService annotation on a JSE endpoint.
- *
+ *
* Uses the endpointInterface attribute
*
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.webservice.EndpointInterface03")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jsr181.webservice.EndpointInterface03", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
public class JSEBean03
{
public String echo(String input)
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -42,20 +42,23 @@
*/
public class JSR181WebServiceBase extends JBossWSTest
{
- private static EndpointInterface port;
private EndpointInterface getPort() throws MalformedURLException
{
- if (port == null)
- {
- QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "TestService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+ QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "TestService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- port = (EndpointInterface)service.getPort(EndpointInterface.class);
- }
+ Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(EndpointInterface.class);
+ }
- return port;
+ private EndpointInterface03 getPort03() throws MalformedURLException
+ {
+ QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "TestService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ return service.getPort(EndpointInterface03.class);
}
private void sayHello() throws RemoteException, MalformedURLException
@@ -78,7 +81,10 @@
public void webServiceEndpointInterfaceTest() throws Exception
{
- sayHello();
+ assertWSDLAccess();
+ String helloWorld = "Hello Interface!";
+ Object retObj = getPort03().echo(helloWorld);
+ assertEquals(helloWorld, retObj);
}
private void assertWSDLAccess() throws MalformedURLException
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -52,7 +52,7 @@
}
}
- public void _testWebServiceWsdlLocation() throws Exception
+ public void testWebServiceWsdlLocation() throws Exception
{
deploy("jaxws-jsr181-webservice02-jse.war");
try
@@ -65,7 +65,7 @@
}
}
- public void _testWebServiceEndpointInterface() throws Exception
+ public void testWebServiceEndpointInterface() throws Exception
{
deploy("jaxws-jsr181-webservice03-jse.war");
try
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderMgmtBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderMgmtBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderMgmtBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -43,7 +43,7 @@
* that offers access though RMI and SOAP
*/
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.OrderMgmt")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.OrderMgmt", name="OrderMgmt")
@HandlerChain(file = "META-INF/jaxws-handler.xml")
public class OrderMgmtBean implements OrderMgmt {
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/cc/CCVerificationBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/cc/CCVerificationBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/cc/CCVerificationBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -29,7 +29,7 @@
import javax.xml.ws.Response;
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.cc.CCVerification")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.cc.CCVerification", name="CCVerification")
@HandlerChain(file = "META-INF/jaxws-handler.xml")
public class CCVerificationBean implements CCVerification {
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/profile/ProfileMgmtBean.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -26,7 +26,7 @@
import javax.jws.HandlerChain;
@Stateless
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.profile.ProfileMgmt")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.samples.retail.profile.ProfileMgmt", name="ProfileMgmt")
@HandlerChain(file = "META-INF/jaxws-handler.xml")
public class ProfileMgmtBean implements ProfileMgmt {
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java 2006-11-30 23:35:39 UTC (rev 1526)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java 2006-12-01 03:53:14 UTC (rev 1527)
@@ -23,7 +23,7 @@
import javax.jws.WebService;
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.wrapped.accessor.Accessor")
+@WebService(endpointInterface="org.jboss.test.ws.jaxws.wrapped.accessor.Accessor", name="Accessor")
public class AccessorImpl implements Accessor
{
public String fieldAccessor(String one, int two)
18 years