JBossWS SVN: r1641 - branches/dlofthouse
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-14 06:08:20 -0500 (Thu, 14 Dec 2006)
New Revision: 1641
Added:
branches/dlofthouse/JBWS-1428/
Log:
Branch for JBWS-1428
Copied: branches/dlofthouse/JBWS-1428 (from rev 1640, branches/jbossws-1.0)
19 years, 4 months
JBossWS SVN: r1640 - trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-12-13 20:38:28 -0500 (Wed, 13 Dec 2006)
New Revision: 1640
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java
Log:
remove accidental import
Modified: trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java 2006-12-13 14:57:55 UTC (rev 1639)
+++ trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/ClientSideHandler.java 2006-12-14 01:38:28 UTC (rev 1640)
@@ -36,8 +36,6 @@
import org.jboss.logging.Logger;
-import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
-
public class ClientSideHandler extends GenericHandler
{
// Provide logging
19 years, 4 months
JBossWS SVN: r1639 - in trunk/src: main/java/org/jboss/ws main/java/org/jboss/ws/core/jaxws/spi main/java/org/jboss/ws/metadata/builder main/java/org/jboss/ws/metadata/umdm test/java/org/jboss/test/ws/jaxws test/java/org/jboss/test/ws/jaxws/client test/java/org/jboss/test/ws/jaxws/samples/retail test/resources test/resources/jaxws test/resources/jaxws/client test/resources/jaxws/client/META-INF
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-13 09:57:55 -0500 (Wed, 13 Dec 2006)
New Revision: 1639
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/client/
trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType2.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType3.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestService.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestTwo.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/ObjectFactory.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/ServiceDelegateTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/client/package-info.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderAdmin.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineRequest.java
trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineResponse.java
trunk/src/test/resources/jaxws/client/
trunk/src/test/resources/jaxws/client/META-INF/
trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl
Removed:
trunk/src/test/resources/xop/
Modified:
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
Log:
Fix JBCTS-429
Modified: trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -67,12 +67,28 @@
/** The namespace for the MTOM content type attribute. */
static final String NS_XML_MIME = "http://www.w3.org/2005/05/xmlmime";
/** The namespace for XOP. */
- static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
+ static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding.
+ */
+ public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
- /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
- static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
- /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
- static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding.
+ */
+ public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
+
+ /**
+ * A constant representing the identity of the SOAP 1.1 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP11HTTP_MTOM_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true";
+
+ /**
+ * A constant representing the identity of the SOAP 1.2 over HTTP binding
+ * with MTOM enabled by default.
+ */
+ public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
/** SOAP-1.1 encoding URI */
static final String URI_SOAP11_ENC = SOAPConstants.URI_NS_SOAP_ENCODING;
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -23,28 +23,6 @@
// $Id$
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.jws.WebService;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
@@ -56,10 +34,27 @@
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import javax.jws.WebService;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.*;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.spi.ServiceDelegate;
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
/**
* Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
*
@@ -113,6 +108,8 @@
@Override
public <T> T getPort(QName portName, Class<T> seiClass)
{
+ assertSEIConstraints(seiClass);
+
if (serviceMetaData == null)
throw new WebServiceException("Service meta data not available");
@@ -133,8 +130,7 @@
*/
public <T> T getPort(Class<T> seiClass)
{
- if (seiClass == null)
- throw new IllegalArgumentException("service endpoint interface cannot be null");
+ assertSEIConstraints(seiClass);
if (serviceMetaData == null)
throw new WebServiceException("Service meta data not available");
@@ -147,7 +143,28 @@
epMetaData = serviceMetaData.getEndpoints().get(0);
epMetaData.setServiceEndpointInterfaceName(seiClassName);
}
+ else
+ {
+ // resolve PortType by name
+ WebService ws = seiClass.getAnnotation(WebService.class);
+ String ns = ws.targetNamespace();
+ String name = ws.name();
+ // TODO: default name mapping when annotations not used
+ QName portTypeName = new QName(ns, name);
+
+ for(EndpointMetaData epmd : serviceMetaData.getEndpoints())
+ {
+ QName interfaceQName = epmd.getInterfaceQName(); // skip namespaces here
+ if( interfaceQName.getLocalPart().equals( portTypeName.getLocalPart() ) )
+ {
+ epmd.setServiceEndpointInterfaceName(seiClass.getName());
+ epMetaData = epmd;
+ break;
+ }
+ }
+ }
+
if (epMetaData == null)
throw new WebServiceException("Cannot get port meta data for: " + seiClassName);
@@ -157,24 +174,26 @@
private <T> T getPortInternal(EndpointMetaData epMetaData, Class<T> seiClass)
{
QName portName = epMetaData.getQName();
- if (seiClass.isAnnotationPresent(WebService.class))
+
+ // Adjust the endpoint meta data according to the annotations
+ if (annotatedPorts.contains(portName) == false)
{
- // Adjust the endpoint meta data according to the annotations
- if (annotatedPorts.contains(portName) == false)
- {
- JAXWSClientEndpointMetaDataBuilder metaDataBuilder = new JAXWSClientEndpointMetaDataBuilder();
- metaDataBuilder.rebuildEndpointMetaData(epMetaData, seiClass);
- }
+ JAXWSClientEndpointMetaDataBuilder metaDataBuilder = new JAXWSClientEndpointMetaDataBuilder();
+ metaDataBuilder.rebuildEndpointMetaData(epMetaData, seiClass);
}
- else
- {
- // TODO: should'nt this throw an exception?
- log.warn("SEI is missing @WebService annotation: " + seiClass);
- }
return (T)createProxy(seiClass, epMetaData);
}
+ private void assertSEIConstraints(Class seiClass) {
+
+ if (seiClass == null)
+ throw new IllegalArgumentException("Service endpoint interface cannot be null");
+
+ if(!seiClass.isAnnotationPresent(WebService.class))
+ throw new WebServiceException("SEI is missing @WebService annotation: " + seiClass);
+ }
+
@Override
/**
* Creates a new port for the service.
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -23,55 +23,42 @@
// $Id$
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.ObjectName;
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.jaxrpc.Use;
import org.jboss.ws.core.server.ServiceEndpointManager;
import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.utils.ObjectNameFactory;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData;
+import org.jboss.ws.metadata.j2ee.*;
import org.jboss.ws.metadata.j2ee.UnifiedWebSecurityMetaData.UnifiedWebResourceCollection;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.wsdl.NCName;
-import org.jboss.ws.metadata.wsdl.WSDLBinding;
-import org.jboss.ws.metadata.wsdl.WSDLBindingOperation;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
-import org.jboss.ws.metadata.wsdl.WSDLInterface;
-import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.metadata.wsdl.*;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
import org.w3c.dom.Element;
+import javax.management.ObjectName;
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
/** An abstract meta data builder.
*
* @author Thomas.Diesler(a)jboss.org
@@ -128,9 +115,9 @@
WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName());
String bindingType = wsdlBinding.getType();
if (Constants.NS_SOAP11.equals(bindingType))
- epMetaData.setBindingId(CommonSOAPBinding.SOAP11HTTP_BINDING);
+ epMetaData.setBindingId(Constants.SOAP11HTTP_BINDING);
else if (Constants.NS_SOAP12.equals(bindingType))
- epMetaData.setBindingId(CommonSOAPBinding.SOAP12HTTP_BINDING);
+ epMetaData.setBindingId(Constants.SOAP12HTTP_BINDING);
}
/** Initialize the endpoint encoding style from the binding operations
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -36,7 +36,6 @@
import org.jboss.ws.core.jaxws.JAXBDeserializerFactory;
import org.jboss.ws.core.jaxws.JAXBSerializerFactory;
import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -175,10 +174,10 @@
public void setBindingId(String bindingId)
{
- if (!CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId)
- && !CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId)
- && !CommonSOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
- && !CommonSOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
+ if (!Constants.SOAP11HTTP_BINDING.equals(bindingId)
+ && !Constants.SOAP12HTTP_BINDING.equals(bindingId)
+ && !Constants.SOAP11HTTP_MTOM_BINDING.equals(bindingId)
+ && !Constants.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
{
throw new WSException("Unsupported binding: " + bindingId);
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -23,21 +23,19 @@
// $Id$
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServiceEndpoint;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.config.WSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.net.MalformedURLException;
+import java.net.URL;
+
/**
* Client side endpoint meta data.
*
@@ -71,7 +69,7 @@
// The optional transport guarantee
private String transportGuarantee;
// The bean that registers with the ServiceEndpointManager
- private String managedEndpointBean = ServiceEndpoint.class.getName();
+ private String managedEndpointBean = "org.jboss.ws.core.server.ServiceEndpoint";
public ServerEndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
{
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,374 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.*;
+import javax.xml.transform.Source;
+import java.awt.*;
+
+
+/**
+ * <p>Java class for DataType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="DataType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="docName1" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName2" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName3" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName4" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl1" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl2" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl3" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl4" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="doc1" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc2" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc3" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc4" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DataType", propOrder = {
+ "docName1",
+ "docName2",
+ "docName3",
+ "docName4",
+ "docUrl1",
+ "docUrl2",
+ "docUrl3",
+ "docUrl4",
+ "doc1",
+ "doc2",
+ "doc3",
+ "doc4"
+})
+public class DataType {
+
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName4;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl4;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("text/xml")
+ protected Source doc1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("application/xml")
+ protected Source doc2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("text/html")
+ protected DataHandler doc3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("image/jpeg")
+ protected Image doc4;
+
+ /**
+ * Gets the value of the docName1 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName1() {
+ return docName1;
+ }
+
+ /**
+ * Sets the value of the docName1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName1(String value) {
+ this.docName1 = value;
+ }
+
+ /**
+ * Gets the value of the docName2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName2() {
+ return docName2;
+ }
+
+ /**
+ * Sets the value of the docName2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName2(String value) {
+ this.docName2 = value;
+ }
+
+ /**
+ * Gets the value of the docName3 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName3() {
+ return docName3;
+ }
+
+ /**
+ * Sets the value of the docName3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName3(String value) {
+ this.docName3 = value;
+ }
+
+ /**
+ * Gets the value of the docName4 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName4() {
+ return docName4;
+ }
+
+ /**
+ * Sets the value of the docName4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName4(String value) {
+ this.docName4 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl1 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl1() {
+ return docUrl1;
+ }
+
+ /**
+ * Sets the value of the docUrl1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl1(String value) {
+ this.docUrl1 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl2() {
+ return docUrl2;
+ }
+
+ /**
+ * Sets the value of the docUrl2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl2(String value) {
+ this.docUrl2 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl3 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl3() {
+ return docUrl3;
+ }
+
+ /**
+ * Sets the value of the docUrl3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl3(String value) {
+ this.docUrl3 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl4 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl4() {
+ return docUrl4;
+ }
+
+ /**
+ * Sets the value of the docUrl4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl4(String value) {
+ this.docUrl4 = value;
+ }
+
+ /**
+ * Gets the value of the doc1 property.
+ *
+ * @return
+ * possible object is
+ * {@link Source }
+ *
+ */
+ public Source getDoc1() {
+ return doc1;
+ }
+
+ /**
+ * Sets the value of the doc1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Source }
+ *
+ */
+ public void setDoc1(Source value) {
+ this.doc1 = value;
+ }
+
+ /**
+ * Gets the value of the doc2 property.
+ *
+ * @return
+ * possible object is
+ * {@link Source }
+ *
+ */
+ public Source getDoc2() {
+ return doc2;
+ }
+
+ /**
+ * Sets the value of the doc2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Source }
+ *
+ */
+ public void setDoc2(Source value) {
+ this.doc2 = value;
+ }
+
+ /**
+ * Gets the value of the doc3 property.
+ *
+ * @return
+ * possible object is
+ * {@link DataHandler }
+ *
+ */
+ public DataHandler getDoc3() {
+ return doc3;
+ }
+
+ /**
+ * Sets the value of the doc3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DataHandler }
+ *
+ */
+ public void setDoc3(DataHandler value) {
+ this.doc3 = value;
+ }
+
+ /**
+ * Gets the value of the doc4 property.
+ *
+ * @return
+ * possible object is
+ * {@link Image }
+ *
+ */
+ public Image getDoc4() {
+ return doc4;
+ }
+
+ /**
+ * Sets the value of the doc4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Image }
+ *
+ */
+ public void setDoc4(Image value) {
+ this.doc4 = value;
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType2.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType2.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType2.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,514 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.*;
+import javax.xml.transform.Source;
+import java.awt.*;
+
+
+/**
+ * <p>Java class for DataType2 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="DataType2">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="docName1" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName2" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName3" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docName4" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl1" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl2" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl3" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl4" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl11" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl12" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl13" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="docUrl14" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="doc1" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc2" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc3" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="doc4" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * <element name="result" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DataType2", propOrder = {
+ "docName1",
+ "docName2",
+ "docName3",
+ "docName4",
+ "docUrl1",
+ "docUrl2",
+ "docUrl3",
+ "docUrl4",
+ "docUrl11",
+ "docUrl12",
+ "docUrl13",
+ "docUrl14",
+ "doc1",
+ "doc2",
+ "doc3",
+ "doc4",
+ "result"
+})
+public class DataType2 {
+
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docName4;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl4;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl11;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl12;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl13;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String docUrl14;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("text/xml")
+ protected Source doc1;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("application/xml")
+ protected Source doc2;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("text/html")
+ protected DataHandler doc3;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("image/jpeg")
+ protected Image doc4;
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ protected String result;
+
+ /**
+ * Gets the value of the docName1 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName1() {
+ return docName1;
+ }
+
+ /**
+ * Sets the value of the docName1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName1(String value) {
+ this.docName1 = value;
+ }
+
+ /**
+ * Gets the value of the docName2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName2() {
+ return docName2;
+ }
+
+ /**
+ * Sets the value of the docName2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName2(String value) {
+ this.docName2 = value;
+ }
+
+ /**
+ * Gets the value of the docName3 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName3() {
+ return docName3;
+ }
+
+ /**
+ * Sets the value of the docName3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName3(String value) {
+ this.docName3 = value;
+ }
+
+ /**
+ * Gets the value of the docName4 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocName4() {
+ return docName4;
+ }
+
+ /**
+ * Sets the value of the docName4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocName4(String value) {
+ this.docName4 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl1 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl1() {
+ return docUrl1;
+ }
+
+ /**
+ * Sets the value of the docUrl1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl1(String value) {
+ this.docUrl1 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl2() {
+ return docUrl2;
+ }
+
+ /**
+ * Sets the value of the docUrl2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl2(String value) {
+ this.docUrl2 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl3 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl3() {
+ return docUrl3;
+ }
+
+ /**
+ * Sets the value of the docUrl3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl3(String value) {
+ this.docUrl3 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl4 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl4() {
+ return docUrl4;
+ }
+
+ /**
+ * Sets the value of the docUrl4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl4(String value) {
+ this.docUrl4 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl11 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl11() {
+ return docUrl11;
+ }
+
+ /**
+ * Sets the value of the docUrl11 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl11(String value) {
+ this.docUrl11 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl12 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl12() {
+ return docUrl12;
+ }
+
+ /**
+ * Sets the value of the docUrl12 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl12(String value) {
+ this.docUrl12 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl13 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl13() {
+ return docUrl13;
+ }
+
+ /**
+ * Sets the value of the docUrl13 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl13(String value) {
+ this.docUrl13 = value;
+ }
+
+ /**
+ * Gets the value of the docUrl14 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDocUrl14() {
+ return docUrl14;
+ }
+
+ /**
+ * Sets the value of the docUrl14 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDocUrl14(String value) {
+ this.docUrl14 = value;
+ }
+
+ /**
+ * Gets the value of the doc1 property.
+ *
+ * @return
+ * possible object is
+ * {@link Source }
+ *
+ */
+ public Source getDoc1() {
+ return doc1;
+ }
+
+ /**
+ * Sets the value of the doc1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Source }
+ *
+ */
+ public void setDoc1(Source value) {
+ this.doc1 = value;
+ }
+
+ /**
+ * Gets the value of the doc2 property.
+ *
+ * @return
+ * possible object is
+ * {@link Source }
+ *
+ */
+ public Source getDoc2() {
+ return doc2;
+ }
+
+ /**
+ * Sets the value of the doc2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Source }
+ *
+ */
+ public void setDoc2(Source value) {
+ this.doc2 = value;
+ }
+
+ /**
+ * Gets the value of the doc3 property.
+ *
+ * @return
+ * possible object is
+ * {@link DataHandler }
+ *
+ */
+ public DataHandler getDoc3() {
+ return doc3;
+ }
+
+ /**
+ * Sets the value of the doc3 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link DataHandler }
+ *
+ */
+ public void setDoc3(DataHandler value) {
+ this.doc3 = value;
+ }
+
+ /**
+ * Gets the value of the doc4 property.
+ *
+ * @return
+ * possible object is
+ * {@link Image }
+ *
+ */
+ public Image getDoc4() {
+ return doc4;
+ }
+
+ /**
+ * Sets the value of the doc4 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Image }
+ *
+ */
+ public void setDoc4(Image value) {
+ this.doc4 = value;
+ }
+
+ /**
+ * Gets the value of the result property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * Sets the value of the result property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setResult(String value) {
+ this.result = value;
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType3.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType3.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/DataType3.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,61 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.xml.bind.annotation.*;
+import java.awt.*;
+
+
+/**
+ * <p>Java class for DataType3 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="DataType3">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="doc" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "DataType3", propOrder = {
+ "doc"
+})
+public class DataType3 {
+
+ @XmlElement(namespace = "http://mtomtestservice.org/xsd")
+ @XmlMimeType("image/jpeg")
+ protected Image doc;
+
+ /**
+ * Gets the value of the doc property.
+ *
+ * @return
+ * possible object is
+ * {@link Image }
+ *
+ */
+ public Image getDoc() {
+ return doc;
+ }
+
+ /**
+ * Sets the value of the doc property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Image }
+ *
+ */
+ public void setDoc(Image value) {
+ this.doc = value;
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTest.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTest.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,127 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.activation.DataHandler;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.transform.Source;
+import javax.xml.ws.Holder;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import java.awt.*;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0-b26-ea3
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "MTOMTest", targetNamespace = "http://mtomtestservice.org/wsdl", wsdlLocation = "./MTOMTestService.wsdl")
+public interface MTOMTest {
+
+
+ /**
+ *
+ * @param data
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(operationName = "MTOMIn")
+ @WebResult(name = "MTOMInResponse", targetNamespace = "http://mtomtestservice.org/xsd", partName = "result")
+ @SOAPBinding(parameterStyle = ParameterStyle.BARE)
+ public String mtomIn(
+ @WebParam(name = "MTOMIn", targetNamespace = "http://mtomtestservice.org/xsd", partName = "data")
+ DataType data);
+
+ /**
+ *
+ * @param doc1
+ * @param docName1
+ * @param docUrl2
+ * @param docName4
+ * @param doc2
+ * @param docUrl13
+ * @param docName2
+ * @param docUrl14
+ * @param docUrl12
+ * @param docName3
+ * @param docUrl4
+ * @param doc3
+ * @param docUrl1
+ * @param result
+ * @param docUrl11
+ * @param doc4
+ * @param docUrl3
+ */
+ @WebMethod(operationName = "MTOMInOut")
+ @RequestWrapper(localName = "MTOMInOut", targetNamespace = "http://mtomtestservice.org/xsd", className = "org.jboss.test.ws.jaxws.client.DataType2")
+ @ResponseWrapper(localName = "MTOMInOutResponse", targetNamespace = "http://mtomtestservice.org/xsd", className = "org.jboss.test.ws.jaxws.client.DataType2")
+ public void mtomInOut(
+ @WebParam(name = "docName1", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docName1,
+ @WebParam(name = "docName2", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docName2,
+ @WebParam(name = "docName3", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docName3,
+ @WebParam(name = "docName4", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docName4,
+ @WebParam(name = "docUrl1", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl1,
+ @WebParam(name = "docUrl2", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl2,
+ @WebParam(name = "docUrl3", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl3,
+ @WebParam(name = "docUrl4", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl4,
+ @WebParam(name = "docUrl11", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl11,
+ @WebParam(name = "docUrl12", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl12,
+ @WebParam(name = "docUrl13", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl13,
+ @WebParam(name = "docUrl14", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> docUrl14,
+ @WebParam(name = "doc1", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<Source> doc1,
+ @WebParam(name = "doc2", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<Source> doc2,
+ @WebParam(name = "doc3", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<DataHandler> doc3,
+ @WebParam(name = "doc4", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<Image> doc4,
+ @WebParam(name = "result", targetNamespace = "http://mtomtestservice.org/xsd", mode = Mode.INOUT)
+ Holder<String> result);
+
+ /**
+ *
+ * @param urls
+ * @return
+ * returns org.jboss.test.ws.jaxws.client.DataType
+ */
+ @WebMethod(operationName = "MTOMOut")
+ @WebResult(name = "MTOMOutResponse", targetNamespace = "http://mtomtestservice.org/xsd", partName = "data")
+ @SOAPBinding(parameterStyle = ParameterStyle.BARE)
+ public DataType mtomOut(
+ @WebParam(name = "MTOMOut", targetNamespace = "http://mtomtestservice.org/xsd", partName = "urls")
+ String urls);
+
+ /**
+ *
+ * @param urls
+ * @return
+ * returns org.jboss.test.ws.jaxws.client.DataType3
+ */
+ @WebMethod(operationName = "MTOMOut2")
+ @WebResult(name = "MTOMOut2Response", targetNamespace = "http://mtomtestservice.org/xsd", partName = "data")
+ @SOAPBinding(parameterStyle = ParameterStyle.BARE)
+ public DataType3 mtomOut2(
+ @WebParam(name = "MTOMOut2", targetNamespace = "http://mtomtestservice.org/xsd", partName = "urls")
+ String urls);
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestService.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestService.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestService.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,69 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import org.jboss.test.ws.jaxws.client.MTOMTest;
+import org.jboss.test.ws.jaxws.client.MTOMTestService;
+import org.jboss.test.ws.jaxws.client.MTOMTestTwo;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0-b26-ea3
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "MTOMTestService", targetNamespace = "http://mtomtestservice.org/wsdl", wsdlLocation = "./MTOMTestService.wsdl")
+public class MTOMTestService
+ extends Service
+{
+
+ private final static URL WSDL_LOCATION;
+ private final static QName MTOMTESTSERVICE = new QName("http://mtomtestservice.org/wsdl", "MTOMTestService");
+ private final static QName MTOMTESTPORT = new QName("http://mtomtestservice.org/wsdl", "MTOMTestPort");
+ private final static QName MTOMTESTTWOPORT = new QName("http://mtomtestservice.org/wsdl", "MTOMTestTwoPort");
+
+ static {
+ URL url = null;
+ try {
+ url = new URL("file:/home/hbraun/dev/prj/jbossws/trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ WSDL_LOCATION = url;
+ }
+
+ public MTOMTestService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public MTOMTestService() {
+ super(WSDL_LOCATION, MTOMTESTSERVICE);
+ }
+
+ /**
+ *
+ * @return
+ * returns MTOMTest
+ */
+ @WebEndpoint(name = "MTOMTestPort")
+ public MTOMTest getMTOMTestPort() {
+ return (MTOMTest)super.getPort(MTOMTESTPORT, MTOMTest.class);
+ }
+
+ /**
+ *
+ * @return
+ * returns MTOMTestTwo
+ */
+ @WebEndpoint(name = "MTOMTestTwoPort")
+ public MTOMTestTwo getMTOMTestTwoPort() {
+ return (MTOMTestTwo)super.getPort(MTOMTESTTWOPORT, MTOMTestTwo.class);
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestTwo.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestTwo.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/MTOMTestTwo.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,37 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import org.jboss.test.ws.jaxws.client.DataType3;
+import org.jboss.test.ws.jaxws.client.MTOMTestTwo;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0-b26-ea3
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "MTOMTestTwo", targetNamespace = "http://mtomtestservice.org/wsdl", wsdlLocation = "./MTOMTestService.wsdl")
+public interface MTOMTestTwo {
+
+
+ /**
+ *
+ * @param data
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(operationName = "MTOMIn2")
+ @WebResult(name = "MTOMIn2Response", targetNamespace = "http://mtomtestservice.org/xsd", partName = "data")
+ @SOAPBinding(parameterStyle = ParameterStyle.BARE)
+ public String mtomIn2(
+ @WebParam(name = "MTOMIn2", targetNamespace = "http://mtomtestservice.org/xsd", partName = "data")
+ DataType3 data);
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/ObjectFactory.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/ObjectFactory.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/ObjectFactory.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,163 @@
+
+package org.jboss.test.ws.jaxws.client;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+import org.jboss.test.ws.jaxws.client.DataType;
+import org.jboss.test.ws.jaxws.client.DataType2;
+import org.jboss.test.ws.jaxws.client.DataType3;
+import org.jboss.test.ws.jaxws.client.ObjectFactory;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.client package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _MTOMOut_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMOut");
+ private final static QName _MTOMOut2Response_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMOut2Response");
+ private final static QName _MTOMIn2_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMIn2");
+ private final static QName _MTOMIn_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMIn");
+ private final static QName _MTOMInOutResponse_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMInOutResponse");
+ private final static QName _MTOMInResponse_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMInResponse");
+ private final static QName _MTOMOutResponse_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMOutResponse");
+ private final static QName _MTOMIn2Response_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMIn2Response");
+ private final static QName _MTOMInOut_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMInOut");
+ private final static QName _MTOMOut2_QNAME = new QName("http://mtomtestservice.org/xsd", "MTOMOut2");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.client
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link DataType3 }
+ *
+ */
+ public DataType3 createDataType3() {
+ return new DataType3();
+ }
+
+ /**
+ * Create an instance of {@link DataType }
+ *
+ */
+ public DataType createDataType() {
+ return new DataType();
+ }
+
+ /**
+ * Create an instance of {@link DataType2 }
+ *
+ */
+ public DataType2 createDataType2() {
+ return new DataType2();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMOut")
+ public JAXBElement<String> createMTOMOut(String value) {
+ return new JAXBElement<String>(_MTOMOut_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType3 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMOut2Response")
+ public JAXBElement<DataType3> createMTOMOut2Response(DataType3 value) {
+ return new JAXBElement<DataType3>(_MTOMOut2Response_QNAME, DataType3 .class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType3 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMIn2")
+ public JAXBElement<DataType3> createMTOMIn2(DataType3 value) {
+ return new JAXBElement<DataType3>(_MTOMIn2_QNAME, DataType3 .class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMIn")
+ public JAXBElement<DataType> createMTOMIn(DataType value) {
+ return new JAXBElement<DataType>(_MTOMIn_QNAME, DataType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType2 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMInOutResponse")
+ public JAXBElement<DataType2> createMTOMInOutResponse(DataType2 value) {
+ return new JAXBElement<DataType2>(_MTOMInOutResponse_QNAME, DataType2 .class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMInResponse")
+ public JAXBElement<String> createMTOMInResponse(String value) {
+ return new JAXBElement<String>(_MTOMInResponse_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMOutResponse")
+ public JAXBElement<DataType> createMTOMOutResponse(DataType value) {
+ return new JAXBElement<DataType>(_MTOMOutResponse_QNAME, DataType.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMIn2Response")
+ public JAXBElement<String> createMTOMIn2Response(String value) {
+ return new JAXBElement<String>(_MTOMIn2Response_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link DataType2 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMInOut")
+ public JAXBElement<DataType2> createMTOMInOut(DataType2 value) {
+ return new JAXBElement<DataType2>(_MTOMInOut_QNAME, DataType2 .class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://mtomtestservice.org/xsd", name = "MTOMOut2")
+ public JAXBElement<String> createMTOMOut2(String value) {
+ return new JAXBElement<String>(_MTOMOut2_QNAME, String.class, null, value);
+ }
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/ServiceDelegateTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/ServiceDelegateTestCase.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/ServiceDelegateTestCase.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,29 @@
+package org.jboss.test.ws.jaxws.client;
+
+import junit.framework.TestCase;
+
+import javax.xml.ws.Service;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.net.URL;
+
+public class ServiceDelegateTestCase extends TestCase {
+
+ String WSDL_LOC = "resources/jaxws/client/META-INF/MTOMTestService.wsdl";
+
+ public void testPortBySEI() throws Exception
+ {
+ File f = new File(WSDL_LOC);
+ assertTrue("WSDL file not found", f.exists());
+
+ URL wsdlLocation = new URL("file:" +WSDL_LOC);
+ QName serviceName = new QName("http://mtomtestservice.org/wsdl", "MTOMTestService");
+ Service service = Service.create( wsdlLocation, serviceName );
+
+ MTOMTest port = service.getPort(MTOMTest.class);
+ assertNotNull("Failed to create port.", port);
+
+ }
+
+
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/client/package-info.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/client/package-info.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/client/package-info.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,2 @@
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://mtomtestservice.org/xsd")
+package org.jboss.test.ws.jaxws.client;
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderAdmin.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderAdmin.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderAdmin.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,36 @@
+/*
+* 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.jaxws.samples.retail;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.ejb.Remote;
+
+@Remote
+@WebService(name = "OrderAdmin", targetNamespace = "http://org.jboss.ws/samples/retail")
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface OrderAdmin {
+
+ @WebMethod
+ public OrderLineResponse checkOrderLines(OrderLineRequest request);
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineRequest.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineRequest.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineRequest.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,20 @@
+package org.jboss.test.ws.jaxws.samples.retail;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: hbraun
+ * Date: 13.12.2006
+ * Time: 14:18:27
+ * To change this template use File | Settings | File Templates.
+ */
+public class OrderLineRequest {
+ private String reqKey;
+
+ public String getReqKey() {
+ return reqKey;
+ }
+
+ public void setReqKey(String reqKey) {
+ this.reqKey = reqKey;
+ }
+}
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineResponse.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineResponse.java 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/samples/retail/OrderLineResponse.java 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,20 @@
+package org.jboss.test.ws.jaxws.samples.retail;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: hbraun
+ * Date: 13.12.2006
+ * Time: 14:19:03
+ * To change this template use File | Settings | File Templates.
+ */
+public class OrderLineResponse {
+ private int ordersInLine;
+
+ public int getOrdersInLine() {
+ return ordersInLine;
+ }
+
+ public void setOrdersInLine(int ordersInLine) {
+ this.ordersInLine = ordersInLine;
+ }
+}
Added: trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl
===================================================================
--- trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl 2006-12-13 13:36:59 UTC (rev 1638)
+++ trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl 2006-12-13 14:57:55 UTC (rev 1639)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions
+ name="MTOMTestService"
+ targetNamespace="http://mtomtestservice.org/wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://mtomtestservice.org/wsdl"
+ xmlns:s="http://mtomtestservice.org/xsd"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://mtomtestservice.org/xsd"
+ xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
+ elementFormDefault="qualified">
+
+ <complexType name="DataType">
+ <sequence>
+ <element name="docName1" type="string"/>
+ <element name="docName2" type="string"/>
+ <element name="docName3" type="string"/>
+ <element name="docName4" type="string"/>
+ <element name="docUrl1" type="string"/>
+ <element name="docUrl2" type="string"/>
+ <element name="docUrl3" type="string"/>
+ <element name="docUrl4" type="string"/>
+ <element name="doc1" type="base64Binary" xmime:expectedContentTypes="text/xml"/>
+ <element name="doc2" type="base64Binary" xmime:expectedContentTypes="application/xml"/>
+ <element name="doc3" type="base64Binary" xmime:expectedContentTypes="text/html"/>
+ <element name="doc4" type="base64Binary" xmime:expectedContentTypes="image/jpeg"/>
+ </sequence>
+ </complexType>
+ <complexType name="DataType2">
+ <sequence>
+ <element name="docName1" type="string"/>
+ <element name="docName2" type="string"/>
+ <element name="docName3" type="string"/>
+ <element name="docName4" type="string"/>
+ <element name="docUrl1" type="string"/>
+ <element name="docUrl2" type="string"/>
+ <element name="docUrl3" type="string"/>
+ <element name="docUrl4" type="string"/>
+ <element name="docUrl11" type="string"/>
+ <element name="docUrl12" type="string"/>
+ <element name="docUrl13" type="string"/>
+ <element name="docUrl14" type="string"/>
+ <element name="doc1" type="base64Binary" xmime:expectedContentTypes="text/xml"/>
+ <element name="doc2" type="base64Binary" xmime:expectedContentTypes="application/xml"/>
+ <element name="doc3" type="base64Binary" xmime:expectedContentTypes="text/html"/>
+ <element name="doc4" type="base64Binary" xmime:expectedContentTypes="image/jpeg"/>
+ <element name="result" type="string"/>
+ </sequence>
+ </complexType>
+ <complexType name="DataType3">
+ <sequence>
+ <element name="doc" type="base64Binary" xmime:expectedContentTypes="image/jpeg"/>
+ </sequence>
+ </complexType>
+ <element name="MTOMIn" type="s:DataType"/>
+ <element name="MTOMInResponse" type="xsd:string"/>
+ <element name="MTOMIn2" type="s:DataType3"/>
+ <element name="MTOMIn2Response" type="xsd:string"/>
+ <element name="MTOMInOut" type="s:DataType2"/>
+ <element name="MTOMInOutResponse" type="s:DataType2"/>
+ <element name="MTOMOut" type="xsd:string"/>
+ <element name="MTOMOutResponse" type="s:DataType"/>
+ <element name="MTOMOut2" type="xsd:string"/>
+ <element name="MTOMOut2Response" type="s:DataType3"/>
+ </schema>
+ </types>
+ <message name="MTOMInRequest">
+ <part name="data" element="s:MTOMIn"/>
+ </message>
+ <message name="MTOMInResponse">
+ <part name="result" element="s:MTOMInResponse"/>
+ </message>
+ <message name="MTOMIn2Request">
+ <part name="data" element="s:MTOMIn2"/>
+ </message>
+ <message name="MTOMIn2Response">
+ <part name="data" element="s:MTOMIn2Response"/>
+ </message>
+ <message name="MTOMInOutRequest">
+ <part name="data" element="s:MTOMInOut"/>
+ </message>
+ <message name="MTOMInOutResponse">
+ <part name="data" element="s:MTOMInOutResponse"/>
+ </message>
+ <message name="MTOMOutRequest">
+ <part name="urls" element="s:MTOMOut"/>
+ </message>
+ <message name="MTOMOutResponse">
+ <part name="data" element="s:MTOMOutResponse"/>
+ </message>
+ <message name="MTOMOut2Request">
+ <part name="urls" element="s:MTOMOut2"/>
+ </message>
+ <message name="MTOMOut2Response">
+ <part name="data" element="s:MTOMOut2Response"/>
+ </message>
+
+ <portType name="MTOMTest">
+ <operation name="MTOMIn">
+ <input message="tns:MTOMInRequest"/>
+ <output message="tns:MTOMInResponse"/>
+ </operation>
+ <operation name="MTOMInOut">
+ <input message="tns:MTOMInOutRequest"/>
+ <output message="tns:MTOMInOutResponse"/>
+ </operation>
+ <operation name="MTOMOut">
+ <input message="tns:MTOMOutRequest"/>
+ <output message="tns:MTOMOutResponse"/>
+ </operation>
+ <operation name="MTOMOut2">
+ <input message="tns:MTOMOut2Request"/>
+ <output message="tns:MTOMOut2Response"/>
+ </operation>
+ </portType>
+
+ <portType name="MTOMTestTwo">
+ <operation name="MTOMIn2">
+ <input message="tns:MTOMIn2Request"/>
+ <output message="tns:MTOMIn2Response"/>
+ </operation>
+ </portType>
+
+ <binding name="MTOMBinding" type="tns:MTOMTest">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="MTOMIn">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="MTOMInOut">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="MTOMOut">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="MTOMOut2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <binding name="MTOMBindingTwo" type="tns:MTOMTestTwo">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="MTOMIn2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="MTOMTestService">
+ <port name="MTOMTestPort" binding="tns:MTOMBinding">
+ <soap:address location="http://localhost:8080/W2JDLMTOMTest/jaxws/MTOMTest"/>
+ </port>
+ <port name="MTOMTestTwoPort" binding="tns:MTOMBindingTwo">
+ <soap:address location="http://localhost:8080/W2JDLMTOMTest/jaxws/MTOMTestTwo"/>
+ </port>
+ </service>
+</definitions>
Property changes on: trunk/src/test/resources/jaxws/client/META-INF/MTOMTestService.wsdl
___________________________________________________________________
Name: svn:executable
+ *
19 years, 4 months
JBossWS SVN: r1638 - trunk/src/main/java/javax/xml/soap
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-13 08:36:59 -0500 (Wed, 13 Dec 2006)
New Revision: 1638
Modified:
trunk/src/main/java/javax/xml/soap/SOAPFault.java
Log:
Add setFaultCode(QName faultCode)
Modified: trunk/src/main/java/javax/xml/soap/SOAPFault.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFault.java 2006-12-13 13:13:27 UTC (rev 1637)
+++ trunk/src/main/java/javax/xml/soap/SOAPFault.java 2006-12-13 13:36:59 UTC (rev 1638)
@@ -258,12 +258,20 @@
*
* It is preferable to use this method over setFaultCode(String).
*
- * @param faultCodeQName a Name object giving the fault code to be set. It must be namespace qualified.
+ * @param faultCode a Name object giving the fault code to be set. It must be namespace qualified.
* @throws SOAPException if there was an error in adding the faultcode element to the underlying XML tree.
*/
- void setFaultCode(Name faultCodeQName) throws SOAPException;
+ void setFaultCode(Name faultCode) throws SOAPException;
/**
+ * Sets this SOAPFault object with the given fault code. It is preferable to use this method over setFaultCode(Name).
+ * @param faultCode a QName object giving the fault code to be set. It must be namespace qualified.
+ * @throws SOAPException if there was an error in adding the faultcode element to the underlying XML tree.
+ * @since SAAJ 1.3
+ */
+ void setFaultCode(QName faultCode) throws SOAPException;
+
+ /**
* Sets the fault string for this SOAPFault object to the given string.
*
* @param faultString a String giving an explanation of the fault
19 years, 4 months
JBossWS SVN: r1637 - in trunk/src: main/java/javax/xml/soap main/java/org/jboss/ws main/java/org/jboss/ws/core/jaxws/binding main/java/org/jboss/ws/core/soap main/java/org/jboss/ws/core/soap/attachment main/java/org/jboss/ws/metadata/wsdl main/java/org/jboss/ws/tools test/java/org/jboss/test/ws/tools/validation
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-13 08:13:27 -0500 (Wed, 13 Dec 2006)
New Revision: 1637
Added:
trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java
trunk/src/main/java/javax/xml/soap/SAAJResult.java
Modified:
trunk/src/main/java/javax/xml/soap/AttachmentPart.java
trunk/src/main/java/javax/xml/soap/Detail.java
trunk/src/main/java/javax/xml/soap/MessageFactory.java
trunk/src/main/java/javax/xml/soap/SOAPBody.java
trunk/src/main/java/javax/xml/soap/SOAPConnection.java
trunk/src/main/java/javax/xml/soap/SOAPConstants.java
trunk/src/main/java/javax/xml/soap/SOAPElement.java
trunk/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/src/main/java/javax/xml/soap/SOAPFault.java
trunk/src/main/java/javax/xml/soap/SOAPHeader.java
trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java
trunk/src/main/java/javax/xml/soap/SOAPMessage.java
trunk/src/main/java/javax/xml/soap/SOAPPart.java
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
Log:
Update to SAAJ 1.3
Modified: trunk/src/main/java/javax/xml/soap/AttachmentPart.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/AttachmentPart.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/AttachmentPart.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,65 +21,71 @@
*/
package javax.xml.soap;
+import java.io.InputStream;
import java.util.Iterator;
import javax.activation.DataHandler;
/**
- * A single attachment to a SOAPMessage object. A SOAPMessage object may contain zero, one, or many AttachmentPart objects.
- * Each AttachmentPart object consists of two parts, application-specific content and associated MIME headers.
- * The MIME headers consists of name/value pairs that can be used to identify and describe the content.
- *
- * An AttachmentPart object must conform to certain standards.
- *
- * 1. It must conform to MIME [RFC2045] standards</li>
- * 2. It MUST contain content</li>
- * 3. The header portion MUST include the following header:
- *
- * Content-Type
- * This header identifies the type of data in the content of an AttachmentPart object and MUST conform to [RFC2045].
- * The following is an example of a Content-Type header:
- *
- * Content-Type: application/xml
- *
- * The following line of code, in which ap is an AttachmentPart object, sets the header shown in the previous example.
- *
- * ap.setMimeHeader("Content-Type", "application/xml");
- *
- * There are no restrictions on the content portion of an AttachmentPart object. The content may be anything from a
- * simple plain text object to a complex XML document or image file.
- *
- * An AttachmentPart object is created with the method SOAPMessage.createAttachmentPart.
- * After setting its MIME headers, the AttachmentPart object is added to the message that
- * created it with the method SOAPMessage.addAttachmentPart.
- *
- * The following code fragment, in which m is a SOAPMessage object and contentStringl is a String,
- * creates an instance of AttachmentPart, sets the AttachmentPart object with some content and header information,
- * and adds the AttachmentPart object to the SOAPMessage object.
- *
- * AttachmentPart ap1 = m.createAttachmentPart();
- * ap1.setContent(contentString1, "text/plain");
- * m.addAttachmentPart(ap1);
- *
- * The following code fragment creates and adds a second AttachmentPart instance to the same message.
- * jpegData is a binary byte buffer representing the jpeg file.
- *
- * AttachmentPart ap2 = m.createAttachmentPart();
- * byte[] jpegData = ...;
- * ap2.setContent(new ByteArrayInputStream(jpegData), "image/jpeg");
- * m.addAttachmentPart(ap2);
- *
- * The getContent method retrieves the contents and header from an AttachmentPart object.
- * Depending on the DataContentHandler objects present, the returned Object can either be a typed Java object
- * corresponding to the MIME type or an InputStream object that contains the content as bytes.
- *
- * String content1 = ap1.getContent();
- * java.io.InputStream content2 = ap2.getContent();
- *
- * The method clearContent removes all the content from an AttachmentPart object but does not affect its header information.
- *
- * ap1.clearContent();
- *
+ A single attachment to a SOAPMessage object. A SOAPMessage object may contain zero, one, or
+ many AttachmentPart objects. Each AttachmentPart object consists of two parts, applicationspecific
+ content and associated MIME headers. The MIME headers consists of name/value pairs that can
+ be used to identify and describe the content.
+
+ An AttachmentPart object must conform to certain standards.
+
+ 1. It must conform to MIME [RFC2045] standards (http://www.ietf.org/rfc/rfc2045.txt)
+ 2. It MUST contain content
+ 3. The header portion MUST include the following header:
+
+ Content-Type
+ This header identifies the type of data in the content of an AttachmentPart object and MUST
+ conform to [RFC2045]. The following is an example of a Content-Type header:
+
+ Content-Type: application/xml
+
+ The following line of code, in which ap is an AttachmentPart object, sets the header shown in the
+ previous example.
+
+ ap.setMimeHeader(“Content-Type”, “application/xml”);
+
+ There are no restrictions on the content portion of an AttachmentPart object. The content may be
+ anything from a simple plain text object to a complex XML document or image file.
+
+ An AttachmentPart object is created with the method
+ SOAPMessage.createAttachmentPart. After setting its MIME headers, the
+ AttachmentPart object is added to the message that created it with the method
+ SOAPMessage.addAttachmentPart.
+
+ The following code fragment, in which m is a SOAPMessage object and contentStringl is a
+ String, creates an instance of AttachmentPart, sets the AttachmentPart object with some
+ content and header information, and adds the AttachmentPart object to the SOAPMessage object.
+
+ AttachmentPart ap1 = m.createAttachmentPart();
+ ap1.setContent(contentString1, “text/plain”);
+ m.addAttachmentPart(ap1);
+
+ The following code fragment creates and adds a second AttachmentPart instance to the same
+ message. jpegData is a binary byte buffer representing the jpeg file.
+
+ AttachmentPart ap2 = m.createAttachmentPart();
+ byte[] jpegData = ...;
+ ap2.setContent(new ByteArrayInputStream(jpegData), “image/jpeg”);
+ m.addAttachmentPart(ap2);
+
+ The getContent method retrieves the contents and header from an AttachmentPart object.
+ Depending on the DataContentHandler objects present, the returned Object can either be a
+ typed Java object corresponding to the MIME type or an InputStream object that contains the
+ content as bytes.
+
+ String content1 = ap1.getContent();
+ java.io.InputStream content2 = ap2.getContent();
+
+ The method clearContent removes all the content from an AttachmentPart object but does not
+ affect its header information.
+
+ ap1.clearContent();
+
* @author Scott.Stark(a)jboss.org
* @version $Revision$
*/
@@ -135,6 +141,40 @@
public abstract Object getContent() throws SOAPException;
/**
+ * Returns an InputStream which can be used to obtain the content of AttachmentPart as Base64 encoded character data,
+ * this method would base64 encode the raw bytes of the attachment and return.
+ *
+ * @return an InputStream from which the Base64 encoded AttachmentPart can be read.
+ * @throws SOAPException if there is no content set into this AttachmentPart object or if there was a data transformation error.
+ * @since SAAJ 1.3
+ */
+ public abstract InputStream getBase64Content() throws SOAPException;
+
+ /**
+ * Gets the content of this AttachmentPart object as an InputStream as if a call had been made to getContent and no DataContentHandler
+ * had been registered for the content-type of this AttachmentPart.
+ *
+ * Note that reading from the returned InputStream would result in consuming the data in the stream.
+ * It is the responsibility of the caller to reset the InputStream appropriately before calling a Subsequent API.
+ * If a copy of the raw attachment content is required then the getRawContentBytes() API should be used instead.
+ *
+ * @return an InputStream from which the raw data contained by the AttachmentPart can be accessed.
+ * @throws SOAPException if there is no content set into this AttachmentPart object or if there was a data transformation error.
+ * @since SAAJ 1.3
+ */
+ public abstract java.io.InputStream getRawContent() throws SOAPException;
+
+ /**
+ * Gets the content of this AttachmentPart object as a byte[] array as if a call had been
+ * made to getContent and no DataContentHandler had been registered for the content-type of this AttachmentPart.
+ *
+ * @return a byte[] array containing the raw data of the AttachmentPart.
+ * @throws SOAPException if there is no content set into this AttachmentPart object or if there was a data transformation error.
+ * @since SAAJ 1.3
+ */
+ public abstract byte[] getRawContentBytes() throws SOAPException;
+
+ /**
* Gets the DataHandler object for this AttachmentPart object.
* @return object associated with this AttachmentPart object
* @throws SOAPException if there is no data in this AttachmentPart object
@@ -194,6 +234,46 @@
public abstract void setContent(Object object, String contentType);
/**
+ * Sets the content of this attachment part to that contained by the InputStream content and sets the value of the Content-Type header to the value contained in contentType.
+ *
+ * A subsequent call to getSize() may not be an exact measure of the content size.
+ *
+ * @param content the raw data to add to the attachment part
+ * @param contentType the value to set into the Content-Type header
+ * @throws SOAPException if an there is an error in setting the content
+ * @throws NullPointerException if content is null
+ * @since SAAJ 1.3
+ */
+ public abstract void setRawContent(InputStream content, String contentType) throws SOAPException;
+
+ /**
+ * Sets the content of this attachment part to that contained by the byte[] array content and sets the value of the Content-Type
+ * header to the value contained in contentType.
+ *
+ * @param content the raw data to add to the attachment part
+ * @param contentType the value to set into the Content-Type header
+ * @param offset the offset in the byte array of the content
+ * @param len the number of bytes that form the content
+ * @throws SOAPException if an there is an error in setting the content or content is null
+ * @since SAAJ 1.3
+ */
+ public abstract void setRawContentBytes(byte[] content, int offset, int len, String contentType) throws SOAPException;
+
+ /**
+ * Sets the content of this attachment part from the Base64 source InputStream and sets the value of the Content-Type header
+ * to the value contained in contentType, This method would first decode the base64 input and write the resulting raw bytes to the attachment.
+ *
+ * A subsequent call to getSize() may not be an exact measure of the content size.
+ *
+ * @param content the base64 encoded data to add to the attachment part
+ * @param contentType the value to set into the Content-Type header
+ * @throws SOAPException if an there is an error in setting the content
+ * @throws NullPointerException if content is null
+ * @since SAAJ 1.3
+ */
+ public abstract void setBase64Content(InputStream content, String contentType) throws SOAPException;
+
+ /**
* Sets the given DataHandler object as the data handler for this AttachmentPart object.
* Typically, on an incoming message, the data handler is automatically set.
* When a message is being created and populated with content, the setDataHandler method can be used to get data
Modified: trunk/src/main/java/javax/xml/soap/Detail.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/Detail.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/Detail.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,33 +23,52 @@
import java.util.Iterator;
-/** A container for DetailEntry objects. DetailEntry objects give detailed
- * error information that is application-specific and related to the SOAPBody
- * object that contains it.
- *
- * A Detail object, which is part of a SOAPFault object, can be retrieved using
- * the method SOAPFault.getDetail. The Detail interface provides two methods.
- * One creates a new DetailEntry object and also automatically adds it to the
- * Detail object. The second method gets a list of the DetailEntry objects
- * contained in a Detail object.
- *
- * The following code fragment, in which sf is a SOAPFault object, gets its
- * Detail object (d), adds a new DetailEntry object to d, and then gets a list
- * of all the DetailEntry objects in d. The code also creates a Name object to
- * pass to the method addDetailEntry. The variable se, used to create the Name
- * object, is a SOAPEnvelope object.
- Detail d = sf.getDetail();
- Name name = se.createName("GetLastTradePrice", "WOMBAT",
- "http://www.wombat.org/trader");
- d.addDetailEntry(name);
- Iterator it = d.getDetailEntries();
+import javax.xml.namespace.QName;
+/**
+ A container for DetailEntry objects. DetailEntry objects give detailed error information that is
+ application-specific and related to the SOAPBody object that contains it.
+
+ A Detail object, which is part of a SOAPFault object, can be retrieved using the method
+ SOAPFault.getDetail. The Detail interface provides two methods. One creates a new
+ DetailEntry object and also automatically adds it to the Detail object. The second method gets a
+ list of the DetailEntry objects contained in a Detail object.
+
+ The following code fragment, in which sf is a SOAPFault object, gets its Detail object (d), adds a
+ new DetailEntry object to d, and then gets a list of all the DetailEntry objects in d. The code
+ also creates a Name object to pass to the method addDetailEntry. The variable se, used to create the
+ Name object, is a SOAPEnvelope object.
+
+ Detail d = sf.getDetail();
+ Name name = se.createName(“GetLastTradePrice”, “WOMBAT”, “http://www.wombat.org/trader”);
+ d.addDetailEntry(name);
+ Iterator it = d.getDetailEntries();
+
* @author Scott.Stark(a)jboss.org
* @version $Revision$
*/
public interface Detail extends SOAPFaultElement
{
+ /**
+ * Creates a new DetailEntry object with the given name and adds it to this Detail object.
+ * @param name a Name object identifying the new DetailEntry object
+ * @throws SOAPException thrown when there is a problem in adding a DetailEntry object to this Detail object.
+ */
public DetailEntry addDetailEntry(Name name) throws SOAPException;
+ /**
+ * Creates a new DetailEntry object with the given QName and adds it to this Detail object.
+ * This method is the preferred over the one using Name.
+ *
+ * @param qname a QName object identifying the new DetailEntry object
+ * @throws SOAPException thrown when there is a problem in adding a DetailEntry object to this Detail object.
+ * @since SAAJ 1.3
+ */
+ public DetailEntry addDetailEntry(QName qname) throws SOAPException;
+
+ /**
+ * Gets an Iterator over all of the DetailEntrys in this Detail object.
+ * @return an Iterator object over the DetailEntry objects in this Detail object
+ */
public Iterator getDetailEntries();
}
Modified: trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -27,33 +27,32 @@
import java.security.PrivilegedAction;
import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
/**
- * A factory for creating SOAPMessage objects.
+ A factory for creating SOAPMessage objects.
+
+ A SAAJ client can create a MessageFactory object using the method newInstance, as shown in the following lines of code.
+
+ MessageFactory mf = MessageFactory.newInstance();
+ MessageFactory mf12 = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+
+
+ All MessageFactory objects, regardless of how they are created, will produce SOAPMessage objects that have the following elements by default:
+
+ * A SOAPPart object
+ * A SOAPEnvelope object
+ * A SOAPBody object
+ * A SOAPHeader object
+
+ In some cases, specialized MessageFactory objects may be obtained that produce messages prepopulated with additional entries in the SOAPHeader object and the SOAPBody object. The content of a new SOAPMessage object depends on which of the two MessageFactory methods is used to create it.
+
+ * createMessage()
+ This is the method clients would normally use to create a request message.
+ * createMessage(MimeHeaders, java.io.InputStream) -- message has content from the InputStream object and headers from the MimeHeaders object
+ This method can be used internally by a service implementation to create a message that is a response to a request.
+
*
- * A SAAJ client can create a MessageFactory object using the method newInstance, as shown in the following line of code.
- *
- * MessageFactory mf = MessageFactory.newInstance();
- *
- * A standalone client (a client that is not running in a container) can use the newInstance method to create a MessageFactory object.
- *
- * All MessageFactory objects, regardless of how they are created, will produce SOAPMessage objects that have the following elements by default:
- *
- * A SOAPPart object
- * A SOAPEnvelope object
- * A SOAPBody object
- * A SOAPHeader object
- *
- * MessageFactory objects can be initialized with a JAXM profile. In such a case it will produce messages that also
- * come prepopulated with additional entries in the SOAPHeader object and the SOAPBody object. The content of a new
- * SOAPMessage object depends on which of the two MessageFactory methods is used to create it.
- *
- * createMessage() -- message has no content
- * This is the method clients would normally use to create a request message.
- *
- * createMessage(MimeHeaders, java.io.InputStream) -- message has content from the InputStream object and headers from the MimeHeaders object
- * This method can be used internally by a service implementation to create a message that is a response to a request.
- *
* @author Scott.Stark(a)jboss.org
* @version $Revision$
*/
@@ -61,55 +60,55 @@
{
// provide logging
private static Logger log = Logger.getLogger(MessageFactory.class);
-
+
private static final String DEFAULT_MESSAGE_FACTORY = "org.jboss.ws.core.soap.MessageFactoryImpl";
- private static final String[] alternativeFactories = new String[] { "org.jboss.axis.soap.MessageFactoryImpl" };
- /** Creates a new MessageFactory object that is an instance of the default implementation.
+ /**
+ * Creates a new MessageFactory object that is an instance of the default implementation (SOAP 1.1),
+ * This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load:
+
+ * Use the javax.xml.soap.MessageFactory system property.
+ * Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ * Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.MessageFactory in jars available to the runtime.
+ * Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
*/
public static MessageFactory newInstance() throws SOAPException
{
PrivilegedAction action = new PropertyAccessAction(MessageFactory.class.getName(), DEFAULT_MESSAGE_FACTORY);
String factoryName = (String)AccessController.doPrivileged(action);
+
+ //TODO: SAAJ 1.3 (implement the lookup)
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
- try
- {
- Class factoryClass = loader.loadClass(factoryName);
- return (MessageFactory)factoryClass.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- // Throw the exception if the user asked for a specific factory
- if (factoryName.equals(DEFAULT_MESSAGE_FACTORY) == false)
- throw e;
-
- for (int i = 0; i < alternativeFactories.length; i++)
- {
- factoryName = alternativeFactories[i];
- try
- {
- Class factoryClass = loader.loadClass(factoryName);
- return (MessageFactory)factoryClass.newInstance();
- }
- catch (ClassNotFoundException e1)
- {
- log.debug("Cannot load factory: " + factoryName);
- }
- }
- }
+ Class factoryClass = loader.loadClass(factoryName);
+ return (MessageFactory)factoryClass.newInstance();
}
catch (Throwable t)
{
throw new SOAPException("Failed to create MessageFactory: " + factoryName, t);
}
-
- throw new SOAPException("Cannot find MessageFactory implementation");
}
/**
+ * Creates a new MessageFactory object that is an instance of the specified implementation.
+ * May be a dynamic message factory, a SOAP 1.1 message factory, or a SOAP 1.2 message factory.
+ * A dynamic message factory creates messages based on the MIME headers specified as arguments to the createMessage method.
+ * This method uses the SAAJMetaFactory to locate the implementation class and create the MessageFactory instance.
+ *
+ * @param protocol a string constant representing the class of the specified message factory implementation.
+ * May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.
+ * @throws SOAPException if there was an error in creating the specified implementation of MessageFactory.
+ * @since SAAJ 1.3
+ */
+ public static MessageFactory newInstance(String protocol) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
* Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects.
* Profile-specific message factories can choose to prepopulate the SOAPMessage object with profile-specific headers.
*
Added: trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -0,0 +1,77 @@
+/*
+ * 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 javax.xml.soap;
+
+import org.jboss.util.NotImplementedException;
+
+// $Id$
+
+/**
+ * The access point for the implementation classes of the factories defined in the SAAJ API.
+ * All of the newInstance methods defined on factories in SAAJ 1.3 defer to instances of this class to do the actual object creation.
+ * The implementations of newInstance() methods (in SOAPFactory and MessageFactory) that existed in SAAJ 1.2
+ * have been updated to also delegate to the SAAJMetaFactory when the SAAJ 1.2 defined lookup fails to locate the Factory implementation class name.
+ *
+ * SAAJMetaFactory is a service provider interface. There are no public methods on this class.
+ *
+ * @since SAAJ 1.3
+ */
+public abstract class SAAJMetaFactory
+{
+ protected SAAJMetaFactory()
+ {
+ }
+
+ /**
+ * Creates a new instance of a concrete SAAJMetaFactory object. The SAAJMetaFactory is an SPI,
+ * it pulls the creation of the other factories together into a single place. Changing out the SAAJMetaFactory
+ * has the effect of changing out the entire SAAJ implementation. Service providers provide the name of their SAAJMetaFactory
+ * implementation. This method uses the following ordered lookup procedure to determine the SAAJMetaFactory implementation class to load:
+ *
+ * - Use the javax.xml.soap.MetaFactory system property.
+ * - Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ * - Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.MetaFactory in jars available to the runtime.
+ * - Default to com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl.
+ *
+ * @return a concrete SAAJMetaFactory object
+ * @throws SOAPException if there is an error in creating the SAAJMetaFactory
+ */
+ static SAAJMetaFactory getInstance() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a MessageFactory object for the given String protocol.
+ * @param protocol a String indicating the protocol (SOAPConstants.SOAP_1_1_PROTOCOL, SOAPConstants.SOAP_1_2_PROTOCOL, SOAPConstants.DYNAMIC_SOAP_PROTOCOL)
+ * @throws SOAPException if there is an error in creating the MessageFactory
+ */
+ protected abstract MessageFactory newMessageFactory(String protocol) throws SOAPException;
+
+ /**
+ * Creates a SOAPFactory object for the given String protocol.
+ * @param protocol a String indicating the protocol (SOAPConstants.SOAP_1_1_PROTOCOL, SOAPConstants.SOAP_1_2_PROTOCOL, SOAPConstants.DYNAMIC_SOAP_PROTOCOL)
+ * @throws SOAPException if there is an error in creating the SOAPFactory
+ */
+ protected abstract SOAPFactory newSOAPFactory(String protocol) throws SOAPException;
+}
Property changes on: trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/javax/xml/soap/SAAJResult.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SAAJResult.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SAAJResult.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -0,0 +1,109 @@
+/*
+ * 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 javax.xml.soap;
+
+// $Id$
+
+import javax.xml.transform.dom.DOMResult;
+
+import org.jboss.util.NotImplementedException;
+
+/**
+ * Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree.
+ * These results should be accessed by using the getResult() method. The DOMResult.getNode() method should be avoided in almost all cases.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since SAAJ 1.3
+ */
+public class SAAJResult extends DOMResult
+{
+ /**
+ * Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.
+ *
+ * This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that
+ * takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation,
+ * the results are populated into the SOAPPart of a SOAPMessage that is created internally.
+ * The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.
+ * @throws SOAPException if there is a problem creating a SOAPMessage
+ * @since SAAJ 1.3
+ */
+ public SAAJResult() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the specified protocol.
+ * The DYNAMIC_SOAP_PROTOCOL is ambiguous in this context and will cause this constructor to throw an UnsupportedOperationException.
+ *
+ * This kind of SAAJResult is meant for use in situations where the results will be used as a parameter to a method that takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation the results are populated into the SOAPPart of a SOAPMessage that is created internally. The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.
+ *
+ * @param protocol the name of the SOAP protocol that the resulting SAAJ tree should support
+ * @throws SOAPException if a SOAPMessage supporting the specified protocol cannot be created
+ * @since SAAJ 1.3
+ */
+ public SAAJResult(String protocol) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a SAAJResult that will write the results into the SOAPPart of the supplied SOAPMessage.
+ * In the normal case these results will be written using DOM APIs and, as a result, the finished SOAPPart
+ * will not be guaranteed to be well-formed unless the data used to create it is also well formed. When used in a
+ * transformation the validity of the SOAPMessage after the transformation can be guaranteed only by means outside SAAJ specification.
+ *
+ * @param message the message whose SOAPPart will be populated as a result of some transformation or marshalling operation
+ * @since SAAJ 1.3
+ */
+ public SAAJResult(SOAPMessage message)
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a SAAJResult that will write the results as a child node of the SOAPElement specified.
+ * In the normal case these results will be written using DOM APIs and as a result may invalidate the structure of the SAAJ tree.
+ * This kind of SAAJResult should only be used when the validity of the incoming data can be guaranteed by means outside of the SAAJ specification.
+ *
+ * @param rootNode the root to which the results will be appended
+ * @since SAAJ 1.3
+ */
+ public SAAJResult(SOAPElement rootNode)
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * @return the resulting Tree that was created under the specified root Node.
+ * @since SAAJ 1.3
+ */
+ public Node getResult()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+}
Property changes on: trunk/src/main/java/javax/xml/soap/SAAJResult.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/javax/xml/soap/SOAPBody.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPBody.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPBody.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,6 +23,8 @@
import java.util.Locale;
+import javax.xml.namespace.QName;
+
import org.w3c.dom.Document;
/** An object that represents the contents of the SOAP body element in a SOAP
@@ -46,6 +48,15 @@
*/
public abstract SOAPBodyElement addBodyElement(Name name) throws SOAPException;
+ /**
+ * Creates a new SOAPBodyElement object with the specified QName and adds it to this SOAPBody object.
+ * @param qname a QName object with the qname for the new SOAPBodyElement object
+ * @return the new SOAPBodyElement object
+ * @throws SOAPException if a SOAP error occurs
+ * @since SAAJ 1.3
+ */
+ public abstract SOAPBodyElement addBodyElement(QName qname) throws SOAPException;
+
/** Adds the root node of the DOM Document to this SOAPBody object.
*
* Calling this method invalidates the document parameter.
@@ -81,6 +92,26 @@
* @throws SOAPException if there is a SOAP error
*/
public abstract SOAPFault addFault(Name faultCode, String faultString) throws SOAPException;
+
+ /**
+ * Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault
+ * depending on the protocol specified while creating the MessageFactory instance.
+ *
+ * For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value
+ * of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the
+ * faultString parameter is the value of the faultstring element.
+ *
+ * In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang attribute on the Fault/Reason/Text element will be
+ * set to java.util.Locale.getDefault()
+ *
+ * A SOAPBody may contain at most one SOAPFault child element
+ *
+ * @param faultCode a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
+ * @param faultString a String giving an explanation of the fault
+ * @throws SOAPException if there is a SOAP error
+ * @since SAAJ 1.3
+ */
+ public abstract SOAPFault addFault(QName faultCode, String faultString) throws SOAPException;
/** Creates a new SOAPFault object and adds it to this SOAPBody object.
*
@@ -97,6 +128,25 @@
*/
public abstract SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException;
+ /**
+ * Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2
+ * SOAPFault depending on the protocol specified while creating the MessageFactory instance.
+ *
+ * For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is
+ * the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element
+ * and the faultString parameter is the value of the faultstring element.
+ *
+ * A SOAPBody may contain at most one SOAPFault child element.
+ *
+ * @param faultCode a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
+ * @param faultString a String giving an explanation of the fault
+ * @param locale a Locale object indicating the native language of the faultString
+ * @return the new SOAPFault object
+ * @throws SOAPException if there is a SOAP error
+ * @since SAAJ 1.3
+ */
+ public abstract SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException;
+
/** Returns the SOAPFault object in this SOAPBody object.
*
* @return the SOAPFault object in this SOAPBody object
@@ -108,4 +158,13 @@
* @return true if a SOAPFault object exists in this SOAPBody object; false otherwise
*/
public abstract boolean hasFault();
+
+ /**
+ * Creates a new DOM Document and sets the first child of this SOAPBody as it's document element.
+ * The child SOAPElement is removed as part of the process.
+ * @return the Document representation of the SOAPBody content.
+ * @throws SOAPException if there is not exactly one child SOAPElement of the SOAPBody.
+ * @since SAAJ 1.3
+ */
+ public Document extractContentAsDocument() throws SOAPException;
}
Modified: trunk/src/main/java/javax/xml/soap/SOAPConnection.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPConnection.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPConnection.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,6 +21,8 @@
*/
package javax.xml.soap;
+import org.jboss.util.NotImplementedException;
+
/** A point-to-point connection that a client can use for sending messages directly to a remote
* party (represented by a URL, for instance).
*
@@ -54,6 +56,19 @@
*/
public abstract SOAPMessage call(SOAPMessage request, Object to) throws SOAPException;
+ /**
+ * Gets a message from a specific endpoint and blocks until it receives,
+ * @param to an Object that identifies where the request should be sent. Objects of type java.lang.String and java.net.URL must be supported.
+ * @return the SOAPMessage object that is the response to the get message request
+ * @throws SOAPException if there is a SOAP error
+ * @since SAAJ 1.3
+ */
+ public SOAPMessage get(Object to) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
/** Closes this SOAPConnection object.
*
* @throws SOAPException if there is a SOAP error
Modified: trunk/src/main/java/javax/xml/soap/SOAPConstants.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPConstants.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPConstants.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,13 +21,55 @@
*/
package javax.xml.soap;
-/** The definition of constants pertaining to the SOAP 1.1 protocol.
+import javax.xml.namespace.QName;
+
+/** The definition of constants pertaining to the SOAP protocol.
* @author Scott.Stark(a)jboss.org
+ * @author Thomas.Diesler(a)jboss.org
* @version $Revision$
*/
public interface SOAPConstants
{
- public static final String URI_NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
- public static final String URI_NS_SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
- public static final String URI_SOAP_ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next";
+ /** The default protocol: SOAP 1.1 for backwards compatibility. */
+ String DEFAULT_SOAP_PROTOCOL = "SOAP 1.1 Protocol";
+ /** Used to create MessageFactory instances that create SOAPMessages whose concrete type is based on the Content-Type MIME header passed to the createMessage method. */
+ String DYNAMIC_SOAP_PROTOCOL = "Dynamic Protocol";
+ /** The media type of the Content-Type MIME header in SOAP 1.1. */
+ String SOAP_1_1_CONTENT_TYPE = "text/xml";
+ /** Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.1 specification */
+ String SOAP_1_1_PROTOCOL = "SOAP 1.1 Protocol";
+ /** The media type of the Content-Type MIME header in SOAP 1.2. */
+ String SOAP_1_2_CONTENT_TYPE = "application/soap+xml";
+ /** Used to create MessageFactory instances that create SOAPMessages whose behavior supports the SOAP 1.2 specification */
+ String SOAP_1_2_PROTOCOL = "SOAP 1.2 Protocol";
+ /** The default namespace prefix for http://www.w3.org/2003/05/soap-envelope */
+ String SOAP_ENV_PREFIX = "env";
+ /** The namespace identifier for the SOAP 1.1 envelope. */
+ String URI_NS_SOAP_1_1_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
+ /** The namespace identifier for the SOAP 1.2 encoding. */
+ String URI_NS_SOAP_1_2_ENCODING = "http://www.w3.org/2003/05/soap-encoding";
+ /** The namespace identifier for the SOAP 1.2 envelope. */
+ String URI_NS_SOAP_1_2_ENVELOPE = "http://www.w3.org/2003/05/soap-envelope";
+ /** The namespace identifier for the SOAP 1.1 encoding. */
+ String URI_NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
+ /** The namespace identifier for the SOAP 1.1 envelope, All SOAPElements in this namespace are defined by the SOAP 1.1 specification. */
+ String URI_NS_SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
+ /** The URI identifying the next application processing a SOAP request as the intended role for a SOAP 1.2 header entry (see section 2.2 of part 1 of the SOAP 1.2 specification). */
+ String URI_SOAP_1_2_ROLE_NEXT = "http://www.w3.org/2003/05/soap-envelope/role/next";
+ /** The URI specifying the role None in SOAP 1.2. */
+ String URI_SOAP_1_2_ROLE_NONE = "http://www.w3.org/2003/05/soap-envelope/role/none";
+ /** The URI identifying the ultimate receiver of the SOAP 1.2 message. */
+ String URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER = "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";
+ /** The URI identifying the next application processing a SOAP request as the intended actor for a SOAP 1.1 header entry (see section 4.2.2 of the SOAP 1.1 specification). */
+ String URI_SOAP_ACTOR_NEXT = "http://schemas.xmlsoap.org/soap/actor/next";
+ /** SOAP 1.2 VersionMismatch Fault */
+ QName SOAP_VERSIONMISMATCH_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "VersionMismatch");
+ /** SOAP 1.2 MustUnderstand Fault */
+ QName SOAP_MUSTUNDERSTAND_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "MustUnderstand");
+ /** SOAP 1.2 DataEncodingUnknown Fault */
+ QName SOAP_DATAENCODINGUNKNOWN_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "DataEncodingUnknown");
+ /** SOAP 1.2 Sender Fault */
+ QName SOAP_SENDER_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "Sender");
+ /** SOAP 1.2 Receiver Fault */
+ QName SOAP_RECEIVER_FAULT = new QName("http://www.w3.org/2003/05/soap-envelope", "Receiver");
}
Modified: trunk/src/main/java/javax/xml/soap/SOAPElement.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPElement.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPElement.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.xml.namespace.QName;
+
import org.w3c.dom.Element;
/** An object representing an element of a SOAP message that is allowed but not
@@ -47,15 +49,35 @@
* @return the SOAPElement object into which the attribute was inserted
* @throws SOAPException if there is an error in creating the Attribute
*/
- public abstract SOAPElement addAttribute(Name name, String value) throws SOAPException;
+ SOAPElement addAttribute(Name name, String value) throws SOAPException;
+ /**
+ * Adds an attribute with the specified name and value to this SOAPElement object.
+ * @param qname a QName object with the name of the attribute
+ * @param value a String giving the value of the attribute
+ * @return the SOAPElement object into which the attribute was inserted
+ * @throws SOAPException if there is an error in creating the Attribute, or it is invalid to set an attribute with QName qname on this SOAPElement.
+ * @since SAAJ 1.3
+ */
+ SOAPElement addAttribute(QName qname, String value) throws SOAPException;
+
/** Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object.
*
* @param name a String giving the local name for the element
* @return the new SOAPElement object that was created
* @throws SOAPException if there is an error in creating the SOAPElement object
*/
- public abstract SOAPElement addChildElement(String name) throws SOAPException;
+ SOAPElement addChildElement(String name) throws SOAPException;
+
+ /**
+ * Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object.
+ * The namespace, localname and prefix of the new SOAPElement are all taken from the qname argument.
+ * @param qname a QName object with the XML name for the new element
+ * @return the new SOAPElement object that was created
+ * @throws SOAPException if there is an error in creating the SOAPElement object
+ * @since SAAJ 1.3
+ */
+ SOAPElement addChildElement(QName qname) throws SOAPException;
/** Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
*
@@ -64,7 +86,7 @@
* @return the new SOAPElement object that was created
* @throws SOAPException if there is an error in creating the SOAPElement object
*/
- public abstract SOAPElement addChildElement(String localName, String prefix) throws SOAPException;
+ SOAPElement addChildElement(String localName, String prefix) throws SOAPException;
/** Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
*
@@ -74,7 +96,7 @@
* @return the new SOAPElement object that was created
* @throws SOAPException if there is an error in creating the SOAPElement object
*/
- public abstract SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException;
+ SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException;
/** Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
*
@@ -82,7 +104,7 @@
* @return the new SOAPElement object that was created
* @throws SOAPException if there is an error in creating the SOAPElement object
*/
- public abstract SOAPElement addChildElement(Name name) throws SOAPException;
+ SOAPElement addChildElement(Name name) throws SOAPException;
/** Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPElementFactory.
*
@@ -99,7 +121,7 @@
* @return an instance representing the new SOAP element that was actually added to the tree.
* @throws SOAPException if there was an error in adding this element as a child
*/
- public abstract SOAPElement addChildElement(SOAPElement child) throws SOAPException;
+ SOAPElement addChildElement(SOAPElement child) throws SOAPException;
/** Adds a namespace declaration with the specified prefix and URI to this SOAPElement object.
*
@@ -108,7 +130,7 @@
* @return the SOAPElement object into which this namespace declaration was inserted.
* @throws SOAPException if there is an error in creating the namespace
*/
- public abstract SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException;
+ SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException;
/** Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
*
@@ -116,8 +138,20 @@
* @return the SOAPElement object into which the new Text object was inserted
* @throws SOAPException if there is an error in creating the new Text object
*/
- public abstract SOAPElement addTextNode(String text) throws SOAPException;
+ SOAPElement addTextNode(String text) throws SOAPException;
+ /**
+ * Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.
+ * The remaining elements of the new QName are taken directly from the parameters, localName and prefix.
+ * @param localName a String containing the local part of the name.
+ * @param prefix a String containing the prefix for the name.
+ * @return a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement.
+ * This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as it's parameter.
+ * @throws SOAPException if the QName cannot be created.
+ * @since SAAJ 1.3
+ */
+ QName createQName(String localName, String prefix) throws SOAPException;
+
/** Returns an Iterator over all of the attribute Name objects in this SOAPElement object.
*
* The iterator can be used to get the attribute names, which can then be passed to the method getAttributeValue to
@@ -125,15 +159,31 @@
*
* @return an iterator over the names of the attributes
*/
- public abstract Iterator getAllAttributes();
+ Iterator getAllAttributes();
+ /**
+ * Returns an Iterator over all of the attributes in this SOAPElement as QName objects.
+ * The iterator can be used to get the attribute QName, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.
+ * @return an iterator over the QNames of the attributes
+ * @since SAAJ 1.3
+ */
+ Iterator getAllAttributesAsQNames();
+
/** Returns the value of the attribute with the specified name.
*
* @param name a Name object with the name of the attribute
* @return a String giving the value of the specified attribute
*/
- public abstract String getAttributeValue(Name name);
+ String getAttributeValue(Name name);
+ /**
+ * Returns the value of the attribute with the specified qname.
+ * @param qname a QName object with the qname of the attribute
+ * @return a String giving the value of the specified attribute, Null if there is no such attribute
+ * @since SAAJ 1.3
+ */
+ String getAttributeValue(QName qname);
+
/** Returns an Iterator over all the immediate child Nodes of this element.
*
* This includes javax.xml.soap.Text objects as well as SOAPElement objects.
@@ -145,7 +195,7 @@
*
* @return an iterator with the content of this SOAPElement object
*/
- public abstract Iterator getChildElements();
+ Iterator getChildElements();
/** Returns an Iterator over all the immediate child Nodes of this element with the specified name.
*
@@ -159,19 +209,54 @@
* @param name a Name object with the name of the child elements to be returned
* @return an Iterator object over all the elements in this SOAPElement object with the specified name
*/
- public abstract Iterator getChildElements(Name name);
+ Iterator getChildElements(Name name);
+ /**
+ * Returns an Iterator over all the immediate child Nodes of this element with the specified qname.
+ * All of these children will be SOAPElement nodes.
+ *
+ * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by
+ * SOAPElement, SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node.
+ * As a result the calling application must treat any existing references to these child nodes that have been obtained through
+ * DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator.
+ * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details.
+ * @param qname a QName object with the qname of the child elements to be returned
+ * @return an Iterator object over all the elements in this SOAPElement object with the specified qname
+ * @since SAAJ 1.3
+ */
+ Iterator getChildElements(QName qname);
+
/** Returns the name of this SOAPElement object.
*
* @return a Name object with the name of this SOAPElement object
*/
- public abstract Name getElementName();
+ Name getElementName();
+ /**
+ * Returns the qname of this SOAPElement object.
+ * @return a QName object with the qname of this SOAPElement object
+ * @since SAAJ 1.3
+ */
+ QName getElementQName();
+
+ /**
+ * Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot
+ * have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.
+ *
+ * Callers should not rely on the element instance being renamed as is.
+ * Implementations could end up copying the content of the SOAPElement to a renamed instance.
+ * @param qname the new name for the Element.
+ * @return The renamed Node
+ * @throws SOAPException if changing the name of this Element is not allowed.
+ * @since SAAJ 1.3
+ */
+ SOAPElement setElementQName(QName qname) throws SOAPException;
+
/** Returns the encoding style for this SOAPElement object.
*
* @return a String giving the encoding style
*/
- public abstract String getEncodingStyle();
+ String getEncodingStyle();
/** Returns an Iterator over the namespace prefix Strings declared by this element.
*
@@ -179,14 +264,14 @@
*
* @return an iterator over the namespace prefixes in this SOAPElement object
*/
- public abstract Iterator getNamespacePrefixes();
+ Iterator getNamespacePrefixes();
/** Returns the URI of the namespace that has the given prefix.
*
* @param prefix a String giving the prefix of the namespace for which to search
* @return a String with the uri of the namespace that has the given prefix
*/
- public abstract String getNamespaceURI(String prefix);
+ String getNamespaceURI(String prefix);
/** Returns an Iterator over the namespace prefix Strings visible to this element.
*
@@ -194,35 +279,43 @@
*
* @return an iterator over the namespace prefixes are within scope of this SOAPElement object
*/
- public abstract Iterator getVisibleNamespacePrefixes();
+ Iterator getVisibleNamespacePrefixes();
/** Removes the attribute with the specified name.
*
* @param name the Name object with the name of the attribute to be removed
* @return true if the attribute was removed successfully; false if it was not
*/
- public abstract boolean removeAttribute(Name name);
+ boolean removeAttribute(Name name);
+ /**
+ * Removes the attribute with the specified qname.
+ * @param qname the QName object with the qname of the attribute to be removed
+ * @return true if the attribute was removed successfully; false if it was not
+ * @since SAAJ 1.3
+ */
+ boolean removeAttribute(QName qname);
+
/** Detaches all children of this SOAPElement.
*
* This method is useful for rolling back the construction of partially completed SOAPHeaders and SOAPBodys in
* preparation for sending a fault when an error condition is detected.
* It is also useful for recycling portions of a document within a SOAP message.
*/
- public abstract void removeContents();
+ void removeContents();
/** Removes the namespace declaration corresponding to the given prefix.
*
* @param prefix a String giving the prefix for which to search
* @return true if the namespace declaration was removed successfully; false if it was not
*/
- public abstract boolean removeNamespaceDeclaration(String prefix);
+ boolean removeNamespaceDeclaration(String prefix);
/** Sets the encoding style for this SOAPElement object to one specified.
*
* @param encodingStyle a String giving the encoding style
* @throws SOAPException if there was a problem in the encoding style being set.
*/
- public abstract void setEncodingStyle(String encodingStyle) throws SOAPException;
+ void setEncodingStyle(String encodingStyle) throws SOAPException;
}
Modified: trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -26,8 +26,10 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
-import org.jboss.logging.Logger;
+import javax.xml.namespace.QName;
+import org.jboss.util.NotImplementedException;
+
/** SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
*
* SOAPFactory can be used to create XML fragments that will eventually end up in the SOAP part.
@@ -41,13 +43,16 @@
*/
public abstract class SOAPFactory
{
- // provide logging
- private static Logger log = Logger.getLogger(SOAPFactory.class);
-
private static final String DEFAULT_SOAP_FACTORY = "org.jboss.ws.core.soap.SOAPFactoryImpl";
- private static final String[] alternativeFactories = new String[] { "org.jboss.axis.soap.SOAPFactoryImpl" };
- /** Creates a new instance of SOAPFactory.
+ /**
+ * Creates a new SOAPFactory object that is an instance of the default implementation (SOAP 1.1),
+ * This method uses the following ordered lookup procedure to determine the SOAPFactory implementation class to load:
+ *
+ * Use the javax.xml.soap.SOAPFactory system property.
+ * Use the properties file "lib/jaxm.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
+ * Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.soap.SOAPFactory in jars available to the runtime.
+ * Use the SAAJMetaFactory instance to locate the SOAPFactory implementation class.
*
* @return a new instance of a SOAPFactory
* @throws SOAPException if there was an error creating the default SOAPFactory
@@ -57,43 +62,36 @@
PrivilegedAction action = new PropertyAccessAction(SOAPFactory.class.getName(), DEFAULT_SOAP_FACTORY);
String factoryName = (String)AccessController.doPrivileged(action);
+ //TODO: SAAJ 1.3 (implement the lookup)
+
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
- try
- {
- Class factoryClass = loader.loadClass(factoryName);
- return (SOAPFactory)factoryClass.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- // Throw the exception if the user asked for a specific factory
- if (factoryName.equals(DEFAULT_SOAP_FACTORY) == false)
- throw e;
-
- for (int i = 0; i < alternativeFactories.length; i++)
- {
- factoryName = alternativeFactories[i];
- try
- {
- Class factoryClass = loader.loadClass(factoryName);
- return (SOAPFactory)factoryClass.newInstance();
- }
- catch (ClassNotFoundException e1)
- {
- log.debug("Cannot load factory: " + factoryName);
- }
- }
- }
+ Class factoryClass = loader.loadClass(factoryName);
+ return (SOAPFactory)factoryClass.newInstance();
}
catch (Throwable t)
{
throw new SOAPException("Failed to create SOAPFactory: " + factoryName, t);
}
+ }
- throw new SOAPException("Cannot find SOAPFactory implementation");
+
+ /**
+ * Creates a new SOAPFactory object that is an instance of the specified implementation, this method uses the SAAJMetaFactory
+ * to locate the implementation class and create the SOAPFactory instance.
+ *
+ * @param protocol a string constant representing the class of the specified message factory implementation.
+ * May be either DYNAMIC_SOAP_PROTOCOL, DEFAULT_SOAP_PROTOCOL (which is the same as) SOAP_1_1_PROTOCOL, or SOAP_1_2_PROTOCOL.
+ * @throws SOAPException if there was an error creating the specified SOAPFactory
+ * @since SAAJ 1.3
+ */
+ public static SOAPFactory newInstance(String protocol) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
}
-
+
/** Creates a new Detail object which serves as a container for DetailEntry objects.
*
* This factory method creates Detail objects for use in situations where it is not practical to use the SOAPFault abstraction.
@@ -103,6 +101,22 @@
*/
public abstract Detail createDetail() throws SOAPException;
+ /**
+ * Creates a SOAPElement object from an existing DOM Element. If the DOM Element that is passed in as an argument is already a
+ * SOAPElement then this method must return it unmodified without any further work. Otherwise, a new SOAPElement is created and
+ * a deep copy is made of the domElement argument. The concrete type of the return value will depend on the name of the domElement
+ * argument. If any part of the tree rooted in domElement violates SOAP rules, a SOAPException will be thrown.
+ * @param domElement the Element to be copied.
+ * @return a new SOAPElement that is a copy of domElement.
+ * @throws SOAPException if there is an error in creating the SOAPElement object
+ * @since SAAJ 1.3
+ */
+ public SOAPElement createElement(org.w3c.dom.Element domElement) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
/** Create a SOAPElement object initialized with the given local name.
*
* @param localName a String giving the local name for the new element
@@ -129,6 +143,40 @@
*/
public abstract SOAPElement createElement(Name name) throws SOAPException;
+ /**
+ * Creates a SOAPElement object initialized with the given QName object.
+ * The concrete type of the return value will depend on the name given to the new SOAPElement.
+ * For instance, a new SOAPElement with the name "{http://www.w3.org/2003/05/soap-envelope}Envelope" would
+ * cause a SOAPEnvelope that supports SOAP 1.2 behavior to be created.
+ * @param qname a QName object with the XML name for the new element
+ * @return the new SOAPElement object that was created
+ * @throws SOAPException if there is an error in creating the SOAPElement object
+ * @since SAAJ 1.3
+ */
+ public SOAPElement createElement(QName qname) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ /**
+ * Creates a new SOAPFault object initialized with the given reasonText and faultCode
+ * @param reasonText the ReasonText/FaultString for the fault
+ * @param faultCode the FaultCode for the fault
+ * @return a SOAPFault object
+ * @throws SOAPException if there is a SOAP error
+ * @since SAAJ 1.3
+ */
+ public abstract SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException;
+
+ /**
+ * Creates a new default SOAPFault object
+ * @return a SOAPFault object
+ * @throws SOAPException if there is a SOAP error
+ * @since SAAJ 1.3
+ */
+ public abstract SOAPFault createFault() throws SOAPException;
+
/** Creates a new Name object initialized with the given local name.
*
* This factory method creates Name objects for use in situations where it is not practical to use the
Modified: trunk/src/main/java/javax/xml/soap/SOAPFault.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFault.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPFault.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,23 +21,22 @@
*/
package javax.xml.soap;
+import java.util.Iterator;
import java.util.Locale;
+import javax.xml.namespace.QName;
+
/** An element in the SOAPBody object that contains error and/or status
* information. This information may relate to errors in the SOAPMessage
* object or to problems that are not related to the content in the message
* itself. Problems not related to the message itself are generally errors in
* processing, such as the inability to communicate with an upstream server.
*
- * The SOAPFault interface provides methods for retrieving the information
- * contained in a SOAPFault object and for setting the fault code, the fault
- * actor, and a string describing the fault. A fault code is one of the codes
- * defined in the SOAP 1.1 specification that describe the fault. An actor is
- * an intermediate recipient to whom a message was routed. The message path may
- * include one or more actors, or, if no actors are specified, the message goes
- * only to the default actor, which is the final intended recipient.
+ * Depending on the protocol specified while creating the MessageFactory instance, a
+ * SOAPFault has sub-elements as defined in the SOAP 1.1/SOAP 1.2 specification.
*
* @author Scott.Stark(a)jboss.org
+ * @author Thomas.Diesler(a)jboss.org
* @version $Revision$
*/
public interface SOAPFault extends SOAPBodyElement
@@ -50,28 +49,58 @@
* @return the new Detail object
* @throws SOAPException if this SOAPFault object already contains a valid Detail object
*/
- public Detail addDetail() throws SOAPException;
+ Detail addDetail() throws SOAPException;
/**
+ * Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived from locale.
+ * If a Reason Text item with this xml:lang already exists its text value will be replaced with text.
+ * The locale parameter should not be null
+ *
+ * Code sample:
+ *
+ * SOAPFault fault = ...;
+ * fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
+ *
+ * @param text reason message string
+ * @param locale Locale object representing the locale of the message
+ * @throws SOAPException if there was an error in adding the Reason text or the locale passed was null.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Reason.
+ * @since SAAJ 1.3
+ */
+ void addFaultReasonText(String text, Locale locale) throws SOAPException;
+
+ /**
+ * Adds a Subcode to the end of the sequence of Subcodes contained by this SOAPFault.
+ * Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of
+ * subelements rooted in the mandatory Code subelement of a SOAP Fault.
+ *
+ * @param subcode a QName containing the Value of the Subcode
+ * @throws SOAPException if there was an error in setting the Subcode
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Subcode.
+ * @since SAAJ 1.3
+ */
+ void appendFaultSubcode(javax.xml.namespace.QName subcode) throws SOAPException;
+
+ /**
* Returns the optional detail element for this SOAPFault object.
*
* A Detail object carries application-specific error information related to SOAPBodyElement objects.
*
* @return a Detail object with application-specific error information
*/
- public Detail getDetail();
+ Detail getDetail();
/**
* Gets the fault actor for this SOAPFault object.
* @return a String giving the actor in the message path that caused this SOAPFault object
*/
- public String getFaultActor();
+ String getFaultActor();
/**
* Gets the fault code for this SOAPFault object.
* @return a String with the fault code
*/
- public String getFaultCode();
+ String getFaultCode();
/**
* Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
@@ -84,21 +113,112 @@
*
* @return a Name representing the faultcode
*/
- public Name getFaultCodeAsName();
+ Name getFaultCodeAsName();
/**
+ * Gets the fault code for this SOAPFault object as a QName object.
+ * @return a QName representing the faultcode
+ * @since SAAJ 1.3
+ */
+ QName getFaultCodeAsQName();
+
+ /**
+ * Returns the optional Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.
+ * @return Content of the env:Fault/env:Node element as a String or null if none
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Node.
+ * @since SAAJ 1.3
+ */
+ String getFaultNode();
+
+ /**
+ * Returns an Iterator over a distinct sequence of Locales for which there are associated Reason Text items.
+ * Any of these Locales can be used in a call to getFaultReasonText in order to obtain a localized version of the Reason Text string.
+ * @return an Iterator over a sequence of Locale objects for which there are associated Reason Text items.
+ * @throws SOAPException if there was an error in retrieving the fault Reason locales.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Reason.
+ * @since SAAJ 1.3
+ */
+ Iterator getFaultReasonLocales() throws SOAPException;
+
+ /**
+ * Returns an Iterator over a sequence of String objects containing all of the Reason Text items for this SOAPFault.
+ * @return an Iterator over env:Fault/env:Reason/env:Text items.
+ * @throws SOAPException if there was an error in retrieving the fault Reason texts.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Reason.
+ * @since SAAJ 1.3
+ */
+ Iterator getFaultReasonTexts() throws SOAPException;
+
+ /**
+ * Returns the Reason Text associated with the given Locale. If more than one such Reason Text exists the first matching Text is returned
+ * @param locale the Locale for which a localized Reason Text is desired
+ * @return the Reason Text associated with locale
+ * @throws SOAPException if there was an error in retrieving the fault Reason text for the specified locale .
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Reason.
+ * @since SAAJ 1.3
+ */
+ String getFaultReasonText(Locale locale) throws SOAPException;
+
+ /**
+ * Creates or replaces any existing Node element value for this SOAPFault object. The Node element is optional in SOAP 1.2.
+ * @throws SOAPException f there was an error in setting the Node for this SOAPFault object.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Node.
+ * @since SAAJ 1.3
+ */
+ void setFaultNode(String uri) throws SOAPException;
+
+ /**
+ * Returns the optional Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.
+ * @return Content of the env:Fault/env:Role element as a String or null if none
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Role.
+ * @since SAAJ 1.3
+ */
+ String getFaultRole();
+
+ /**
+ * Creates or replaces any existing Role element value for this SOAPFault object. The Role element is optional in SOAP 1.2.
+ * @throws SOAPException f there was an error in setting the Role for this SOAPFault object.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Role.
+ * @since SAAJ 1.3
+ */
+ void setFaultRole(String uri) throws SOAPException;
+ /**
* Gets the fault string for this SOAPFault object.
* @return a String giving an explanation of the fault
*/
- public String getFaultString();
+ String getFaultString();
/**
* Gets the locale of the fault string for this SOAPFault object.
* @return a Locale object indicating the native language of the fault string or null if no locale was specified
*/
- public Locale getFaultStringLocale();
+ Locale getFaultStringLocale();
/**
+ * Gets the Subcodes for this SOAPFault as an iterator over QNames.
+ * @return an Iterator that accesses a sequence of QNames. This Iterator should not support the optional remove method.
+ * The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Subcode.
+ * @since SAAJ 1.3
+ */
+ Iterator getFaultSubcodes();
+
+ /**
+ * Removes any Subcodes that may be contained by this SOAPFault. Subsequent calls to getFaultSubcodes will return an empty
+ * iterator until a call to appendFaultSubcode is made.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Subcode.
+ * @since SAAJ 1.3
+ */
+ void removeAllFaultSubcodes();
+
+ /**
+ * Returns true if this SOAPFault has a Detail subelement and false otherwise. Equivalent to (getDetail()!=null).
+ * @return true if this SOAPFault has a Detail subelement and false otherwise.
+ * @since SAAJ 1.3
+ */
+ boolean hasDetail();
+
+ /**
* Sets this SOAPFault object with the given fault actor.
*
* The fault actor is the recipient in the message path who caused the fault to happen.
@@ -106,7 +226,7 @@
* @param faultActor a String identifying the actor that caused this SOAPFault object
* @throws SOAPException if there was an error in adding the faultActor to the underlying XML tree.
*/
- public void setFaultActor(String faultActor) throws SOAPException;
+ void setFaultActor(String faultActor) throws SOAPException;
/**
* Sets this SOAPFault object with the give fault code.
@@ -119,7 +239,7 @@
* It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.
* @throws SOAPException if there was an error in adding the faultCode to the underlying XML tree.
*/
- public void setFaultCode(String faultCode) throws SOAPException;
+ void setFaultCode(String faultCode) throws SOAPException;
/**
* Sets this SOAPFault object with the given fault code.
@@ -141,7 +261,7 @@
* @param faultCodeQName a Name object giving the fault code to be set. It must be namespace qualified.
* @throws SOAPException if there was an error in adding the faultcode element to the underlying XML tree.
*/
- public void setFaultCode(Name faultCodeQName) throws SOAPException;
+ void setFaultCode(Name faultCodeQName) throws SOAPException;
/**
* Sets the fault string for this SOAPFault object to the given string.
@@ -149,7 +269,7 @@
* @param faultString a String giving an explanation of the fault
* @throws SOAPException if there was an error in adding the faultString to the underlying XML tree.
*/
- public void setFaultString(String faultString) throws SOAPException;
+ void setFaultString(String faultString) throws SOAPException;
/**
* Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
@@ -158,5 +278,5 @@
* @param locale a Locale object indicating the native language of the faultString
* @throws SOAPException
*/
- public void setFaultString(String faultString, Locale locale) throws SOAPException;
+ void setFaultString(String faultString, Locale locale) throws SOAPException;
}
Modified: trunk/src/main/java/javax/xml/soap/SOAPHeader.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPHeader.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPHeader.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.xml.namespace.QName;
+
/**
* A representation of the SOAP header element. A SOAP header element consists
* of XML data that affects the way the application-specific content is
@@ -67,6 +69,60 @@
public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException;
/**
+ * Creates a new SOAPHeaderElement object initialized with the specified qname and adds it to this SOAPHeader object.
+ * @param qname a QName object with the qname of the new SOAPHeaderElement object
+ * @return the new SOAPHeaderElement object that was inserted into this SOAPHeader object
+ * @throws SOAPException if a SOAP error occurs
+ * @since SAAJ 1.3
+ */
+ public SOAPHeaderElement addHeaderElement(QName qname) throws SOAPException;
+
+ /**
+ * Creates a new NotUnderstood SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object.
+ * This operation is supported only by SOAP 1.2.
+ *
+ * @param qname a QName object with the name of the SOAPHeaderElement object that was not understood.
+ * @return the new SOAPHeaderElement object that was inserted into this SOAPHeader object
+ * @throws SOAPException if a SOAP error occurs.
+ * @throws UnsupportedOperationException if this is a SOAP 1.1 Header.
+ * @since SAAJ 1.3
+ */
+ public SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname) throws SOAPException;
+
+ /**
+ * Creates a new Upgrade SOAPHeaderElement object initialized with the specified List of supported SOAP URIs
+ * and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
+ *
+ * @param soapURIs an Iterator object with the URIs of SOAP versions supported.
+ * @return the new SOAPHeaderElement object that was inserted into this SOAPHeader object
+ * @throws SOAPException if a SOAP error occurs.
+ * @since SAAJ 1.3
+ */
+ public SOAPHeaderElement addUpgradeHeaderElement(Iterator soapURIs) throws SOAPException;
+
+ /**
+ * Creates a new Upgrade SOAPHeaderElement object initialized with the specified array of supported SOAP URIs
+ * and adds it to this SOAPHeader object. This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
+ *
+ * @param soapURIs an array of the URIs of SOAP versions supported.
+ * @return the new SOAPHeaderElement object that was inserted into this SOAPHeader object
+ * @throws SOAPException if a SOAP error occurs.
+ * @since SAAJ 1.3
+ */
+ public SOAPHeaderElement addUpgradeHeaderElement(String[] soapURIs) throws SOAPException;
+
+ /**
+ * Creates a new Upgrade SOAPHeaderElement object initialized with the specified supported SOAP URI and adds it to this SOAPHeader object.
+ * This operation is supported on both SOAP 1.1 and SOAP 1.2 header.
+ *
+ * @param soapURI the URI of SOAP the version that is supported.
+ * @return the new SOAPHeaderElement object that was inserted into this SOAPHeader object
+ * @throws SOAPException if a SOAP error occurs.
+ * @since SAAJ 1.3
+ */
+ public SOAPHeaderElement addUpgradeHeaderElement(String soapURI) throws SOAPException;
+
+ /**
* Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
*
* @return an Iterator object over all the SOAPHeaderElement objects contained by this SOAPHeader
Modified: trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -44,6 +44,36 @@
*/
public boolean getMustUnderstand();
+ /**
+ * Returns the boolean value of the relay attribute for this SOAPHeaderElement
+ * @return true if the relay attribute is turned on; false otherwise
+ * @throws UnsupportedOperationException - if this message does not support the SOAP 1.2 concept of Relay attribute.
+ * @since SAAJ 1.3
+ */
+ public boolean getRelay();
+
+ /**
+ * Sets the relay attribute for this SOAPHeaderElement to be either true or false.
+ *
+ * The SOAP relay attribute is set to true to indicate that the SOAP header block must be relayed by any node that is
+ * targeted by the header block but not actually process it. This attribute is ignored on header blocks whose mustUnderstand
+ * attribute is set to true or that are targeted at the ultimate reciever (which is the default).
+ * The default value of this attribute is false.
+ * @param relay the new value of the relay attribute
+ * @throws SOAPException if there is a problem in setting the relay attribute.
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Relay attribute.
+ * @since SAAJ 1.3
+ */
+ public void setRelay(boolean relay) throws SOAPException;
+
+ /**
+ * Returns the value of the Role attribute of this SOAPHeaderElement.
+ * @return a String giving the URI of the Role
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Role.
+ * @since SAAJ 1.3
+ */
+ public boolean getRole();
+
/** Sets the actor associated with this SOAPHeaderElement object to the specified actor.
* The default value of an actor is: SOAPConstants.URI_SOAP_ACTOR_NEXT
*
Modified: trunk/src/main/java/javax/xml/soap/SOAPMessage.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPMessage.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPMessage.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -237,6 +237,14 @@
public abstract void removeAllAttachments();
/**
+ * Removes all the AttachmentPart objects that have header entries that match the specified headers.
+ * Note that the removed attachment could have headers in addition to those specified.
+ * @param headers a MimeHeaders object containing the MIME headers for which to search
+ * @since SAAJ 1.3
+ */
+ public abstract void removeAttachments(MimeHeaders headers);
+
+ /**
* Gets a count of the number of attachments in this message. This count does not include the SOAP part.
* @return the number of AttachmentPart objects that are part of this SOAPMessage object
*/
@@ -249,6 +257,21 @@
public abstract Iterator getAttachments();
/**
+ * Returns an AttachmentPart object that is associated with an attachment that is referenced by this SOAPElement or null
+ * if no such attachment exists. References can be made via an href attribute as described in SOAP Messages with Attachments,
+ * or via a single Text child node containing a URI as described in the WS-I Attachments Profile 1.0 for elements of
+ * schema type ref:swaRef(ref:swaRef). These two mechanisms must be supported.
+ * The support for references via href attribute also implies that this method should also be supported on an element that
+ * is an xop:Include element ( XOP). other reference mechanisms may be supported by individual implementations of this standard.
+ * Contact your vendor for details.
+ * @param element The SOAPElement containing the reference to an Attachment
+ * @return the referenced AttachmentPart or null if no such AttachmentPart exists or no reference can be found in this SOAPElement.
+ * @throws SOAPException if there is an error in the attempt to access the attachment
+ * @since SAAJ 1.3
+ */
+ public abstract AttachmentPart getAttachment(SOAPElement element) throws SOAPException;
+
+ /**
* Retrieves all the AttachmentPart objects that have header entries that match the specified headers.
* Note that a returned attachment could have headers in addition to those specified.
* @param mimeheaders a MimeHeaders object containing the MIME headers for which to search
Modified: trunk/src/main/java/javax/xml/soap/SOAPPart.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPPart.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/javax/xml/soap/SOAPPart.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -55,7 +55,7 @@
* @author Scott.Stark(a)jboss.org
* @version $Revision$
*/
-public abstract class SOAPPart implements Document
+public abstract class SOAPPart implements Document, Node
{
public SOAPPart()
{
Modified: trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -24,6 +24,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPConstants;
import org.jboss.ws.core.soap.NameImpl;
@@ -54,7 +55,7 @@
/** SOAP-1.1 namespace http://schemas.xmlsoap.org/wsdl/soap/ */
static final String NS_SOAP11 = "http://schemas.xmlsoap.org/wsdl/soap/";
/** SOAP-1.1 envelope namespace http://schemas.xmlsoap.org/soap/envelope/ */
- static final String NS_SOAP11_ENV = "http://schemas.xmlsoap.org/soap/envelope/";
+ static final String NS_SOAP11_ENV = SOAPConstants.URI_NS_SOAP_ENVELOPE;
/** SOAP-1.2 namespace http://schemas.xmlsoap.org/wsdl/soap12/ */
static final String NS_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/";
/** SOAP-1.2 envelope namespace http://www.w3.org/2003/05/soap-envelope */
@@ -63,8 +64,6 @@
static final String NS_SWA_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
/** Default namespace for WSDL-1.1 http://schemas.xmlsoap.org/wsdl/ */
static final String NS_WSDL11 = "http://schemas.xmlsoap.org/wsdl/";
- /** Default namespace for WSDL-2.0 http://www.w3.org/TR/wsdl20 */
- static final String NS_WSDL20 = "http://www.w3.org/2003/11/wsdl";
/** The namespace for the MTOM content type attribute. */
static final String NS_XML_MIME = "http://www.w3.org/2005/05/xmlmime";
/** The namespace for XOP. */
@@ -76,9 +75,9 @@
static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
/** SOAP-1.1 encoding URI */
- static final String URI_SOAP11_ENC = "http://schemas.xmlsoap.org/soap/encoding/";
+ static final String URI_SOAP11_ENC = SOAPConstants.URI_NS_SOAP_ENCODING;
/** SOAP-1.2 encoding URI */
- static final String URI_SOAP12_ENC = "http://www.w3.org/2003/05/soap-encoding";
+ static final String URI_SOAP12_ENC = SOAPConstants.URI_NS_SOAP_1_2_ENCODING;
/** Literal encoding URI */
static final String URI_LITERAL_ENC = "";
/** WSDL 2.0 Encoding Rules */
@@ -124,11 +123,6 @@
static final Name SOAP11_BODY = new NameImpl("Body", PREFIX_ENV, NS_SOAP11_ENV);
static final Name SOAP11_FAULT = new NameImpl("Fault", PREFIX_ENV, NS_SOAP11_ENV);
- /** SOAP-1.2 roles */
- static final String URI_SOAP12_ROLE_NONE = "http://www.w3.org/2003/05/soap-envelope/role/none";
- static final String URI_SOAP12_ROLE_NEXT = "http://www.w3.org/2003/05/soap-envelope/role/next";
- static final String URI_SOAP12_ROLE_ULTIMATE_RECEIVER = "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver";
-
/** The default RPC return parameter name */
static final String DEFAULT_RPC_RETURN_NAME = "result"; // FIXME: According to JSR-181 this should be 'return'
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -27,13 +27,13 @@
import java.util.List;
import java.util.Set;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
import org.jboss.ws.core.CommonSOAP12Binding;
import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.soap.SOAPFaultImpl;
@@ -71,8 +71,8 @@
// 10.3 Conformance (Default role visibility): An implementation MUST include the required next and ultimate
// receiver roles in the Set returned from SOAPBinding.getRoles.
Set<String> soap12Roles = new HashSet<String>(delegate.getRoles());
- soap12Roles.add(Constants.URI_SOAP12_ROLE_NEXT);
- soap12Roles.add(Constants.URI_SOAP12_ROLE_ULTIMATE_RECEIVER);
+ soap12Roles.add(SOAPConstants.URI_SOAP_1_2_ROLE_NEXT);
+ soap12Roles.add(SOAPConstants.URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER);
return soap12Roles;
}
@@ -82,7 +82,7 @@
// attempts to configure the binding to play the none role via SOAPBinding.setRoles.
for (String role : roles)
{
- if (role.equals(Constants.URI_SOAP12_ROLE_NONE))
+ if (role.equals(SOAPConstants.URI_SOAP_1_2_ROLE_NONE))
throw new WebServiceException("Attempt to configure the binding to play the none role");
}
delegate.setRoles(roles);
Modified: trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core.soap;
+import javax.xml.namespace.QName;
import javax.xml.soap.DetailEntry;
import javax.xml.soap.Name;
@@ -38,6 +39,11 @@
super(name);
}
+ public DetailEntryImpl(QName qname)
+ {
+ super(qname);
+ }
+
public DetailEntryImpl(SOAPElementImpl soapElement)
{
super(soapElement);
Modified: trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DetailImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,6 +23,7 @@
import java.util.Iterator;
+import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
import javax.xml.soap.Name;
@@ -53,6 +54,13 @@
return detailEntry;
}
+ public DetailEntry addDetailEntry(QName qname) throws SOAPException
+ {
+ DetailEntryImpl detailEntry = new DetailEntryImpl(qname);
+ addChildElement(detailEntry);
+ return detailEntry;
+ }
+
public Iterator getDetailEntries()
{
return getChildElements();
Modified: trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -104,30 +104,6 @@
}
}
- /** Get the QName of this Node */
- protected QName getQName()
- {
- String nsURI = getNamespaceURI();
- String localPart = getLocalName();
- String prefix = getPrefix();
-
- QName qname;
- if (nsURI != null && prefix != null)
- {
- qname = new QName(nsURI, localPart, prefix);
- }
- else if (nsURI != null)
- {
- qname = new QName(nsURI, localPart);
- }
- else
- {
- qname = new QName(localPart);
- }
-
- return qname;
- }
-
// javax.xml.soap.Node *********************************************************************************************
/**
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyElementDoc.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.core.soap;
+import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
@@ -39,8 +40,14 @@
super(name);
}
+ public SOAPBodyElementDoc(QName qname)
+ {
+ super(qname);
+ }
+
public SOAPBodyElementDoc(SOAPElementImpl element)
{
super(element);
}
+
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -32,6 +32,7 @@
import java.util.Iterator;
import java.util.Locale;
+import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
@@ -46,6 +47,7 @@
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
@@ -127,6 +129,14 @@
return (SOAPBodyElement)addChildElement(child);
}
+ public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
+ {
+ log.trace("addBodyElement: " + qname);
+ expandToDOM();
+ SOAPBodyElement child = new SOAPBodyElementDoc(qname);
+ return (SOAPBodyElement)addChildElement(child);
+ }
+
public SOAPBodyElement addDocument(Document doc) throws SOAPException
{
log.trace("addDocument");
@@ -161,6 +171,20 @@
return soapFault;
}
+ public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
+ {
+ log.trace("addFault");
+ expandToDOM();
+ if (hasFault())
+ throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
+
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ soapFault = (SOAPFaultImpl)addChildElement(soapFault);
+ soapFault.setFaultCode(faultCode);
+ soapFault.setFaultString(faultString);
+ return soapFault;
+ }
+
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
{
log.trace("addFault");
@@ -175,6 +199,20 @@
return soapFault;
}
+ public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
+ {
+ log.trace("addFault");
+ expandToDOM();
+ if (hasFault())
+ throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
+
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ soapFault.setFaultCode(faultCode);
+ soapFault.setFaultString(faultString, locale);
+ addChildElement(soapFault);
+ return soapFault;
+ }
+
public SOAPFault getFault()
{
log.trace("getFault");
@@ -403,4 +441,10 @@
super.writeElementContent(writer);
}
}
+
+ public Document extractContentAsDocument() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -110,6 +110,12 @@
isDOMValid = true;
}
+ public SOAPContentElement(QName qname)
+ {
+ super(qname);
+ isDOMValid = true;
+ }
+
public SOAPContentElement(SOAPElementImpl element)
{
super(element);
@@ -174,7 +180,7 @@
TypeMappingImpl typeMapping = serContext.getTypeMapping();
- QName xmlName = getQName();
+ QName xmlName = getElementQName();
try
{
SerializerSupport ser;
@@ -254,7 +260,7 @@
String strContent = getXMLFragment();
- Object obj = des.deserialize(getQName(), xmlType, strContent, serContext);
+ Object obj = des.deserialize(getElementQName(), xmlType, strContent, serContext);
if (obj != null)
{
Class objType = obj.getClass();
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPElementImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -94,6 +94,12 @@
this(name.getLocalName(), name.getPrefix(), name.getURI());
}
+ /** Called by SOAPFactory */
+ public SOAPElementImpl(QName qname)
+ {
+ this(qname.getLocalPart(), qname.getPrefix(), qname.getNamespaceURI());
+ }
+
/** Copy constructor for converting SOAPElement types
*/
protected SOAPElementImpl(SOAPElementImpl element)
@@ -115,6 +121,35 @@
// javax.xml.soap.SOAPElement *************************************************************************************
+ public QName getElementQName()
+ {
+ String nsURI = getNamespaceURI();
+ String localPart = getLocalName();
+ String prefix = getPrefix();
+
+ QName qname;
+ if (nsURI != null && prefix != null)
+ {
+ qname = new QName(nsURI, localPart, prefix);
+ }
+ else if (nsURI != null)
+ {
+ qname = new QName(nsURI, localPart);
+ }
+ else
+ {
+ qname = new QName(localPart);
+ }
+
+ return qname;
+ }
+
+ public SOAPElement setElementQName(QName qname) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
/**
* Adds an attribute with the specified name and value to this SOAPElement object.
*
@@ -137,6 +172,11 @@
return this;
}
+ public SOAPElement addAttribute(QName qname, String value) throws SOAPException
+ {
+ return addAttribute(new NameImpl(qname), value);
+ }
+
/**
* Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object.
*
@@ -200,6 +240,11 @@
return soapElement;
}
+ public SOAPElement addChildElement(QName qname) throws SOAPException
+ {
+ return addChildElement(new NameImpl(qname));
+ }
+
/**
* Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a
* SOAPElementFactory.
@@ -316,6 +361,33 @@
return list.iterator();
}
+ public Iterator getAllAttributesAsQNames()
+ {
+ ArrayList list = new ArrayList();
+ NamedNodeMap nnm = getAttributes();
+ for (int i = 0; i < nnm.getLength(); i++)
+ {
+ org.w3c.dom.Node node = (org.w3c.dom.Node)nnm.item(i);
+ String local = node.getLocalName();
+ String prefix = node.getPrefix();
+ String uri = node.getNamespaceURI();
+ if ("xmlns".equals(prefix) == false)
+ {
+ QName qname;
+ if (uri != null && uri.length() > 0)
+ {
+ qname = new QName(uri, local, prefix);
+ }
+ else
+ {
+ qname = new QName(local);
+ }
+ list.add(qname);
+ }
+ }
+ return list.iterator();
+ }
+
/**
* Returns the value of the attribute with the specified name.
*
@@ -328,6 +400,11 @@
return (attr != null ? attr.getValue() : null);
}
+ public String getAttributeValue(QName qname)
+ {
+ return getAttributeValue(new NameImpl(qname));
+ }
+
private Attr getAttributeNode(Name name)
{
Attr attr = null;
@@ -340,6 +417,25 @@
}
/**
+ * Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.
+ * The remaining elements of the new QName are taken directly from the parameters, localName and prefix.
+ * @param localName a String containing the local part of the name.
+ * @param prefix a String containing the prefix for the name.
+ * @return a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement.
+ * This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as it's parameter.
+ * @throws SOAPException if the QName cannot be created.
+ * @since SAAJ 1.3
+ */
+ public QName createQName(String localName, String prefix) throws SOAPException
+ {
+ String nsURI = getNamespaceURI(prefix);
+ if (nsURI == null)
+ throw new SOAPException("CAnnot obtain namespace URI for prefix: " + prefix);
+
+ return new QName(nsURI, localName, prefix);
+ }
+
+ /**
* Returns an Iterator over all the immediate child Nodes of this element.
* <p/>
* This includes javax.xml.soap.Text objects as well as SOAPElement objects.
@@ -402,6 +498,11 @@
return list.iterator();
}
+ public Iterator getChildElements(QName qname)
+ {
+ return getChildElements(new NameImpl(qname));
+ }
+
/**
* Returns the name of this SOAPElement object.
*
@@ -515,6 +616,11 @@
return false;
}
+ public boolean removeAttribute(QName qname)
+ {
+ return removeAttribute(new NameImpl(qname));
+ }
+
/**
* Detaches all children of this SOAPElement.
* <p/>
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -23,12 +23,15 @@
// $Id$
+import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.jaxrpc.binding.SOAPElementDeserializer;
import org.w3c.dom.Element;
@@ -78,4 +81,18 @@
{
return new NameImpl(localName);
}
+
+ @Override
+ public SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public SOAPFault createFault() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -33,6 +33,7 @@
import javax.xml.soap.SOAPFault;
import org.jboss.logging.Logger;
+import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.DOMUtils;
@@ -218,6 +219,11 @@
faultcode.setValue(faultCode);
}
+ public void setFaultCode(QName faultCode) throws SOAPException
+ {
+ setFaultCode(new NameImpl(faultCode));
+ }
+
/** Sets the fault string for this SOAPFault object to the given string.
*/
public void setFaultString(String faultString) throws SOAPException
@@ -237,4 +243,82 @@
{
new DOMWriter(writer).print(this);
}
+
+ public void addFaultReasonText(String text, Locale locale) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void appendFaultSubcode(QName subcode) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public QName getFaultCodeAsQName()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public String getFaultNode()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public Iterator getFaultReasonLocales() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public String getFaultReasonText(Locale locale) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public Iterator getFaultReasonTexts() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public String getFaultRole()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public Iterator getFaultSubcodes()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public boolean hasDetail()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void removeAllFaultSubcodes()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void setFaultNode(String uri) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void setFaultRole(String uri) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -35,6 +35,7 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;
+import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
/**
@@ -139,4 +140,22 @@
writer.write(xmlFragment);
}
+
+ public boolean getRelay()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public boolean getRole()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void setRelay(boolean relay) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -24,12 +24,14 @@
import java.util.ArrayList;
import java.util.Iterator;
+import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;
+import org.jboss.util.NotImplementedException;
import org.w3c.dom.DOMException;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
@@ -83,6 +85,11 @@
return headerElement;
}
+ public SOAPHeaderElement addHeaderElement(QName qname) throws SOAPException
+ {
+ return addHeaderElement(new NameImpl(qname));
+ }
+
/** Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object.
*/
public Iterator examineAllHeaderElements()
@@ -194,4 +201,28 @@
return super.replaceChild(newChild, oldChild);
}
+
+ public SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public SOAPHeaderElement addUpgradeHeaderElement(Iterator soapURIs) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public SOAPHeaderElement addUpgradeHeaderElement(String[] soapURIs) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public SOAPHeaderElement addUpgradeHeaderElement(String soapURI) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -34,12 +34,14 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
+import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
import org.jboss.ws.core.soap.attachment.CIDGenerator;
@@ -411,4 +413,18 @@
iterator.remove();
}
}
+
+ @Override
+ public AttachmentPart getAttachment(SOAPElement element) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void removeAttachments(MimeHeaders headers)
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -30,6 +30,7 @@
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
@@ -544,4 +545,40 @@
{
throw new NotImplementedException("setUserData");
}
+
+ public void detachNode()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public SOAPElement getParentElement()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public String getValue()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void recycleNode()
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void setParentElement(SOAPElement parent) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ public void setValue(String value)
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/core/soap/attachment/AttachmentPartImpl.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -31,6 +31,8 @@
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
+import org.jboss.util.NotImplementedException;
+
/**
* Implementation of the <code>AttachmentPart</code> interface.
* @see javax.xml.soap.AttachmentPart
@@ -261,4 +263,46 @@
setMimeHeader(MimeConstants.CONTENT_TYPE, contentType);
cachedContentType = contentType;
}
+
+ @Override
+ public InputStream getBase64Content() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public InputStream getRawContent() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public byte[] getRawContentBytes() throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void setBase64Content(InputStream content, String contentType) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void setRawContent(InputStream content, String contentType) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
+
+ @Override
+ public void setRawContentBytes(byte[] content, int offset, int len, String contentType) throws SOAPException
+ {
+ //TODO: SAAJ 1.3
+ throw new NotImplementedException();
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -180,7 +180,7 @@
public void setWsdlNamespace(String namespaceURI)
{
- if (Constants.NS_WSDL11.equals(namespaceURI) == false && Constants.NS_WSDL20.equals(namespaceURI) == false)
+ if (Constants.NS_WSDL11.equals(namespaceURI) == false)
throw new IllegalArgumentException("Invalid default namespace: " + namespaceURI);
this.wsdlNamespace = namespaceURI;
Modified: trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToWSDL.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -105,7 +105,7 @@
*/
public JavaToWSDL(String namespace)
{
- if (Constants.NS_WSDL11.equals(namespace) == false && Constants.NS_WSDL20.equals(namespace) == false)
+ if (Constants.NS_WSDL11.equals(namespace) == false)
throw new IllegalArgumentException("Unsupported wsdl version: " + namespace);
this.wsdlNamespace = namespace;
@@ -323,18 +323,6 @@
typeMapping = javaWSDL11.getTypeMapping();
javaWsdlMapping = javaWSDL11.getJavaWsdlMapping();
}
- if (Constants.NS_WSDL20.equals(wsdlNamespace))
- {
- JavaToWSDL20 javaWSDL20 = new JavaToWSDL20();
- javaWSDL20.addFeatures(features);
- javaWSDL20.setPortTypeName(portTypeName);
- javaWSDL20.setServiceName(serviceName);
- javaWSDL20.setTargetNamespace(targetNamespace);
-
- if( packageNamespaceMap != null)
- javaWSDL20.setPackageNamespaceMap(packageNamespaceMap);
- wsdlDefinitions = javaWSDL20.generate(endpoint);
- }
if (wsdlDefinitions == null)
throw new WSException("Cannot generate WSDL definitions");
Modified: trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2006-12-13 01:30:26 UTC (rev 1636)
+++ trunk/src/test/java/org/jboss/test/ws/tools/validation/WSDLValidator.java 2006-12-13 13:13:27 UTC (rev 1637)
@@ -129,11 +129,6 @@
String targetNS = wsdl.getTargetNamespace();
if (types == null)
errorList.add("types cannot be null");
- if (Constants.NS_WSDL20.equals(wsdl.getWsdlNamespace()))
- {
- if (WSDLUtils.getSchemaModel(types) == null)
- errorList.add("schema model is null");
- }
}
private void validateInterfaces()
19 years, 4 months
JBossWS SVN: r1636 - branches/jbossws-1.0
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-12-12 20:30:26 -0500 (Tue, 12 Dec 2006)
New Revision: 1636
Removed:
branches/jbossws-1.0/test
Log:
test, ignore
Deleted: branches/jbossws-1.0/test
===================================================================
19 years, 4 months
JBossWS SVN: r1635 - branches/jbossws-1.0
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-12-12 20:30:14 -0500 (Tue, 12 Dec 2006)
New Revision: 1635
Added:
branches/jbossws-1.0/test
Log:
test, ignore
Added: branches/jbossws-1.0/test
===================================================================
19 years, 4 months
JBossWS SVN: r1632 - in trunk/src/main/java/org/jboss/ws: core/server metadata/builder/jaxrpc metadata/jaxrpcmapping metadata/umdm
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-12 08:17:22 -0500 (Tue, 12 Dec 2006)
New Revision: 1632
Modified:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
Log:
Use resource url for jaxrpc-mapping
Modified: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 12:53:06 UTC (rev 1631)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 13:17:22 UTC (rev 1632)
@@ -73,36 +73,33 @@
return name;
}
- public URL getMetaDataFile(String resource) throws IOException
+ public URL getMetaDataFile(String resourcePath) throws IOException
{
- URL targetURL = null;
- if (resource != null && resource.length() > 0)
+ URL resourceURL = null;
+ if (resourcePath != null && resourcePath.length() > 0)
{
- if (resource.startsWith("/"))
- resource = resource.substring(1);
+ if (resourcePath.startsWith("/"))
+ resourcePath = resourcePath.substring(1);
try
{
// assign an absolute URL
- targetURL = new URL(resource);
+ resourceURL = new URL(resourcePath);
}
catch (MalformedURLException ex)
{
- // assign a relative URL
- String depPath = url.toExternalForm();
- if (depPath.startsWith("jar:"))
- {
- if(depPath.endsWith("!/") == false)
- depPath += "!/";
- }
+ String deploymentPath = url.toExternalForm();
+ if (deploymentPath.startsWith("jar:") && deploymentPath.endsWith("!/") == false)
+ deploymentPath += "!/";
- if(depPath.endsWith("/") == false)
- depPath += "/";
+ if(deploymentPath.endsWith("/") == false)
+ deploymentPath += "/";
- targetURL = new URL(depPath + resource);
+ // assign a relative URL
+ resourceURL = new URL(deploymentPath + resourcePath);
}
}
- return targetURL;
+ return resourceURL;
}
public String toString()
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12 12:53:06 UTC (rev 1631)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12 13:17:22 UTC (rev 1632)
@@ -116,7 +116,7 @@
{
mappingURL = new URL(Constants.NS_JBOSSWS_URI + "/dummy-mapping-url");
wsMetaData.addMappingDefinition(mappingURL.toExternalForm(), javaWsdlMapping);
- serviceMetaData.setJaxrpcMappingFile(mappingURL.toExternalForm());
+ serviceMetaData.setMappingLocation(mappingURL);
}
if (securityConfig != null)
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12 12:53:06 UTC (rev 1631)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12 13:17:22 UTC (rev 1632)
@@ -90,7 +90,8 @@
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
// Unmarshall the jaxrpc-mapping.xml
- serviceMetaData.setJaxrpcMappingFile(wsdMetaData.getJaxrpcMappingFile());
+ String mappingFile = wsdMetaData.getJaxrpcMappingFile();
+ serviceMetaData.setMappingLocation(udi.getMetaDataFile(mappingFile));
JavaWsdlMapping javaWsdlMapping = serviceMetaData.getJavaWsdlMapping();
if (javaWsdlMapping == null)
throw new WSException("jaxrpc-mapping-file not configured from webservices.xml");
Modified: trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-12 12:53:06 UTC (rev 1631)
+++ trunk/src/main/java/org/jboss/ws/metadata/jaxrpcmapping/JavaWsdlMappingFactory.java 2006-12-12 13:17:22 UTC (rev 1632)
@@ -30,6 +30,7 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
@@ -64,16 +65,16 @@
/**
* Factory method for JavaWsdlMapping
*/
- public JavaWsdlMapping parse(URL jaxrpcMappingFile) throws IOException
+ public JavaWsdlMapping parse(URL mappingLocation) throws IOException
{
- if (jaxrpcMappingFile == null)
+ if (mappingLocation == null)
{
throw new IllegalArgumentException("URL cannot be null");
}
// setup the XML binding Unmarshaller
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = jaxrpcMappingFile.openStream();
+ InputStream is = new ResourceURL(mappingLocation).openStream();
try
{
JavaWsdlMapping javaWsdlMapping = (JavaWsdlMapping)unmarshaller.unmarshal(is, this, null);
@@ -81,7 +82,7 @@
}
catch (JBossXBException e)
{
- IOException ioex = new IOException("Cannot parse: " + jaxrpcMappingFile);
+ IOException ioex = new IOException("Cannot parse: " + mappingLocation);
Throwable cause = e.getCause();
if (cause != null)
ioex.initCause(cause);
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12 12:53:06 UTC (rev 1631)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12 13:17:22 UTC (rev 1632)
@@ -24,7 +24,6 @@
// $Id$
import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -72,7 +71,7 @@
private QName serviceName;
private String wsdName;
private URL wsdlLocation;
- private String jaxrpcMappingFile;
+ private URL mappingLocation;
private String wsdlPublishLocation;
// The type mapping that is maintained by this service
@@ -196,48 +195,35 @@
endpoints.put(portName, epMetaData);
}
- public String getJaxrpcMappingFile()
+ public URL getMappingLocation()
{
- return jaxrpcMappingFile;
+ return mappingLocation;
}
- public void setJaxrpcMappingFile(String jaxrpcMappingFile)
+ public void setMappingLocation(URL mappingLocation)
{
- this.jaxrpcMappingFile = jaxrpcMappingFile;
+ this.mappingLocation = mappingLocation;
}
public JavaWsdlMapping getJavaWsdlMapping()
{
- JavaWsdlMapping javaWsdlMapping = (JavaWsdlMapping)wsMetaData.getMappingDefinition(jaxrpcMappingFile);
- if (javaWsdlMapping == null && jaxrpcMappingFile != null)
+ JavaWsdlMapping javaWsdlMapping = null;
+ if (mappingLocation != null)
{
- URL mappingLocation = null;
- try
+ javaWsdlMapping = (JavaWsdlMapping)wsMetaData.getMappingDefinition(mappingLocation.toExternalForm());
+ if (javaWsdlMapping == null)
{
- mappingLocation = new URL(jaxrpcMappingFile);
+ try
+ {
+ JavaWsdlMappingFactory mappingFactory = JavaWsdlMappingFactory.newInstance();
+ javaWsdlMapping = mappingFactory.parse(mappingLocation);
+ wsMetaData.addMappingDefinition(mappingLocation.toExternalForm(), javaWsdlMapping);
+ }
+ catch (IOException e)
+ {
+ throw new WSException("Cannot parse jaxrpc-mapping.xml", e);
+ }
}
- catch (MalformedURLException e)
- {
- // ignore
- }
- if (mappingLocation == null)
- {
- mappingLocation = wsMetaData.getClassLoader().getResource(jaxrpcMappingFile);
- }
-
- if (mappingLocation == null)
- throw new IllegalArgumentException("Cannot find jaxrpc-mapping.xml in deployment: " + jaxrpcMappingFile);
-
- try
- {
- JavaWsdlMappingFactory mappingFactory = JavaWsdlMappingFactory.newInstance();
- javaWsdlMapping = mappingFactory.parse(mappingLocation);
- wsMetaData.addMappingDefinition(jaxrpcMappingFile, javaWsdlMapping);
- }
- catch (IOException e)
- {
- throw new WSException("Cannot parse jaxrpc-mapping.xml", e);
- }
}
return javaWsdlMapping;
}
@@ -381,7 +367,7 @@
buffer.append("\n qname=" + serviceName);
buffer.append("\n wsdName=" + wsdName);
buffer.append("\n wsdlFile=" + wsdlLocation);
- buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile);
+ buffer.append("\n jaxrpcFile=" + mappingLocation);
buffer.append("\n publishLocation=" + wsdlPublishLocation);
buffer.append("\n properties=" + properties);
buffer.append("\n" + types);
19 years, 4 months
JBossWS SVN: r1631 - trunk/src/main/etc
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-12 07:53:06 -0500 (Tue, 12 Dec 2006)
New Revision: 1631
Modified:
trunk/src/main/etc/jbossws-component-info.xml
Log:
add jbossws.deployer
Modified: trunk/src/main/etc/jbossws-component-info.xml
===================================================================
--- trunk/src/main/etc/jbossws-component-info.xml 2006-12-12 12:23:36 UTC (rev 1630)
+++ trunk/src/main/etc/jbossws-component-info.xml 2006-12-12 12:53:06 UTC (rev 1631)
@@ -6,6 +6,7 @@
description="JBossWS an implementation of J2EE Web Services">
<artifact id="jbossws.sar"/>
+ <artifact id="jbossws.deployer"/>
<artifact id="jbossws-client.jar"/>
<artifact id="jboss-jaxrpc.jar"/>
<artifact id="jboss-jaxws.jar"/>
19 years, 4 months
JBossWS SVN: r1630 - in trunk/src: ant main/java/org/jboss/ws/core/jaxrpc main/java/org/jboss/ws/core/server main/java/org/jboss/ws/core/utils main/java/org/jboss/ws/metadata/builder/jaxrpc main/java/org/jboss/ws/metadata/builder/jaxws main/java/org/jboss/ws/metadata/umdm main/java/org/jboss/ws/tools/wsdl test/ant test/java/org/jboss/test/ws/jaxws/eardeployment
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-12 07:23:36 -0500 (Tue, 12 Dec 2006)
New Revision: 1630
Added:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
Removed:
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
Modified:
trunk/src/ant/build-release.xml
trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
trunk/src/test/ant/build-jars-jaxws.xml
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java
Log:
[JBCTS-422] Nested war deployments using wsdlLocation fail
Modified: trunk/src/ant/build-release.xml
===================================================================
--- trunk/src/ant/build-release.xml 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/ant/build-release.xml 2006-12-12 12:23:36 UTC (rev 1630)
@@ -43,6 +43,7 @@
<copy todir="${jbossws.dir}/lib" overwrite="true">
<fileset dir="${build.lib.dir}">
<include name="jbossws.sar"/>
+ <include name="jbossws.deployer"/>
<include name="jbossws-client.jar"/>
<include name="jbossws-jboss-integration.jar"/>
<include name="jbossws-tomcat-integration.jar"/>
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/CallImpl.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -611,7 +611,7 @@
private void generateOrUpdateSchemas(OperationMetaData opMetaData)
{
ServiceMetaData serviceMetaData = opMetaData.getEndpointMetaData().getServiceMetaData();
- if (serviceMetaData.getWsdlFile() == null)
+ if (serviceMetaData.getWsdlLocation() == null)
{
TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData();
for (ParameterMetaData paramMetaData : opMetaData.getParameters())
Deleted: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -1,84 +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.ws.core.server;
-
-// $Id$
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The container independent deployment info.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class UnifiedDeploymentInfo
-{
- public enum DeploymentType
- {
- JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB21, JAXWS_EJB3
- };
-
- public UnifiedDeploymentInfo(DeploymentType type)
- {
- this.type = type;
- }
-
- /** The type of this deployment */
- public DeploymentType type;
- /** Sub deployments have a parent */
- public UnifiedDeploymentInfo parent;
- /** The suffix of the deployment url */
- public String shortName;
- /** The URL identifing this deployment **/
- public URL url;
- /** The URL to the expanded webapp **/
- public URL expandedWebApp;
- /** We can hold "typed" metadata */
- public Object metaData;
- /** The deployment classloader **/
- public ClassLoader classLoader;
- /** An arbitrary map of state associated with the deployment */
- public Map<String, Object> context = new HashMap<String, Object>();
-
- /** The sortName concatenated with the canonical names of all parents. */
- public String getCanonicalName()
- {
- String name = shortName;
- if (parent != null)
- name = parent.getCanonicalName() + "/" + name;
- return name;
- }
-
- public String toString()
- {
- StringBuilder builder = new StringBuilder();
- builder.append("[");
- builder.append("type=" + type);
- builder.append(",shortName=" + shortName);
- builder.append(",url=" + url);
- builder.append("]");
- return builder.toString();
- }
-}
Added: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -0,0 +1,118 @@
+/*
+ * 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.core.server;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The container independent deployment info.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-May-2006
+ */
+public class UnifiedDeploymentInfo
+{
+ public enum DeploymentType
+ {
+ JAXRPC_Client, JAXRPC_JSE, JAXRPC_EJB21, JAXRPC_EJB3, JAXWS_JSE, JAXWS_EJB21, JAXWS_EJB3
+ };
+
+ public UnifiedDeploymentInfo(DeploymentType type)
+ {
+ this.type = type;
+ }
+
+ /** The type of this deployment */
+ public DeploymentType type;
+ /** Sub deployments have a parent */
+ public UnifiedDeploymentInfo parent;
+ /** The suffix of the deployment url */
+ public String shortName;
+ /** The URL identifing this deployment **/
+ public URL url;
+ /** The URL to the expanded webapp **/
+ public URL expandedWebApp;
+ /** We can hold "typed" metadata */
+ public Object metaData;
+ /** The deployment classloader **/
+ public ClassLoader classLoader;
+ /** An arbitrary map of state associated with the deployment */
+ public Map<String, Object> context = new HashMap<String, Object>();
+
+ /** The sortName concatenated with the canonical names of all parents. */
+ public String getCanonicalName()
+ {
+ String name = shortName;
+ if (parent != null)
+ name = parent.getCanonicalName() + "/" + name;
+ return name;
+ }
+
+ public URL getMetaDataFile(String resource) throws IOException
+ {
+ URL targetURL = null;
+ if (resource != null && resource.length() > 0)
+ {
+ if (resource.startsWith("/"))
+ resource = resource.substring(1);
+
+ try
+ {
+ // assign an absolute URL
+ targetURL = new URL(resource);
+ }
+ catch (MalformedURLException ex)
+ {
+ // assign a relative URL
+ String depPath = url.toExternalForm();
+ if (depPath.startsWith("jar:"))
+ {
+ if(depPath.endsWith("!/") == false)
+ depPath += "!/";
+ }
+
+ if(depPath.endsWith("/") == false)
+ depPath += "/";
+
+ targetURL = new URL(depPath + resource);
+ }
+ }
+ return targetURL;
+ }
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("[");
+ builder.append("type=" + type);
+ builder.append(",shortName=" + shortName);
+ builder.append(",url=" + url);
+ builder.append("]");
+ return builder.toString();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -87,10 +87,10 @@
// For each service
for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
{
- String wsdlFile = serviceMetaData.getWsdlFile();
- log.debug("Publish WSDL file: " + wsdlFile);
+ String wsdlPath = serviceMetaData.getWsdlLocation().toExternalForm();
+ log.debug("Publish WSDL file: " + wsdlPath);
- if (wsdlFile != null)
+ if (wsdlPath != null)
{
File targetFile = getPublishLocation(deploymentName, serviceMetaData);
targetFile.getParentFile().mkdirs();
@@ -108,13 +108,13 @@
// delete wsdl temp file
ServerConfigFactory factory = ServerConfigFactory.getInstance();
ServerConfig config = factory.getServerConfig();
- if (wsdlFile.startsWith(config.getServerTempDir().toURL().toExternalForm()))
+ if (wsdlPath.startsWith(config.getServerTempDir().toURL().toExternalForm()))
{
- new File(wsdlFile).delete();
+ new File(wsdlPath).delete();
}
// udpate the wsdl file location
- serviceMetaData.setWsdlFile(wsdlPublishURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlPublishURL);
// Process the wsdl imports
Definition wsdl11Definition = wsdlDefinitions.getWsdlOneOneDefinition();
@@ -301,27 +301,23 @@
}
}
- // make sure we don't have a leadig '/'
- String wsdlFile = serviceMetaData.getWsdlFile();
- if (wsdlFile.startsWith("/"))
- wsdlFile = wsdlFile.substring(1);
-
- File wsdlLocation;
- if (wsdlFile.startsWith(expLocation))
+ File wsdlFile;
+ String wsdlLocation = serviceMetaData.getWsdlLocation().toExternalForm();
+ if (wsdlLocation.startsWith(expLocation))
{
- wsdlFile = wsdlFile.substring(expLocation.length());
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
+ wsdlLocation = wsdlLocation.substring(expLocation.length());
+ wsdlFile = new File(locationFile + "/" + wsdlLocation);
}
- else if (wsdlFile.startsWith("file:/"))
+ else if (wsdlLocation.startsWith("file:") || wsdlLocation.startsWith("jar:"))
{
- wsdlFile = wsdlFile.substring(wsdlFile.lastIndexOf("/") + 1);
- wsdlLocation = new File(locationFile + "/" + wsdlFile);
+ wsdlLocation = wsdlLocation.substring(wsdlLocation.lastIndexOf("/") + 1);
+ wsdlFile = new File(locationFile + "/" + wsdlLocation);
}
else
{
- throw new WSException("Invalid wsdlFile '" + wsdlFile + "', expected in: " + expLocation);
+ throw new WSException("Invalid wsdlFile '" + wsdlLocation + "', expected in: " + expLocation);
}
- return wsdlLocation;
+ return wsdlFile;
}
}
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -70,26 +70,22 @@
*/
public Document getDocumentForPath(URL reqURL, String wsdlHost, String resPath) throws IOException
{
- String wsdlLocation = epMetaData.getServiceMetaData().getWsdlFile();
- if (wsdlLocation == null)
- throw new IllegalStateException("Cannot obtain wsdlFile from endpoint meta data");
-
Document wsdlDoc;
// The WSDLFilePublisher should set the location to an URL
- URL wsdlURL = new URL(wsdlLocation);
+ URL wsdlLocation = epMetaData.getServiceMetaData().getWsdlLocation();
// get the root wsdl
if (resPath == null)
{
- Element wsdlElement = DOMUtils.parse(wsdlURL.openStream());
+ Element wsdlElement = DOMUtils.parse(wsdlLocation.openStream());
wsdlDoc = wsdlElement.getOwnerDocument();
}
// get some imported resource
else
{
- String impResourcePath = new File(wsdlURL.getPath()).getParent() + File.separatorChar + resPath;
+ String impResourcePath = new File(wsdlLocation.getPath()).getParent() + File.separatorChar + resPath;
File impResourceFile = new File(impResourcePath);
Element wsdlElement = DOMUtils.parse(impResourceFile.toURL().openStream());
Added: trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -0,0 +1,304 @@
+package org.jboss.ws.core.utils;
+
+/*
+ $Id$
+
+ Copyright 2002 (C) The Werken Company. All Rights Reserved.
+
+ Redistribution and use of this software and associated documentation
+ ("Software"), with or without modification, are permitted provided
+ that the following conditions are met:
+
+ 1. Redistributions of source code must retain copyright
+ statements and notices. Redistributions must also contain a
+ copy of this document.
+
+ 2. Redistributions in binary form must reproduce the
+ above copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+ 3. The name "classworlds" must not be used to endorse or promote
+ products derived from this Software without prior written
+ permission of The Werken Company. For written permission,
+ please contact bob(a)werken.com.
+
+ 4. Products derived from this Software may not be called "classworlds"
+ nor may "classworlds" appear in their names without prior written
+ permission of The Werken Company. "classworlds" is a registered
+ trademark of The Werken Company.
+
+ 5. Due credit should be given to The Werken Company.
+ (http://classworlds.werken.com/).
+
+ THIS SOFTWARE IS PROVIDED BY THE WERKEN COMPANY AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ THE WERKEN COMPANY OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+
+/** <code>URLConnection</code> capable of handling multiply-nested jars.
+ *
+ *
+ * @author <a href="mailto:bob@eng.werken.com">bob mcwhirter</a>
+ *
+ * @version $Id$
+ */
+public class JarUrlConnection extends JarURLConnection
+{
+ // ----------------------------------------------------------------------
+ // Instance members
+ // ----------------------------------------------------------------------
+
+ /** Base resource. */
+ private URL baseResource;
+
+ /** Additional nested segments. */
+ private String[] segments;
+
+ /** Terminal input-stream. */
+ private InputStream in;
+
+ // ----------------------------------------------------------------------
+ // Constructors
+ // ----------------------------------------------------------------------
+
+ /** Construct.
+ *
+ * @param url Target URL of the connections.
+ *
+ * @throws java.io.IOException If an error occurs while attempting to initialize
+ * the connection.
+ */
+ public JarUrlConnection(URL url) throws IOException
+ {
+ super(url = normaliseURL(url));
+
+ String baseText = url.getPath();
+
+ int bangLoc = baseText.indexOf("!");
+
+ String baseResourceText = baseText.substring(0, bangLoc);
+
+ String extraText = "";
+
+ if (bangLoc <= (baseText.length() - 2) && baseText.charAt(bangLoc + 1) == '/')
+ {
+ if (bangLoc + 2 == baseText.length())
+ {
+ extraText = "";
+ }
+ else
+ {
+ extraText = baseText.substring(bangLoc + 1);
+ }
+ }
+ else
+ {
+ throw new MalformedURLException("No !/ in url: " + url.toExternalForm());
+ }
+
+ List segments = new ArrayList();
+
+ StringTokenizer tokens = new StringTokenizer(extraText, "!");
+
+ while (tokens.hasMoreTokens())
+ {
+ segments.add(tokens.nextToken());
+ }
+
+ this.segments = (String[])segments.toArray(new String[segments.size()]);
+
+ this.baseResource = new URL(baseResourceText);
+ }
+
+ protected static URL normaliseURL(URL url) throws MalformedURLException
+ {
+ String text = normalizeUrlPath(url.toString());
+
+ if (!text.startsWith("jar:"))
+ {
+ text = "jar:" + text;
+ }
+
+ if (text.indexOf('!') < 0)
+ {
+ text = text + "!/";
+ }
+
+ return new URL(text);
+ }
+
+ // ----------------------------------------------------------------------
+ // Instance methods
+ // ----------------------------------------------------------------------
+
+ /** Retrieve the nesting path segments.
+ *
+ * @return The segments.
+ */
+ protected String[] getSegments()
+ {
+ return this.segments;
+ }
+
+ /** Retrieve the base resource <code>URL</code>.
+ *
+ * @return The base resource url.
+ */
+ protected URL getBaseResource()
+ {
+ return this.baseResource;
+ }
+
+ /** @see java.net.URLConnection
+ */
+ public void connect() throws IOException
+ {
+ if (this.segments.length == 0)
+ {
+ setupBaseResourceInputStream();
+ }
+ else
+ {
+ setupPathedInputStream();
+ }
+ }
+
+ /** Setup the <code>InputStream</code> purely from the base resource.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected void setupBaseResourceInputStream() throws IOException
+ {
+ this.in = getBaseResource().openStream();
+ }
+
+ /** Setup the <code>InputStream</code> for URL with nested segments.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected void setupPathedInputStream() throws IOException
+ {
+ InputStream curIn = getBaseResource().openStream();
+
+ for (int i = 0; i < this.segments.length; ++i)
+ {
+ curIn = getSegmentInputStream(curIn, segments[i]);
+ }
+
+ this.in = curIn;
+ }
+
+ /** Retrieve the <code>InputStream</code> for the nesting
+ * segment relative to a base <code>InputStream</code>.
+ *
+ * @param baseIn The base input-stream.
+ * @param segment The nesting segment path.
+ *
+ * @return The input-stream to the segment.
+ *
+ * @throws java.io.IOException If an I/O error occurs.
+ */
+ protected InputStream getSegmentInputStream(InputStream baseIn, String segment) throws IOException
+ {
+ JarInputStream jarIn = new JarInputStream(baseIn);
+ JarEntry entry = null;
+
+ while (jarIn.available() != 0)
+ {
+ entry = jarIn.getNextJarEntry();
+
+ if (entry == null)
+ {
+ break;
+ }
+
+ if (("/" + entry.getName()).equals(segment))
+ {
+ return jarIn;
+ }
+ }
+
+ throw new IOException("unable to locate segment: " + segment);
+ }
+
+ /** @see java.net.URLConnection
+ */
+ public InputStream getInputStream() throws IOException
+ {
+ if (this.in == null)
+ {
+ connect();
+ }
+ return this.in;
+ }
+
+ /**
+ * @return JarFile
+ * @throws java.io.IOException
+ * @see java.net.JarURLConnection#getJarFile()
+ */
+ public JarFile getJarFile() throws IOException
+ {
+ String url = baseResource.toExternalForm();
+
+ if (url.startsWith("file:/"))
+ {
+ url = url.substring(6);
+ }
+
+ return new JarFile(URLDecoder.decode(url, "UTF-8"));
+ }
+
+ private static String normalizeUrlPath(String name)
+ {
+ if (name.startsWith("/"))
+ {
+ name = name.substring(1);
+
+ System.out.println("1 name = " + name);
+ }
+
+ // Looking for org/codehaus/werkflow/personality/basic/../common/core-idioms.xml
+ // | i |
+ // +-------+ remove
+ //
+ int i = name.indexOf("/..");
+
+ // Can't be at the beginning because we have no root to refer to so
+ // we start at 1.
+ if (i > 0)
+ {
+ int j = name.lastIndexOf("/", i - 1);
+
+ name = name.substring(0, j) + name.substring(i + 3);
+
+ System.out.println("2 name = " + name);
+ }
+
+ return name;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/utils/JarUrlConnection.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -0,0 +1,76 @@
+/*
+ * 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.core.utils;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * A wrapper around an URL that can handle input streams for resources in nested jars.
+ *
+ * The jdk-1.5.0_10 cannot handle this type of URL
+ *
+ * jar:file://somepath/jaxws-eardeployment.ear!/jaxws-eardeployment.war!/WEB-INF/wsdl/TestEndpoint.wsdl
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 12-Dec-2006 (Dosi's birthday)
+ */
+public class ResourceURL
+{
+ private URL targetURL;
+
+ public ResourceURL(URL targetURL)
+ {
+ this.targetURL = targetURL;
+ }
+
+ public URL getTargetURL()
+ {
+ return targetURL;
+ }
+
+ public InputStream openStream() throws IOException
+ {
+ boolean isJarUrl = "jar".equals(targetURL.getProtocol());
+ return isJarUrl ? new JarUrlConnection(targetURL).getInputStream() : targetURL.openStream();
+ }
+
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof ResourceURL)) return false;
+ ResourceURL other = (ResourceURL)obj;
+ return toString().equals(other.toString());
+ }
+
+ public String toString()
+ {
+ return targetURL.toString();
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/utils/ResourceURL.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -108,7 +108,7 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceQName);
wsMetaData.addService(serviceMetaData);
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlURL);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
URL mappingURL = null;
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -22,6 +22,7 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxrpc;
+import java.net.URL;
import java.util.Set;
import javax.management.ObjectName;
@@ -80,8 +81,12 @@
serviceMetaData.setWebserviceDescriptionName(wsdMetaData.getWebserviceDescriptionName());
wsMetaData.addService(serviceMetaData);
+ // Set wsdl location
+ String wsdlFile = wsdMetaData.getWsdlFile();
+ URL wsdlLocation = udi.getMetaDataFile(wsdlFile);
+
// Unmarshall the WSDL
- serviceMetaData.setWsdlFile(wsdMetaData.getWsdlFile());
+ serviceMetaData.setWsdlLocation(wsdlLocation);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
// Unmarshall the jaxrpc-mapping.xml
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -75,7 +75,7 @@
ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
wsMetaData.addService(serviceMetaData);
- serviceMetaData.setWsdlFile(wsdlURL.toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlURL);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
buildMetaDataInternal(serviceMetaData, wsdlDefinitions);
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.metadata.builder.jaxws;
+import java.io.IOException;
+
import javax.xml.ws.BindingType;
import org.jboss.logging.Logger;
@@ -42,7 +44,7 @@
// provide logging
private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
- public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName);
+ public abstract ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException;
protected void processBindingType(EndpointMetaData epMetaData, Class<?> wsClass)
{
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -22,6 +22,9 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxws;
+import java.io.IOException;
+import java.net.URL;
+
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.management.ObjectName;
@@ -64,7 +67,7 @@
*/
@Override
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
{
// 5.3 Conformance (Provider implementation): A Provider based service endpoint implementation MUST
// implement a typed Provider interface.
@@ -126,7 +129,10 @@
// Process WSDL
String wsdlLocation = anWebServiceProvider.wsdlLocation();
if (wsdlLocation.length() > 0)
- serviceMetaData.setWsdlFile(wsdlLocation);
+ {
+ URL wsdlURL = udi.getMetaDataFile(wsdlLocation);
+ serviceMetaData.setWsdlLocation(wsdlURL);
+ }
// Set the endpoint address
processPortComponent(udi, sepClass, linkName, sepMetaData);
@@ -135,7 +141,7 @@
MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
// A provider may not have a WSDL file
- if (sepMetaData.getServiceMetaData().getWsdlFile() != null)
+ if (sepMetaData.getServiceMetaData().getWsdlLocation() != null)
MetaDataBuilder.replaceAddressLocation(sepMetaData);
// init service endpoint id
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.IOException;
+
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
@@ -50,7 +52,7 @@
}
protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi, Class<?> beanClass, String beanName)
- throws SecurityException, ClassNotFoundException, NoSuchMethodException
+ throws SecurityException, ClassNotFoundException, NoSuchMethodException, IOException
{
JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
if (builder != null)
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -59,7 +59,6 @@
import javax.xml.ws.addressing.AddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.remoting.samples.chat.exceptions.InvalidArgumentException;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
@@ -120,7 +119,7 @@
private Class<?> klass;
private ServerEndpointMetaData semd;
private ServiceMetaData smd;
- private String wsdlLocation;
+ private URL wsdlLocation;
}
// provide logging
@@ -642,7 +641,7 @@
processMetaExtensions(epMetaData, opMetaData);
}
- private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?> sepClass, ClassLoader loader) throws ClassNotFoundException
+ private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi) throws ClassNotFoundException, IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
if (anWebService == null)
@@ -674,23 +673,15 @@
if (anWebService.endpointInterface().length() > 0)
{
seiName = anWebService.endpointInterface();
- seiClass = loader.loadClass(seiName);
+ seiClass = udi.classLoader.loadClass(seiName);
anWebService = seiClass.getAnnotation(WebService.class);
if (anWebService == null)
throw new WSException("Interface does not have a @WebService annotation: " + seiName);
- else
- {
- if(anWebService.portName().length()>0
- || anWebService.serviceName().length()>0
- || anWebService.endpointInterface().length()>0
- )
- {
- throw new WSException(seiName + ": The service endpoint interface MUST NOT include the JSR-181 annotation " +
- "elements portName, serviceName and endpointInterface of the annotation @WebService.");
- }
- }
+ if (anWebService.portName().length() > 0 || anWebService.serviceName().length() > 0 || anWebService.endpointInterface().length() > 0)
+ throw new WSException("@WebService[portName,serviceName,endpointInterface] MUST NOT be defined on: " + seiName);
+
name = anWebService.name();
if (name.length() == 0)
name = WSDLUtils.getJustClassName(seiClass);
@@ -715,8 +706,7 @@
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.wsdlLocation = udi.getMetaDataFile(wsdlLocation);
result.smd.addEndpoint(result.semd);
wsMetaData.addService(result.smd);
@@ -859,11 +849,11 @@
}
}
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, String wsdlLocation, EndpointMetaData epMetaData)
+ protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, URL wsdlLocation, EndpointMetaData epMetaData)
{
- if (wsdlLocation.length() > 0)
+ if (wsdlLocation != null)
{
- serviceMetaData.setWsdlFile(wsdlLocation);
+ serviceMetaData.setWsdlLocation(wsdlLocation);
}
else
{
@@ -882,8 +872,7 @@
wsdlTmpFile.deleteOnExit();
Writer writer = IOUtils.getCharsetFileWriter(wsdlTmpFile, Constants.DEFAULT_XML_CHARSET);
- new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriterResolver()
- {
+ new WSDLWriter(wsdlDefinitions).write(writer, Constants.DEFAULT_XML_CHARSET, new WSDLWriterResolver() {
public WSDLWriterResolver resolve(String suggestedFile) throws IOException
{
File newTmpFile = File.createTempFile(suggestedFile, ".wsdl", tmpdir);
@@ -896,7 +885,7 @@
});
writer.close();
- serviceMetaData.setWsdlFile(wsdlTmpFile.toURL().toExternalForm());
+ serviceMetaData.setWsdlLocation(wsdlTmpFile.toURL());
}
catch (RuntimeException rte)
{
@@ -981,7 +970,7 @@
{
try
{
- EndpointResult result = processWebService(wsMetaData, sepClass, udi.classLoader);
+ EndpointResult result = processWebService(wsMetaData, sepClass, udi);
// Clear the java types, etc.
resetMetaDataBuilder(udi.classLoader);
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -71,7 +71,7 @@
private QName serviceName;
private String wsdName;
- private String wsdlFile;
+ private URL wsdlLocation;
private String jaxrpcMappingFile;
private String wsdlPublishLocation;
@@ -121,14 +121,14 @@
this.wsdName = wsdName;
}
- public String getWsdlFile()
+ public URL getWsdlLocation()
{
- return wsdlFile;
+ return wsdlLocation;
}
- public void setWsdlFile(String wsdlFile)
+ public void setWsdlLocation(URL wsdlLocation)
{
- this.wsdlFile = wsdlFile;
+ this.wsdlLocation = wsdlLocation;
}
public String getWsdlPublishLocation()
@@ -247,39 +247,18 @@
*/
public WSDLDefinitions getWsdlDefinitions()
{
- WSDLDefinitions wsdlDefinitions = (WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlFile);
- if (wsdlDefinitions == null && wsdlFile != null)
+ WSDLDefinitions wsdlDefinitions = null;
+ if (wsdlLocation != null)
{
- URL wsdlLocation = getWsdlLocation();
- if (wsdlLocation == null)
- throw new IllegalArgumentException("Cannot find wsdl in deployment: " + wsdlFile);
-
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- wsdlDefinitions = factory.parse(wsdlLocation);
- wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions);
- }
- return wsdlDefinitions;
- }
-
- public URL getWsdlLocation()
- {
- URL wsdlLocation = null;
- if (wsdlFile != null)
- {
- try
+ wsdlDefinitions = (WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlLocation.toExternalForm());
+ if (wsdlDefinitions == null)
{
- wsdlLocation = new URL(wsdlFile);
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ wsdlDefinitions = factory.parse(wsdlLocation);
+ wsMetaData.addWSDLDefinition(wsdlLocation.toExternalForm(), wsdlDefinitions);
}
- catch (MalformedURLException e)
- {
- // ignore
- }
- if (wsdlLocation == null)
- {
- wsdlLocation = wsMetaData.getClassLoader().getResource(wsdlFile);
- }
}
- return wsdlLocation;
+ return wsdlDefinitions;
}
public TypeMappingImpl getTypeMapping()
@@ -401,7 +380,7 @@
StringBuilder buffer = new StringBuilder("\nServiceMetaData:");
buffer.append("\n qname=" + serviceName);
buffer.append("\n wsdName=" + wsdName);
- buffer.append("\n wsdlFile=" + wsdlFile);
+ buffer.append("\n wsdlFile=" + wsdlLocation);
buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile);
buffer.append("\n publishLocation=" + wsdlPublishLocation);
buffer.append("\n properties=" + properties);
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -40,6 +40,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
import org.w3c.dom.Document;
@@ -164,15 +165,15 @@
{
try
{
- InputStream wsdlInputStream = wsdlLocation.openStream();
+ InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
try
{
DocumentBuilder builder = DOMUtils.getDocumentBuilder();
- return builder.parse(wsdlInputStream);
+ return builder.parse(inputStream);
}
finally
{
- wsdlInputStream.close();
+ inputStream.close();
}
}
catch (ConnectException ex)
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -32,6 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.ResourceURL;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@@ -43,38 +44,38 @@
private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
private EntityResolver entityResolver;
- private URL wsdlURL;
+ private URL wsdlLocation;
private String latestImportURI;
- public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlFile)
+ public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlLocation)
{
- if (wsdlFile == null)
+ if (wsdlLocation == null)
throw new IllegalArgumentException("WSDL file argument cannot be null");
this.entityResolver = entityResolver;
- this.wsdlURL = wsdlFile;
+ this.wsdlLocation = wsdlLocation;
}
public InputSource getBaseInputSource()
{
- log.trace("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
+ log.trace("getBaseInputSource [wsdlUrl=" + wsdlLocation + "]");
try
{
- InputStream is = wsdlURL.openStream();
- if (is == null)
- throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlURL + "]");
+ InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
+ if (inputStream == null)
+ throw new IllegalArgumentException("Cannot obtain wsdl from [" + wsdlLocation + "]");
- return new InputSource(is);
+ return new InputSource(inputStream);
}
catch (IOException e)
{
- throw new RuntimeException("Cannot access wsdl from [" + wsdlURL + "], " + e.getMessage());
+ throw new RuntimeException("Cannot access wsdl from [" + wsdlLocation + "], " + e.getMessage());
}
}
public String getBaseURI()
{
- return wsdlURL.toExternalForm();
+ return wsdlLocation.toExternalForm();
}
public InputSource getImportInputSource(String parent, String resource)
Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/test/ant/build-jars-jaxws.xml 2006-12-12 12:23:36 UTC (rev 1630)
@@ -47,11 +47,17 @@
<classes dir="${build.tests.dir}/classes">
<include name="org/jboss/test/ws/jaxws/eardeployment/JSEBean.class"/>
</classes>
+ <webinf dir="${build.tests.dir}/resources/jaxws/eardeployment/WEB-INF">
+ <include name="wsdl/**"/>
+ </webinf>
</war>
<jar jarfile="${build.tests.dir}/libs/jaxws-eardeployment.jar">
<fileset dir="${build.tests.dir}/classes">
<include name="org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.class"/>
</fileset>
+ <metainf dir="${build.tests.dir}/resources/jaxws/eardeployment/WEB-INF">
+ <include name="wsdl/**"/>
+ </metainf>
</jar>
<jar jarfile="${build.tests.dir}/libs/jaxws-eardeployment.ear">
<fileset dir="${build.tests.dir}/libs">
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -29,10 +29,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.PortComponent;
-@Stateless
-@WebService(name="TestEndpoint")
+// Test that the wsdl can be read from the nested deployment
+@WebService(name="TestEndpoint", wsdlLocation="META-INF/wsdl/TestEndpoint.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@PortComponent(contextRoot="/earejb3")
+@Stateless
public class EJB3Bean
{
private static Logger log = Logger.getLogger(EJB3Bean.class);
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -21,6 +21,7 @@
*/
package org.jboss.test.ws.jaxws.eardeployment;
+import java.io.File;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -29,6 +30,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.ResourceURL;
+import org.w3c.dom.Element;
/**
* Test ear deployment
@@ -42,6 +46,18 @@
{
return JBossWSTestSetup.newTestSetup(EarTestCase.class, "jaxws-eardeployment.ear");
}
+
+ public void testResourceURL() throws Exception
+ {
+ File earFile = new File("libs/jaxws-eardeployment.ear");
+ assertTrue(earFile.exists());
+
+ URL warURL = new URL("jar:" + earFile.toURL() + "!/jaxws-eardeployment.war!/");
+ URL wsdlURL = new URL(warURL, "WEB-INF/wsdl/TestEndpoint.wsdl");
+
+ Element root = DOMUtils.parse(new ResourceURL(wsdlURL).openStream());
+ assertNotNull(root);
+ }
public void testEJB3Endpoint() throws Exception
{
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java 2006-12-12 08:28:24 UTC (rev 1629)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/JSEBean.java 2006-12-12 12:23:36 UTC (rev 1630)
@@ -27,7 +27,8 @@
import org.jboss.logging.Logger;
-@WebService(name="TestEndpoint")
+//Test that the wsdl can be read from the nested deployment
+@WebService(name="TestEndpoint", wsdlLocation="WEB-INF/wsdl/TestEndpoint.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class JSEBean
{
19 years, 4 months