JBossWS SVN: r1651 - in trunk/src: main/java/org/jboss/ws/core/soap test/java/org/jboss/test/ws/jaxws/exception
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-14 09:58:46 -0500 (Thu, 14 Dec 2006)
New Revision: 1651
Modified:
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
Log:
Fix jaxws ExceptionTestCase
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-14 14:21:35 UTC (rev 1650)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-14 14:58:46 UTC (rev 1651)
@@ -212,13 +212,14 @@
{
log.warn("Empty namespace URI with fault code '" + faultName + "', assuming: " + Constants.NS_SOAP11_ENV);
nsURI = Constants.NS_SOAP11_ENV;
+ prefix = getPrefix();
}
- if ("".equals(prefix) && getNamespaceURI().equals(nsURI))
- prefix = getPrefix();
-
+ if (nsURI.length() > 0 && prefix.length() == 0)
+ prefix = "codeNS";
+
String prevNS = getNamespaceURI(prefix);
- if (nsURI.equals(prevNS) == false)
+ if (prevNS == null)
addNamespaceDeclaration(prefix, nsURI);
String faultCode = prefix + ":" + localName;
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-14 14:21:35 UTC (rev 1650)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-14 14:58:46 UTC (rev 1651)
@@ -24,13 +24,11 @@
import javax.jws.WebService;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPFault;
import javax.xml.ws.soap.SOAPFaultException;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPFaultImpl;
-
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.exception.ExceptionEndpoint")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.exception.ExceptionEndpoint")
public class ExceptionEndpointImpl implements ExceptionEndpoint
{
public void throwRuntimeException()
@@ -41,12 +39,10 @@
public void throwSoapFaultException()
{
// This should be thrown as-is
-
try
{
- SOAPFault fault = new SOAPFaultImpl();
- fault.setFaultCode(new NameImpl(new QName("http://foo", "FooCode")));
- fault.setFaultString("this is a fault string!");
+ SOAPFactory factory = SOAPFactory.newInstance();
+ SOAPFault fault = factory.createFault("this is a fault string!", new QName("http://foo", "FooCode"));
fault.setFaultActor("mr.actor");
fault.addDetail().addChildElement("test");
throw new SOAPFaultException(fault);
19 years, 4 months
JBossWS SVN: r1650 - in trunk/src/main/java/org/jboss/ws: integration/jboss50 metadata/builder/jaxws metadata/umdm tools/metadata
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 09:21:35 -0500 (Thu, 14 Dec 2006)
New Revision: 1650
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
Log:
Refactor config processing
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -23,19 +23,14 @@
// $Id$
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.config.CommonConfig;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import javax.servlet.ServletContext;
+
/**
* A servlet that is installed for every web service endpoint.
*
@@ -67,20 +62,8 @@
ServerEndpointMetaData sepMetaData = wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
sepMetaData.setConfigName(configName);
sepMetaData.setConfigFile(configFile);
-
- List<HandlerMetaData> sepHandlers = sepMetaData.getHandlerMetaData(HandlerType.ENDPOINT);
- sepMetaData.clearHandlers();
-
- // Add pre handlers
- CommonConfig sepConfig = sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
-
- // Restore the endpoint handlers
- sepMetaData.addHandlers(sepHandlers);
-
- // Add post handlers
- sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.POST));
-
+ sepMetaData.processEndpointConfig();
+
log.debug("Updated server meta data" + sepMetaData);
}
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -60,20 +60,13 @@
if (wsClass.isAnnotationPresent(SOAPBinding.class))
processSOAPBinding(epMetaData, wsClass);
- // Clear handlers
- epMetaData.clearHandlers();
+ // process config, this will as well setup the handler
+ epMetaData.processEndpointConfig();
- // Add pre handlers
- ClientConfigJAXWS jaxwsConfig = (ClientConfigJAXWS)epMetaData.getEndpointConfig();
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.PRE));
-
// Process an optional @HandlerChain annotation
if (wsClass.isAnnotationPresent(HandlerChain.class))
processHandlerChain(epMetaData, wsClass);
- // Add post handlers
- epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.POST));
-
// Process @WebMethod
processWebMethods(epMetaData, wsClass);
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-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -1027,18 +1027,19 @@
if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
- // Add pre handlers
- EndpointConfigJAXWS jaxrpcConfig = (EndpointConfigJAXWS)sepMetaData.getEndpointConfig();
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.PRE));
+ // process configuration, this will as well setup the handler
+ sepMetaData.processEndpointConfig();
// Process an optional @HandlerChain annotation
if (sepClass.isAnnotationPresent(HandlerChain.class))
+ {
processHandlerChain(sepMetaData, sepClass);
+ }
else if (wsClass.isAnnotationPresent(HandlerChain.class))
+ {
processHandlerChain(sepMetaData, wsClass);
+ }
- // Add post handlers
- sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.POST));
// init service endpoint id
ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -33,6 +33,7 @@
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
+import org.jboss.ws.metadata.config.jaxws.ClientConfigJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
@@ -95,6 +96,14 @@
return endpointConfig;
}
+ public void processEndpointConfig() {
+ // rebuild handler from config
+ clearHandlers();
+ ClientConfigJAXWS jaxwsConfig = (ClientConfigJAXWS)getEndpointConfig();
+ addHandlers(jaxwsConfig.getHandlers(this, HandlerType.PRE));
+ addHandlers(jaxwsConfig.getHandlers(this, HandlerType.POST));
+ }
+
public String getConfigName() {
String configName = super.getConfigName();
if (configName == null)
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-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -157,6 +157,8 @@
public abstract Object getEndpointConfig();
+ public abstract void processEndpointConfig();
+
public String getEndpointAddress()
{
return endpointAddress;
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-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -35,6 +35,7 @@
import javax.xml.namespace.QName;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.List;
/**
* Client side endpoint meta data.
@@ -71,6 +72,10 @@
// The bean that registers with the ServiceEndpointManager
private String managedEndpointBean = "org.jboss.ws.core.server.ServiceEndpoint";
+ private static final String DEFAULT_JAXRPC_CONFIG_FILE = "META-INF/standard-jaxrpc-endpoint-config.xml";
+ private static final String DEFAULT_JAXWS_CONFIG_FILE = "META-INF/standard-jaxws-endpoint-config.xml";
+ private static final String DEFAULT_CONFIG_NAME = "Standard Endpoint";
+
public ServerEndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
{
super(service, qname, interfaceQName, type);
@@ -135,7 +140,7 @@
public void setContextRoot(String contextRoot)
{
- if (contextRoot != null && contextRoot.startsWith("/") == false)
+ if (contextRoot != null && !(contextRoot.startsWith("/")))
throw new IllegalArgumentException("context root should start with '/'");
this.contextRoot = contextRoot;
@@ -158,7 +163,7 @@
public void setURLPattern(String urlPattern)
{
- if (urlPattern != null && urlPattern.startsWith("/") == false)
+ if (urlPattern != null && !urlPattern.startsWith("/"))
throw new IllegalArgumentException("url pattern should start with '/'");
this.urlPattern = urlPattern;
@@ -220,7 +225,7 @@
String configName = super.getConfigName();
if (configName == null)
{
- configName = "Standard Endpoint";
+ configName = DEFAULT_CONFIG_NAME;
setConfigName(configName);
}
return configName;
@@ -228,21 +233,38 @@
public String getConfigFile() {
String configFile = super.getConfigFile();
+
if (configFile == null)
{
if (getType() == Type.JAXRPC)
{
- configFile = "META-INF/standard-jaxrpc-endpoint-config.xml";
+ configFile = DEFAULT_JAXRPC_CONFIG_FILE;
}
else
{
- configFile = "META-INF/standard-jaxws-endpoint-config.xml";
+ configFile = DEFAULT_JAXWS_CONFIG_FILE;
}
setConfigFile(configFile);
}
return configFile;
}
+ /**
+ * Processes an associated configuration and
+ * rebuilds the related meta data model.
+ */
+ public void processEndpointConfig()
+ {
+ // update handler configuration
+ List<HandlerMetaData> sepHandlers = getHandlerMetaData(HandlerType.ENDPOINT);
+ clearHandlers();
+
+ CommonConfig sepConfig = getEndpointConfig();
+ addHandlers(sepConfig.getHandlers(this, HandlerType.PRE));
+ addHandlers(sepHandlers);
+ addHandlers(sepConfig.getHandlers(this, HandlerType.POST));
+ }
+
private URL filenameToURL(String configFile) {
URL configURL = null;
try
@@ -268,31 +290,31 @@
public String toString()
{
StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:");
- buffer.append("\n type=" + getType());
- buffer.append("\n qname=" + getQName());
- buffer.append("\n id=" + getServiceEndpointID().getCanonicalName());
- buffer.append("\n address=" + getEndpointAddress());
- buffer.append("\n binding=" + getBindingId());
- buffer.append("\n linkName=" + getLinkName());
- buffer.append("\n implName=" + getServiceEndpointImplName());
- buffer.append("\n seiName=" + getServiceEndpointInterfaceName());
- buffer.append("\n serviceMode=" + getServiceMode());
- buffer.append("\n portComponentName=" + getPortComponentName());
- buffer.append("\n contextRoot=" + getContextRoot());
- buffer.append("\n urlPattern=" + getURLPattern());
- buffer.append("\n configFile=" + getConfigFile());
- buffer.append("\n configName=" + getConfigName());
- buffer.append("\n authMethod=" + getAuthMethod());
- buffer.append("\n transportGuarantee=" + getTransportGuarantee());
- buffer.append("\n properties=" + getProperties());
+ buffer.append("\n type=").append(getType());
+ buffer.append("\n qname=").append(getQName());
+ buffer.append("\n id=").append(getServiceEndpointID().getCanonicalName());
+ buffer.append("\n address=").append(getEndpointAddress());
+ buffer.append("\n binding=").append(getBindingId());
+ buffer.append("\n linkName=").append(getLinkName());
+ buffer.append("\n implName=").append(getServiceEndpointImplName());
+ buffer.append("\n seiName=").append(getServiceEndpointInterfaceName());
+ buffer.append("\n serviceMode=").append(getServiceMode());
+ buffer.append("\n portComponentName=").append(getPortComponentName());
+ buffer.append("\n contextRoot=").append(getContextRoot());
+ buffer.append("\n urlPattern=").append(getURLPattern());
+ buffer.append("\n configFile=").append(getConfigFile());
+ buffer.append("\n configName=").append(getConfigName());
+ buffer.append("\n authMethod=").append(getAuthMethod());
+ buffer.append("\n transportGuarantee=").append(getTransportGuarantee());
+ buffer.append("\n properties=").append(getProperties());
for (OperationMetaData opMetaData : getOperations())
{
- buffer.append("\n" + opMetaData);
+ buffer.append("\n").append(opMetaData);
}
for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
{
- buffer.append("\n" + hdlMetaData);
+ buffer.append("\n").append(hdlMetaData);
}
return buffer.toString();
}
Modified: trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-14 14:20:57 UTC (rev 1649)
+++ trunk/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2006-12-14 14:21:35 UTC (rev 1650)
@@ -48,4 +48,8 @@
{
throw new NotImplementedException();
}
+
+ public void processEndpointConfig() {
+ throw new NotImplementedException();
+ }
}
\ No newline at end of file
19 years, 4 months
JBossWS SVN: r1649 - trunk/src/main/java/org/jboss/ws/core
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 09:20:57 -0500 (Thu, 14 Dec 2006)
New Revision: 1649
Modified:
trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
Log:
Allow MTOM bindings
Modified: trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2006-12-14 14:18:16 UTC (rev 1648)
+++ trunk/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2006-12-14 14:20:57 UTC (rev 1649)
@@ -55,11 +55,13 @@
protected void initBinding(String bindingId, Type type)
{
- if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId))
+ if (CommonSOAPBinding.SOAP11HTTP_BINDING.equals(bindingId)
+ || CommonSOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(bindingId))
{
binding = (type == Type.JAXWS ? new SOAP11BindingJAXWS() : new SOAP11BindingJAXRPC());
}
- else if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId))
+ else if (CommonSOAPBinding.SOAP12HTTP_BINDING.equals(bindingId)
+ || CommonSOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(bindingId))
{
binding = (type == Type.JAXWS ? new SOAP12BindingJAXWS() : new SOAP12BindingJAXRPC());
}
19 years, 4 months
JBossWS SVN: r1648 - in trunk: . src/main/java/javax/xml/soap src/main/java/org/jboss/ws src/main/java/org/jboss/ws/core src/main/java/org/jboss/ws/core/jaxrpc src/main/java/org/jboss/ws/core/jaxrpc/binding src/main/java/org/jboss/ws/core/jaxws src/main/java/org/jboss/ws/core/jaxws/binding src/main/java/org/jboss/ws/core/soap src/main/java/org/jboss/ws/extensions/addressing/soap src/main/java/org/jboss/ws/tools/wsdl src/test/java/org/jboss/test/ws/jaxws/exception
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-14 09:18:16 -0500 (Thu, 14 Dec 2006)
New Revision: 1648
Modified:
trunk/build.xml
trunk/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.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/SOAPEnvelopeImpl.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/SOAPPartImpl.java
trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
Log:
Implement SAAJ-1.3 SOAPFactory methods
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/build.xml 2006-12-14 14:18:16 UTC (rev 1648)
@@ -287,6 +287,7 @@
<include name="wstools.bat"/>
<include name="wstools-log4j.xml"/>
</fileset>
+ <metainf dir="${build.resources.dir}/jboss-saaj.jar/META-INF"/>
</jar>
<!-- Build jbossws-context.war -->
Modified: trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -23,11 +23,9 @@
// $Id$
-import java.security.PrivilegedAction;
-
import javax.xml.namespace.QName;
-import org.jboss.util.NotImplementedException;
+import org.w3c.dom.Element;
/** SOAPFactory is a factory for creating various objects that exist in the SOAP XML tree.
*
@@ -42,6 +40,8 @@
*/
public abstract class SOAPFactory
{
+ private static SOAPFactory 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:
@@ -56,20 +56,22 @@
*/
public static SOAPFactory newInstance() throws SOAPException
{
- String propertyName = "javax.xml.soap.SOAPFactory";
- SOAPFactory factory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
-
- // Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
- if (factory == null)
+ if (soapFactory == null)
{
- SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
- factory = saajFactory.newSOAPFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+ String propertyName = "javax.xml.soap.SOAPFactory";
+ soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+
+ // Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
+ if (soapFactory == null)
+ {
+ SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
+ soapFactory = saajFactory.newSOAPFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+ }
+
+ if (soapFactory == null)
+ throw new SOAPException("Failed to to determine the SOAPFactory implementation class");
}
-
- if (factory == null)
- throw new SOAPException("Failed to to determine the SOAPFactory implementation class");
-
- return factory;
+ return soapFactory;
}
@@ -84,8 +86,13 @@
*/
public static SOAPFactory newInstance(String protocol) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
+ SOAPFactory factory = saajFactory.newSOAPFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
+
+ if (factory == null)
+ throw new SOAPException("Failed to to determine the SOAPFactory implementation class");
+
+ return factory;
}
/** Creates a new Detail object which serves as a container for DetailEntry objects.
@@ -107,11 +114,7 @@
* @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();
- }
+ public abstract SOAPElement createElement(Element domElement) throws SOAPException;
/** Create a SOAPElement object initialized with the given local name.
*
@@ -149,11 +152,7 @@
* @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();
- }
+ public abstract SOAPElement createElement(QName qname) throws SOAPException;
/**
* Creates a new SOAPFault object initialized with the given reasonText and faultCode
@@ -193,21 +192,4 @@
* @throws SOAPException if there is a SOAP error
*/
public abstract Name createName(String localName, String prefix, String uri) throws SOAPException;
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
- private String defaultValue;
-
- PropertyAccessAction(String name, String defaultValue)
- {
- this.name = name;
- this.defaultValue = defaultValue;
- }
-
- public Object run()
- {
- return System.getProperty(name, defaultValue);
- }
- }
}
Modified: trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -104,10 +104,9 @@
static final String DOCUMENT_LITERAL = "Document/Literal";
// Some prefixes
- static final String PREFIX_ENV = "env";
+ static final String PREFIX_ENV = SOAPConstants.SOAP_ENV_PREFIX;
static final String PREFIX_XMIME = "xmime";
static final String PREFIX_SOAP11 = "soap";
- static final String PREFIX_SOAP12 = "soap12";
static final String PREFIX_SOAP11_ENC = "soap11-enc";
static final String PREFIX_TNS = "tns";
static final String PREFIX_WSDL = "wsdl";
Modified: trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -48,7 +48,7 @@
protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
{
MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
+ factory.setEnvNamespace(Constants.NS_SOAP11_ENV);
SOAPMessage soapMessage = factory.createMessage();
Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
Modified: trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -47,7 +47,7 @@
protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
{
MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP12_ENV);
+ factory.setEnvNamespace(Constants.NS_SOAP12_ENV);
return factory.createMessage();
}
}
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -264,7 +264,7 @@
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
Element domElement = DOMUtils.parse(xmlFragment);
- SOAPElement soapElement = soapFactory.createElement(domElement, true);
+ SOAPElement soapElement = soapFactory.createElement(domElement);
detail = soapFault.addDetail();
detail.addChildElement(soapElement);
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -1,41 +1,35 @@
/*
-* 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.
-*/
+ * 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.jaxrpc.binding;
// $Id$
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFactory;
import org.jboss.logging.Logger;
-import org.jboss.ws.core.jaxrpc.binding.BindingException;
-import org.jboss.ws.core.jaxrpc.binding.DeserializerSupport;
-import org.jboss.ws.core.jaxrpc.binding.SerializationContext;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
* A deserializer that can handle xsd:anyType
@@ -47,14 +41,14 @@
{
// provide logging
private static final Logger log = Logger.getLogger(SOAPElementDeserializer.class);
-
+
public Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
{
log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
try
{
Element domElement = DOMUtils.parse(xmlFragment);
- SOAPElement soapElement = createElement(domElement, true);
+ SOAPElement soapElement = new SOAPFactoryImpl().createElement(domElement);
return soapElement;
}
catch (RuntimeException rte)
@@ -66,56 +60,4 @@
throw new BindingException();
}
}
-
- /**
- * Create a SOAPElement from a DOM Element.
- * This method is not part of the javax.xml.soap.SOAPFactory interface.
- */
- public SOAPElement createElement(Element domNode, boolean deep) throws SOAPException
- {
- if (domNode == null)
- throw new IllegalArgumentException("Source node cannot be null");
-
- String localName = domNode.getLocalName();
- String prefix = domNode.getPrefix() != null ? domNode.getPrefix() : "";
- String nsURI = domNode.getNamespaceURI() != null ? domNode.getNamespaceURI() : "";
-
- SOAPFactory factory = SOAPFactory.newInstance();
- SOAPElement soapElement = factory.createElement(localName, prefix, nsURI);
-
- // Add the child elements as well
- if (deep)
- {
- if (domNode instanceof Element)
- DOMUtils.copyAttributes(soapElement, (Element)domNode);
-
- NodeList nlist = domNode.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- Node child = nlist.item(i);
- short nodeType = child.getNodeType();
- if (nodeType == Node.ELEMENT_NODE)
- {
- SOAPElement soapChild = createElement((Element)child, true);
- soapElement.addChildElement(soapChild);
- }
- else if (nodeType == Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else if (nodeType == Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapElement.addTextNode(nodeValue);
- }
- else
- {
- log.trace("Ignore child type: " + nodeType);
- }
- }
- }
-
- return soapElement;
- }
}
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/SOAPFaultHelperJAXWS.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -489,7 +489,7 @@
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
Element domElement = DOMUtils.parse(xmlFragment);
- return soapFactory.createElement(domElement, true);
+ return soapFactory.createElement(domElement);
}
catch (BindingException e)
{
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -111,7 +111,7 @@
// Associate current message with message context
MessageFactoryImpl factory = new MessageFactoryImpl();
- factory.setEnvelopeURI(Constants.NS_SOAP11_ENV);
+ factory.setEnvNamespace(Constants.NS_SOAP11_ENV);
SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage();
msgContext.setMessage(resMessage);
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/DetailEntryImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -24,6 +24,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.DetailEntry;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
/**
* The content for a Detail object, giving details for a SOAPFault object.
@@ -44,8 +45,8 @@
super(qname);
}
- public DetailEntryImpl(SOAPElementImpl soapElement)
+ public DetailEntryImpl(SOAPElement soapElement)
{
- super(soapElement);
+ super((SOAPElementImpl)soapElement);
}
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -64,7 +64,6 @@
}
String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
// Construct the envelope
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
Modified: trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -57,8 +57,8 @@
{
private static Logger log = Logger.getLogger(MessageFactoryImpl.class);
- // The envelope URI used by the MessageFactory
- private String envelopeURI;
+ // The envelope namespace used by the MessageFactory
+ private String envNamespace;
// The JAXWS ServiceMode
private Mode serviceMode;
@@ -67,31 +67,31 @@
public MessageFactoryImpl()
{
- envelopeURI = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
}
public MessageFactoryImpl(String protocol)
{
if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
- envelopeURI = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
else
- envelopeURI = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
}
/**
* Get the SOAP envelope URI this factory will use when creating envelopes.
*/
- public String getEnvelopeURI()
+ public String getEnvNamespace()
{
- return envelopeURI;
+ return envNamespace;
}
/**
* Set the SOAP envelope URI this factory will use when creating envelopes.
*/
- public void setEnvelopeURI(String envelopeURI)
+ public void setEnvNamespace(String envelopeURI)
{
- this.envelopeURI = envelopeURI;
+ this.envNamespace = envelopeURI;
}
/**
@@ -146,7 +146,7 @@
{
SOAPMessageImpl soapMessage = new SOAPMessageImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- new SOAPEnvelopeImpl(soapPart, envelopeURI);
+ new SOAPEnvelopeImpl(soapPart, envNamespace);
return soapMessage;
}
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/NodeImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -219,7 +219,7 @@
{
case Node.ELEMENT_NODE:
{
- SOAPElementImpl soapChild = soapFactory.createElement((Element)node, true);
+ SOAPElementImpl soapChild = (SOAPElementImpl)soapFactory.createElement((Element)node);
list.add(soapChild);
break;
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderDOM.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -130,7 +130,7 @@
// Process a <env:Fault> message
if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
{
- SOAPFaultImpl soapFault = new SOAPFaultImpl(envNS);
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
soapBody.addChildElement(soapFault);
DOMUtils.copyAttributes(soapFault, domBodyElement);
@@ -165,7 +165,7 @@
while (it.hasNext())
{
Element domElement = (Element)it.next();
- SOAPElement detailEntry = new DetailEntryImpl(soapFactory.createElement(domElement, true));
+ SOAPElement detailEntry = new DetailEntryImpl(soapFactory.createElement(domElement));
detailEntry = detail.addChildElement(detailEntry);
}
}
@@ -224,7 +224,7 @@
short childType = child.getNodeType();
if (childType == org.w3c.dom.Node.ELEMENT_NODE)
{
- SOAPElement soapElement = soapFactory.createElement((Element)child, true);
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
soapBodyElement.addChildElement(soapElement);
}
else if (childType == org.w3c.dom.Node.TEXT_NODE)
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJPayloadBuilderStax.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -313,7 +313,7 @@
if (atPartMargin())
{
SOAPBody soapBody = soapEnv.getBody();
- SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getNamespaceURI());
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getPrefix(), soapEnv.getNamespaceURI());
soapBody.addChildElement(soapFault);
destElement = soapFault;
previousPart = Part.FAULT;
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -136,14 +136,14 @@
SOAPBodyElement child = new SOAPBodyElementDoc(qname);
return (SOAPBodyElement)addChildElement(child);
}
-
+
public SOAPBodyElement addDocument(Document doc) throws SOAPException
{
log.trace("addDocument");
expandToDOM();
Element rootElement = doc.getDocumentElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = soapFactory.createElement(rootElement, true);
+ SOAPElement soapElement = soapFactory.createElement(rootElement);
return (SOAPBodyElement)addChildElement(soapElement);
}
@@ -164,7 +164,7 @@
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
@@ -178,7 +178,7 @@
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault = (SOAPFaultImpl)addChildElement(soapFault);
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString);
@@ -192,7 +192,7 @@
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
@@ -206,7 +206,7 @@
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
- SOAPFaultImpl soapFault = new SOAPFaultImpl(getNamespaceURI());
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(getPrefix(), getNamespaceURI());
soapFault.setFaultCode(faultCode);
soapFault.setFaultString(faultString, locale);
addChildElement(soapFault);
@@ -336,7 +336,7 @@
{
Element child = getBodyElementFromSource();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
- addChildElement(soapFactory.createElement(child, true));
+ addChildElement(soapFactory.createElement(child));
payload = null;
}
catch (RuntimeException rte)
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -869,7 +869,7 @@
short childType = child.getNodeType();
if (childType == Node.ELEMENT_NODE)
{
- SOAPElementImpl soapElement = soapFactory.createElement((Element)child, true);
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
super.addChildElement(soapElement);
if (Constants.NAME_XOP_INCLUDE.equals(name) || isXOPParameter())
XOPContext.inlineXOPData(soapElement);
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -51,13 +51,12 @@
{
// Reference the enclosing SOAPPart, so that getOwnerDocument() works correctly
private SOAPPartImpl soapPart;
- private boolean domExpansionEnabled = false;
/** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
*/
- public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElementImpl element) throws SOAPException
+ public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element) throws SOAPException
{
- super(element);
+ super((SOAPElementImpl)element);
this.soapPart = soapPart;
soapPart.setEnvelope(this);
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -26,14 +26,17 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPConstants;
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.jboss.logging.Logger;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
/**
* SOAPFactory implementation.
@@ -42,49 +45,120 @@
*/
public class SOAPFactoryImpl extends SOAPFactory
{
+ // provide logging
+ private static Logger log = Logger.getLogger(SOAPFactoryImpl.class);
+
+ // The envelope namespace used by the MessageFactory
+ private String envNamespace;
+
public SOAPFactoryImpl()
{
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
}
public SOAPFactoryImpl(String protocol)
{
+ if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
+ else
+ envNamespace = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
}
+ @Override
public SOAPElement createElement(Name name) throws SOAPException
{
return new SOAPElementImpl(name);
}
+
+ @Override
+ public SOAPElement createElement(QName qname) throws SOAPException
+ {
+ return createElement(new NameImpl(qname));
+ }
+ @Override
public SOAPElement createElement(String localName) throws SOAPException
{
return new SOAPElementImpl(localName);
}
+ @Override
public SOAPElement createElement(String localName, String prefix, String uri) throws SOAPException
{
return new SOAPElementImpl(localName, prefix, uri);
}
+ @Override
+ public SOAPElement createElement(Element domElement) throws SOAPException
+ {
+ return createElement(domElement, true);
+ }
+
/**
* Create a SOAPElement from a DOM Element.
* This method is not part of the javax.xml.soap.SOAPFactory interface.
*/
- public SOAPElementImpl createElement(Element domNode, boolean deep) throws SOAPException
+ public SOAPElement createElement(Element domElement, boolean deep) throws SOAPException
{
- SOAPElementDeserializer des = new SOAPElementDeserializer();
- return (SOAPElementImpl)des.createElement(domNode, deep);
+ if (domElement == null)
+ throw new IllegalArgumentException("Source node cannot be null");
+
+ String localName = domElement.getLocalName();
+ String prefix = domElement.getPrefix() != null ? domElement.getPrefix() : "";
+ String nsURI = domElement.getNamespaceURI() != null ? domElement.getNamespaceURI() : "";
+
+ SOAPFactory factory = SOAPFactory.newInstance();
+ SOAPElement soapElement = factory.createElement(localName, prefix, nsURI);
+
+ if (domElement instanceof Element)
+ DOMUtils.copyAttributes(soapElement, (Element)domElement);
+
+ if (deep)
+ {
+ // Add the child elements as well
+ NodeList nlist = domElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short nodeType = child.getNodeType();
+ if (nodeType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapChild = createElement((Element)child);
+ soapElement.addChildElement(soapChild);
+ }
+ else if (nodeType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else if (nodeType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.trace("Ignore child type: " + nodeType);
+ }
+ }
+ }
+
+ return soapElement;
}
+ @Override
public Detail createDetail() throws SOAPException
{
return new DetailImpl();
}
+ @Override
public Name createName(String localName, String prefix, String uri) throws SOAPException
{
return new NameImpl(localName, prefix, uri);
}
+ @Override
public Name createName(String localName) throws SOAPException
{
return new NameImpl(localName);
@@ -93,14 +167,15 @@
@Override
public SOAPFault createFault(String reasonText, QName faultCode) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
+ soapFault.setFaultCode(new NameImpl(faultCode));
+ soapFault.setFaultString(reasonText);
+ return soapFault;
}
@Override
public SOAPFault createFault() throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ return new SOAPFaultImpl(SOAPConstants.SOAP_ENV_PREFIX, envNamespace);
}
}
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFaultImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -28,6 +28,7 @@
import javax.xml.namespace.QName;
import javax.xml.soap.Detail;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFault;
@@ -67,9 +68,14 @@
private SOAPElement faultactor;
private Locale faultStringLocale;
- public SOAPFaultImpl(String namespaceURI) throws SOAPException
+ public SOAPFaultImpl() throws SOAPException
{
- super(new NameImpl("Fault", Constants.PREFIX_ENV, namespaceURI));
+ this(SOAPConstants.SOAP_ENV_PREFIX, SOAPConstants.URI_NS_SOAP_ENVELOPE);
+ }
+
+ public SOAPFaultImpl(String prefix, String namespace) throws SOAPException
+ {
+ super(new NameImpl("Fault", prefix, namespace));
SOAPFactoryImpl factory = new SOAPFactoryImpl();
addChildElement(faultcode = factory.createElement("faultcode"));
addChildElement(faultstring = factory.createElement("faultstring"));
@@ -113,7 +119,7 @@
while (childIt.hasNext())
{
Element domElement = (Element)childIt.next();
- SOAPElement detailEntry = new DetailEntryImpl(factory.createElement(domElement, true));
+ SOAPElement detailEntry = new DetailEntryImpl(factory.createElement(domElement));
detail.addChildElement(detailEntry);
}
}
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-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -184,7 +184,7 @@
}
SOAPFactoryImpl factory = new SOAPFactoryImpl();
- SOAPElementImpl soapElement = factory.createElement(domElement, true);
+ SOAPElement soapElement = factory.createElement(domElement);
SOAPBody body = soapEnvelope.getBody();
body.removeContents();
Modified: trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/extensions/addressing/soap/SOAPAddressingPropertiesImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -211,7 +211,7 @@
{
EndpointReferenceImpl epr = (EndpointReferenceImpl)getFrom();
epr.setRootQName(ADDR.getFromQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
+ SOAPElement soapElement = factory.createElement(epr.toElement());
soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
soapHeader.addChildElement(soapElement);
}
@@ -221,7 +221,7 @@
{
EndpointReferenceImpl epr = (EndpointReferenceImpl)getReplyTo();
epr.setRootQName(ADDR.getReplyToQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
+ SOAPElement soapElement = factory.createElement(epr.toElement());
soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
soapHeader.addChildElement(soapElement);
}
@@ -231,7 +231,7 @@
{
EndpointReferenceImpl epr = (EndpointReferenceImpl)getFaultTo();
epr.setRootQName(ADDR.getFaultToQName());
- SOAPElement soapElement = factory.createElement(epr.toElement(), true);
+ SOAPElement soapElement = factory.createElement(epr.toElement());
soapElement.removeNamespaceDeclaration(ADDR.getNamespacePrefix());
soapHeader.addChildElement(soapElement);
}
@@ -302,13 +302,13 @@
{
if (obj instanceof Element)
{
- SOAPElementImpl child = factory.createElement((Element)obj, true);
+ SOAPElement child = factory.createElement((Element)obj);
soapElement.addChildElement(child);
}
else if (obj instanceof String)
{
Element el = DOMUtils.parse((String)obj);
- SOAPElementImpl child = factory.createElement(el, true);
+ SOAPElement child = factory.createElement(el);
soapElement.addChildElement(child);
}
else
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -133,7 +133,7 @@
if (prefix.length() > 0)
{
buffer.append(" xmlns:" + prefix + "='" + namespaceURI + "'");
- if (Constants.PREFIX_SOAP11.equals(prefix) || Constants.PREFIX_SOAP12.equals(prefix))
+ if (Constants.PREFIX_SOAP11.equals(prefix))
soapPrefix = prefix;
}
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-14 13:42:11 UTC (rev 1647)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/exception/ExceptionEndpointImpl.java 2006-12-14 14:18:16 UTC (rev 1648)
@@ -44,7 +44,7 @@
try
{
- SOAPFault fault = new SOAPFaultImpl("http://foo");
+ SOAPFault fault = new SOAPFaultImpl();
fault.setFaultCode(new NameImpl(new QName("http://foo", "FooCode")));
fault.setFaultString("this is a fault string!");
fault.setFaultActor("mr.actor");
19 years, 4 months
JBossWS SVN: r1647 - branches/dlofthouse/JBWS-1428/src/main/java/org/jboss/ws/tools/schema
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-14 08:42:11 -0500 (Thu, 14 Dec 2006)
New Revision: 1647
Modified:
branches/dlofthouse/JBWS-1428/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
Log:
JBWS-1428 - Modified to check if there is non-indexed property available when an IndexedPropertyDescriptor is found.
Modified: branches/dlofthouse/JBWS-1428/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
--- branches/dlofthouse/JBWS-1428/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-14 12:31:13 UTC (rev 1646)
+++ branches/dlofthouse/JBWS-1428/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2006-12-14 13:42:11 UTC (rev 1647)
@@ -579,9 +579,9 @@
String fieldname = prop.getName();
Class fieldType = prop.getPropertyType();
- if (prop instanceof IndexedPropertyDescriptor)
+ if (prop instanceof IndexedPropertyDescriptor && fieldType==null)
{
- log.warn("Indexed Properties are not supported skipping: " + javaType.getName() + "." + fieldname);
+ log.warn("Indexed Properties without non-indexed accessors are not supported skipping: " + javaType.getName() + "." + fieldname);
continue;
}
19 years, 4 months
JBossWS SVN: r1646 - in trunk/src/main/java/org/jboss/ws/metadata: builder/jaxws config umdm
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 07:31:13 -0500 (Thu, 14 Dec 2006)
New Revision: 1646
Modified:
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/config/JBossWSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
Log:
cleanup config parsing routines
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-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -44,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) throws IOException;
+ public abstract ServerEndpointMetaData buildEndpointMetaData(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-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -67,7 +67,7 @@
*/
@Override
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
+ public ServerEndpointMetaData buildEndpointMetaData(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.
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-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -56,6 +56,6 @@
{
JAXWSEndpointMetaDataBuilder builder = getEndpointBuilder(beanClass);
if (builder != null)
- builder.buildEndpoint(umd, udi, beanClass, beanName);
+ builder.buildEndpointMetaData(umd, udi, beanClass, beanName);
}
}
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-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -966,7 +966,7 @@
jaxbCtx = null;
}
- public ServerEndpointMetaData buildEndpoint(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
+ public ServerEndpointMetaData buildEndpointMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
{
try
{
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2006-12-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -36,7 +36,7 @@
import java.io.IOException;
import java.net.URL;
-/**
+/**
* A factory for the JBossWS endpoint/client configuration
*
* @author Thomas.Diesler(a)jboss.org
@@ -46,7 +46,7 @@
{
// provide logging
private final Logger log = Logger.getLogger(JBossWSConfigFactory.class);
-
+
private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
@@ -62,27 +62,39 @@
return new JBossWSConfigFactory();
}
- public Object parse(URL configURL) throws IOException, JBossXBException
+ public Object parse(URL configURL)
{
log.debug("parse: " + configURL);
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
-
Object wsConfig;
- String nsURI = getNamespaceURI(configURL);
- if (URN_JAXRPC_CONFIG.equals(nsURI))
+ try
{
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXRPC(), null);
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+
+ String nsURI = getNamespaceURI(configURL);
+ if (URN_JAXRPC_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXRPC(), null);
+ }
+ else if (URN_JAXWS_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXWS(), null);
+ }
+ else
+ {
+ throw new WSException("Invalid config namespace: " + nsURI);
+ }
+
}
- else if (URN_JAXWS_CONFIG.equals(nsURI))
+ catch (JBossXBException e)
{
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXWS(), null);
+ throw new WSException("Error while parsing configuration", e);
}
- else
- {
- throw new WSException("Invalid config namespace: " + nsURI);
+ catch (IOException e) {
+ throw new WSException("Failed to read config file: " + configURL, e);
}
return wsConfig;
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -69,81 +69,81 @@
if (endpointConfig == null)
{
String configName = getConfigName();
- if (configName == null)
- {
- configName = "Standard Client";
- setConfigName(configName);
- }
-
String configFile = getConfigFile();
- if (configFile == null)
- {
- if (getType() == Type.JAXRPC)
- {
- configFile = "META-INF/standard-jaxrpc-client-config.xml";
- }
- else
- {
- configFile = "META-INF/standard-jaxws-client-config.xml";
- }
- setConfigFile(configFile);
- }
log.debug("getClientConfig: [name=" + configName + ",url=" + configFile + "]");
- URL configURL = null;
- try
- {
- configURL = new URL(configFile);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try to get the URL as resource
- if (configURL == null)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- configURL = cl.getResource(configFile);
- if (configURL == null)
- throw new WSException("Cannot get resource: " + configFile);
- }
-
// Get the config root
- Object wsConfig;
- try
- {
- JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- wsConfig = factory.parse(configURL);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot parse client config", ex);
- }
+ URL configURL = filenameToURL(configFile);
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ Object wsConfig = factory.parse(configURL);
// Get the client config
if (wsConfig instanceof ConfigRootJAXRPC)
{
endpointConfig = ((ConfigRootJAXRPC)wsConfig).getClientConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain client config: " + configName);
}
else
{
endpointConfig = ((ConfigRootJAXWS)wsConfig).getClientConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain client config: " + configName);
}
+
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain client config: " + configName);
}
return endpointConfig;
}
+ public String getConfigName() {
+ String configName = super.getConfigName();
+ if (configName == null)
+ {
+ configName = "Standard Client";
+ setConfigName(configName);
+ }
+ return configName;
+ }
+
+ public String getConfigFile() {
+ String configFile = super.getConfigFile();
+ if (configFile == null)
+ {
+ if (getType() == Type.JAXRPC)
+ {
+ configFile = "META-INF/standard-jaxrpc-client-config.xml";
+ }
+ else
+ {
+ configFile = "META-INF/standard-jaxws-client-config.xml";
+ }
+ setConfigFile(configFile);
+ }
+ return configFile;
+ }
+
+ private URL filenameToURL(String configFile) {
+ URL configURL = null;
+ try
+ {
+ configURL = new URL(configFile);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try to get the URL as resource
+ if (configURL == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ configURL = cl.getResource(configFile);
+ if (configURL == null)
+ throw new WSException("Cannot get resource: " + configFile);
+ }
+ return configURL;
+ }
+
public String toString()
{
StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
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-14 12:31:04 UTC (rev 1645)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14 12:31:13 UTC (rev 1646)
@@ -137,7 +137,7 @@
{
if (contextRoot != null && contextRoot.startsWith("/") == false)
throw new IllegalArgumentException("context root should start with '/'");
-
+
this.contextRoot = contextRoot;
}
@@ -150,7 +150,7 @@
{
this.virtualHosts = virtualHosts;
}
-
+
public String getURLPattern()
{
return urlPattern;
@@ -160,7 +160,7 @@
{
if (urlPattern != null && urlPattern.startsWith("/") == false)
throw new IllegalArgumentException("url pattern should start with '/'");
-
+
this.urlPattern = urlPattern;
}
@@ -190,80 +190,81 @@
if (endpointConfig == null)
{
String configName = getConfigName();
- if (configName == null)
- {
- configName = "Standard Endpoint";
- setConfigName(configName);
- }
-
String configFile = getConfigFile();
- if (configFile == null)
- {
- if (getType() == Type.JAXRPC)
- {
- configFile = "META-INF/standard-jaxrpc-endpoint-config.xml";
- }
- else
- {
- configFile = "META-INF/standard-jaxws-endpoint-config.xml";
- }
- setConfigFile(configFile);
- }
log.debug("getEndpointConfig: [name=" + configName + ",url=" + configFile + "]");
- URL configURL = null;
- try
- {
- configURL = new URL(configFile);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try to get the URL as resource
- if (configURL == null)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- configURL = cl.getResource(configFile);
- if (configURL == null)
- throw new WSException("Cannot get resource: " + configFile);
- }
-
// Get the config root
- Object wsConfig;
- try
- {
- JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
- wsConfig = factory.parse(configURL);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot parse client config", ex);
- }
+ URL configURL = filenameToURL(configFile);
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ Object wsConfig = factory.parse(configURL);
// Get the endpoint config
if (wsConfig instanceof ConfigRootJAXRPC)
{
endpointConfig = ((ConfigRootJAXRPC)wsConfig).getEndpointConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain endpoint config: " + configName);
}
else
{
endpointConfig = ((ConfigRootJAXWS)wsConfig).getEndpointConfigByName(configName);
- if (endpointConfig == null)
- throw new WSException("Cannot obtain endpoint config: " + configName);
}
+
+ if (endpointConfig == null)
+ throw new WSException("Cannot obtain endpoint config: " + configName);
}
+
return endpointConfig;
}
+ public String getConfigName() {
+ String configName = super.getConfigName();
+ if (configName == null)
+ {
+ configName = "Standard Endpoint";
+ setConfigName(configName);
+ }
+ return configName;
+ }
+
+ public String getConfigFile() {
+ String configFile = super.getConfigFile();
+ if (configFile == null)
+ {
+ if (getType() == Type.JAXRPC)
+ {
+ configFile = "META-INF/standard-jaxrpc-endpoint-config.xml";
+ }
+ else
+ {
+ configFile = "META-INF/standard-jaxws-endpoint-config.xml";
+ }
+ setConfigFile(configFile);
+ }
+ return configFile;
+ }
+
+ private URL filenameToURL(String configFile) {
+ URL configURL = null;
+ try
+ {
+ configURL = new URL(configFile);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try to get the URL as resource
+ if (configURL == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ configURL = cl.getResource(configFile);
+ if (configURL == null)
+ throw new WSException("Cannot get resource: " + configFile);
+ }
+ return configURL;
+ }
+
public String toString()
{
StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:");
19 years, 4 months
JBossWS SVN: r1645 - in trunk: . src/main/java/javax/xml/soap src/main/java/org/jboss/ws/core/soap src/main/resources src/main/resources/jboss-saaj.jar src/main/resources/jboss-saaj.jar/META-INF src/main/resources/jboss-saaj.jar/META-INF/services
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-14 07:31:04 -0500 (Thu, 14 Dec 2006)
New Revision: 1645
Added:
trunk/src/main/java/javax/xml/soap/FactoryLoader.java
trunk/src/main/java/org/jboss/ws/core/soap/SAAJMetaFactoryImpl.java
trunk/src/main/resources/jboss-saaj.jar/
trunk/src/main/resources/jboss-saaj.jar/META-INF/
trunk/src/main/resources/jboss-saaj.jar/META-INF/services/
trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MessageFactory
trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MetaFactory
trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.SOAPFactory
Modified:
trunk/build.xml
trunk/src/main/java/javax/xml/soap/MessageFactory.java
trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java
trunk/src/main/java/javax/xml/soap/SOAPConstants.java
trunk/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
Log:
Implement SAAJ-1.3 factory lookup
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/build.xml 2006-12-14 12:31:04 UTC (rev 1645)
@@ -220,6 +220,7 @@
<fileset dir="${build.classes14.dir}">
<include name="javax/xml/soap/**"/>
</fileset>
+ <metainf dir="${build.resources.dir}/jboss-saaj.jar/META-INF"/>
</jar>
<!-- Build jboss-jaxws.jar -->
Added: trunk/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -0,0 +1,197 @@
+/*
+ * 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 java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Properties;
+
+import org.jboss.logging.Logger;
+
+// $Id$
+
+/**
+ * Load a factory using the factory lookup procedure
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 14-Dec-2006
+ */
+class FactoryLoader
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(MessageFactory.class);
+
+ private FactoryLoader()
+ {
+ }
+
+ /**
+ * Load a factory using this ordered lookup procedure
+ *
+ * 1. Use the system property
+ * 2. Use the properties file "lib/jaxm.properties" in the JRE directory
+ * 3. Use the Services API (as detailed in the JAR specification), if available, to determine the classname
+ * 4. Use the default factory implementation class
+ *
+ * @return the factory impl, or null
+ */
+ static Object loadFactory(String propertyName, String defaultFactory) throws SOAPException
+ {
+ Object factory = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ // Use the system property
+ PrivilegedAction action = new PropertyAccessAction(propertyName);
+ String factoryName = (String)AccessController.doPrivileged(action);
+ if (factoryName != null)
+ {
+ try
+ {
+ log.debug("Load from system property: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ // 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.
+ if (factory == null)
+ {
+ action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxm.properties");
+ if (jaxmFile.exists())
+ {
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(propertyName);
+ if (factoryName != null)
+ {
+ log.debug("Load from " + jaxmFile + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
+ if (factory == null)
+ {
+ String filename = "META-INF/services/" + propertyName;
+ InputStream inStream = loader.getResourceAsStream(filename);
+ if (inStream != null)
+ {
+ try
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
+ factoryName = br.readLine();
+ br.close();
+ if (factoryName != null)
+ {
+ log.debug("Load from Service API " + filename + ": " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+ }
+
+ // Use the default factory implementation class.
+ if (factory == null && defaultFactory != null)
+ {
+ try
+ {
+ factoryName = defaultFactory;
+ log.debug("Load from default: " + factoryName);
+ Class factoryClass = loader.loadClass(factoryName);
+ factory = factoryClass.newInstance();
+ }
+ catch (Throwable t)
+ {
+ throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ }
+ }
+
+ return factory;
+ }
+
+ private static class PropertyAccessAction implements PrivilegedAction
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ try
+ {
+ InputStream inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ }
+ }
+}
Property changes on: trunk/src/main/java/javax/xml/soap/FactoryLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -23,12 +23,7 @@
import java.io.IOException;
import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
/**
A factory for creating SOAPMessage objects.
@@ -58,37 +53,33 @@
*/
public abstract class MessageFactory
{
- // provide logging
- private static Logger log = Logger.getLogger(MessageFactory.class);
-
- private static final String DEFAULT_MESSAGE_FACTORY = "org.jboss.ws.core.soap.MessageFactoryImpl";
-
+
/**
* 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.
+ * Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
+ * @throws SOAPException if there was an error in creating the default implementation of the MessageFactory.
*/
public static MessageFactory newInstance() throws SOAPException
{
- PrivilegedAction action = new PropertyAccessAction(MessageFactory.class.getName(), DEFAULT_MESSAGE_FACTORY);
- String factoryName = (String)AccessController.doPrivileged(action);
+ String propertyName = "javax.xml.soap.MessageFactory";
+ MessageFactory factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
- //TODO: SAAJ 1.3 (implement the lookup)
-
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
+ // Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
+ if (factory == null)
{
- Class factoryClass = loader.loadClass(factoryName);
- return (MessageFactory)factoryClass.newInstance();
+ SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
+ factory = saajFactory.newMessageFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
}
- catch (Throwable t)
- {
- throw new SOAPException("Failed to create MessageFactory: " + factoryName, t);
- }
+
+ if (factory == null)
+ throw new SOAPException("Failed to to determine the MessageFactory implementation class");
+
+ return factory;
}
/**
@@ -104,8 +95,13 @@
*/
public static MessageFactory newInstance(String protocol) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
+ MessageFactory factory = saajFactory.newMessageFactory(protocol);
+
+ if (factory == null)
+ throw new SOAPException("Failed to to determine the MessageFactory implementation class");
+
+ return factory;
}
/**
@@ -131,21 +127,4 @@
* @throws SOAPException if the message is invalid
*/
public abstract SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws IOException, SOAPException;
-
- private static class PropertyAccessAction implements PrivilegedAction
- {
- private String name;
- private String defaultValue;
-
- PropertyAccessAction(String name, String defaultValue)
- {
- this.name = name;
- this.defaultValue = defaultValue;
- }
-
- public Object run()
- {
- return System.getProperty(name, defaultValue);
- }
- }
}
Modified: trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/javax/xml/soap/SAAJMetaFactory.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -21,7 +21,7 @@
*/
package javax.xml.soap;
-import org.jboss.util.NotImplementedException;
+import java.security.PrivilegedAction;
// $Id$
@@ -57,8 +57,14 @@
*/
static SAAJMetaFactory getInstance() throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ String propertyName = "javax.xml.soap.MetaFactory";
+ String defaultImpl = "com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl";
+ SAAJMetaFactory factory = (SAAJMetaFactory)FactoryLoader.loadFactory(propertyName, defaultImpl);
+
+ if (factory == null)
+ throw new SOAPException("Failed to to determine the implementation class for: " + propertyName);
+
+ return factory;
}
/**
Modified: trunk/src/main/java/javax/xml/soap/SOAPConstants.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPConstants.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/javax/xml/soap/SOAPConstants.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -53,7 +53,7 @@
/** 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/";
+ String URI_NS_SOAP_ENVELOPE = URI_NS_SOAP_1_1_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. */
Modified: trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -23,7 +23,6 @@
// $Id$
-import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.xml.namespace.QName;
@@ -43,8 +42,6 @@
*/
public abstract class SOAPFactory
{
- private static final String DEFAULT_SOAP_FACTORY = "org.jboss.ws.core.soap.SOAPFactoryImpl";
-
/**
* 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:
@@ -59,21 +56,20 @@
*/
public static SOAPFactory newInstance() throws SOAPException
{
- PrivilegedAction action = new PropertyAccessAction(SOAPFactory.class.getName(), DEFAULT_SOAP_FACTORY);
- String factoryName = (String)AccessController.doPrivileged(action);
-
- //TODO: SAAJ 1.3 (implement the lookup)
+ String propertyName = "javax.xml.soap.SOAPFactory";
+ SOAPFactory factory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
+ // Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
+ if (factory == null)
{
- Class factoryClass = loader.loadClass(factoryName);
- return (SOAPFactory)factoryClass.newInstance();
+ SAAJMetaFactory saajFactory = SAAJMetaFactory.getInstance();
+ factory = saajFactory.newSOAPFactory(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
}
- catch (Throwable t)
- {
- throw new SOAPException("Failed to create SOAPFactory: " + factoryName, t);
- }
+
+ if (factory == null)
+ throw new SOAPException("Failed to to determine the SOAPFactory implementation class");
+
+ return factory;
}
Modified: trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -36,12 +36,12 @@
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Service.Mode;
import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.attachment.MimeConstants;
@@ -58,13 +58,26 @@
private static Logger log = Logger.getLogger(MessageFactoryImpl.class);
// The envelope URI used by the MessageFactory
- private String envelopeURI = Constants.NS_SOAP11_ENV;
+ private String envelopeURI;
// The JAXWS ServiceMode
private Mode serviceMode;
// The style used by this MessageFactory
private Style style;
+ public MessageFactoryImpl()
+ {
+ envelopeURI = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
+ }
+
+ public MessageFactoryImpl(String protocol)
+ {
+ if (SOAPConstants.SOAP_1_2_PROTOCOL.equals(protocol))
+ envelopeURI = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
+ else
+ envelopeURI = SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE;
+ }
+
/**
* Get the SOAP envelope URI this factory will use when creating envelopes.
*/
Added: trunk/src/main/java/org/jboss/ws/core/soap/SAAJMetaFactoryImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SAAJMetaFactoryImpl.java 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SAAJMetaFactoryImpl.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap;
+
+// $Id$
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SAAJMetaFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+
+/**
+ * MessageFactory implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ */
+public class SAAJMetaFactoryImpl extends SAAJMetaFactory
+{
+ @Override
+ protected MessageFactory newMessageFactory(String protocol) throws SOAPException
+ {
+ return new MessageFactoryImpl(protocol);
+ }
+
+ @Override
+ protected SOAPFactory newSOAPFactory(String protocol) throws SOAPException
+ {
+ return new SOAPFactoryImpl(protocol);
+ }
+
+}
Property changes on: trunk/src/main/java/org/jboss/ws/core/soap/SAAJMetaFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
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-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-14 12:31:04 UTC (rev 1645)
@@ -42,6 +42,14 @@
*/
public class SOAPFactoryImpl extends SOAPFactory
{
+ public SOAPFactoryImpl()
+ {
+ }
+
+ public SOAPFactoryImpl(String protocol)
+ {
+ }
+
public SOAPElement createElement(Name name) throws SOAPException
{
return new SOAPElementImpl(name);
Added: trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MessageFactory
===================================================================
--- trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MessageFactory 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MessageFactory 2006-12-14 12:31:04 UTC (rev 1645)
@@ -0,0 +1 @@
+org.jboss.ws.core.soap.MessageFactoryImpl
\ No newline at end of file
Added: trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MetaFactory
===================================================================
--- trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MetaFactory 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.MetaFactory 2006-12-14 12:31:04 UTC (rev 1645)
@@ -0,0 +1 @@
+org.jboss.ws.core.soap.SAAJMetaFactoryImpl
\ No newline at end of file
Added: trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.SOAPFactory
===================================================================
--- trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.SOAPFactory 2006-12-14 12:19:05 UTC (rev 1644)
+++ trunk/src/main/resources/jboss-saaj.jar/META-INF/services/javax.xml.soap.SOAPFactory 2006-12-14 12:31:04 UTC (rev 1645)
@@ -0,0 +1 @@
+org.jboss.ws.core.soap.SOAPFactoryImpl
\ No newline at end of file
19 years, 4 months
JBossWS SVN: r1644 - in branches/dlofthouse/JBWS-1428/src/test: java/org/jboss/test/ws/tools java/org/jboss/test/ws/tools/jbws1428 resources/tools resources/tools/jbws1428
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-14 07:19:05 -0500 (Thu, 14 Dec 2006)
New Revision: 1644
Added:
branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/
branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/JBWS1428TestCase.java
branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObject.java
branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObjectSEI.java
branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/
branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/ValueObjectService.wsdl
branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/jaxrpc-mapping.xml
branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/wstools-config.xml
Log:
JBWS-1428 Test Case
Added: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/JBWS1428TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/JBWS1428TestCase.java 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/JBWS1428TestCase.java 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.tools.jbws1428;
+
+import java.io.FileInputStream;
+
+import org.jboss.test.ws.tools.WSToolsTest;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.tools.WSTools;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 Dec 2006
+ */
+public class JBWS1428TestCase extends WSToolsTest
+{
+
+ public void testGenerate() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1428";
+ String toolsDir = "tools/jbws1428";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ Element exp = DOMUtils.parse(new FileInputStream(resourceDir + "/ValueObjectService.wsdl"));
+ Element was = DOMUtils.parse(new FileInputStream(toolsDir + "/wsdl/ValueObjectService.wsdl"));
+ assertEquals("WSDL Validation", exp, was);
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
+ }
+}
Property changes on: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/JBWS1428TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObject.java
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObject.java 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObject.java 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,66 @@
+/*
+ * 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.tools.jbws1428;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 Dec 2006
+ */
+public class ValueObject
+{
+
+ private String myMessage;
+
+ private String[] myValues;
+
+ public String getMyMessage()
+ {
+ return myMessage;
+ }
+
+ public void setMyMessage(String myMessage)
+ {
+ this.myMessage = myMessage;
+ }
+
+ public String[] getMyValues()
+ {
+ return myValues;
+ }
+
+ public void setMyValues(String[] myValues)
+ {
+ this.myValues = myValues;
+ }
+
+ public String getMyValues(int i)
+ {
+ return myValues[i];
+ }
+
+ public void setMyValues(int i, String myValues)
+ {
+ this.myValues[i] = myValues;
+ }
+
+}
Property changes on: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObjectSEI.java
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObjectSEI.java 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObjectSEI.java 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.tools.jbws1428;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 14 Dec 2006
+ */
+public interface ValueObjectSEI extends Remote
+{
+
+ public ValueObject echo(final ValueObject value) throws RemoteException;
+
+}
Property changes on: branches/dlofthouse/JBWS-1428/src/test/java/org/jboss/test/ws/tools/jbws1428/ValueObjectSEI.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/ValueObjectService.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/ValueObjectService.wsdl 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/ValueObjectService.wsdl 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='ValueObjectService' targetNamespace='http://org.jboss.test.ws/jbws1428' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://org.jboss.test.ws/jbws1428/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1428' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema targetNamespace='http://org.jboss.test.ws/jbws1428/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://org.jboss.test.ws/jbws1428/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='echo'>
+ <sequence>
+ <element name='ValueObject_1' nillable='true' type='tns:ValueObject'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='tns:ValueObject'/>
+ </sequence>
+ </complexType>
+ <complexType name='ValueObject'>
+ <sequence>
+ <element name='myMessage' nillable='true' type='string'/>
+ <element maxOccurs='unbounded' minOccurs='0' name='myValues' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <element name='echo' type='tns:echo'/>
+ <element name='echoResponse' type='tns:echoResponse'/>
+ </schema>
+ </types>
+ <message name='ValueObjectSEI_echo'>
+ <part element='ns1:echo' name='parameters'/>
+ </message>
+ <message name='ValueObjectSEI_echoResponse'>
+ <part element='ns1:echoResponse' name='result'/>
+ </message>
+ <portType name='ValueObjectSEI'>
+ <operation name='echo'>
+ <input message='tns:ValueObjectSEI_echo'/>
+ <output message='tns:ValueObjectSEI_echoResponse'/>
+ </operation>
+ </portType>
+ <binding name='ValueObjectSEIBinding' type='tns:ValueObjectSEI'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='ValueObjectService'>
+ <port binding='tns:ValueObjectSEIBinding' name='ValueObjectSEIPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/ValueObjectService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/jaxrpc-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/jaxrpc-mapping.xml 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/jaxrpc-mapping.xml 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,69 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.tools.jbws1428</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1428/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.tools.jbws1428.ValueObject</java-type>
+ <root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1428/types'>typeNS:ValueObject</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>myMessage</java-variable-name>
+ <xml-element-name>myMessage</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>myValues</java-variable-name>
+ <xml-element-name>myValues</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.tools.jbws1428.ValueObjectSEI_echo_RequestStruct</java-type>
+ <root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1428/types'>typeNS:echo</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>valueObject_1</java-variable-name>
+ <xml-element-name>ValueObject_1</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.tools.jbws1428.ValueObjectSEI_echo_ResponseStruct</java-type>
+ <root-type-qname xmlns:typeNS='http://org.jboss.test.ws/jbws1428/types'>typeNS:echoResponse</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>result</java-variable-name>
+ <xml-element-name>result</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.tools.jbws1428.ValueObjectService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1428'>serviceNS:ValueObjectService</wsdl-service-name>
+ <port-mapping>
+ <port-name>ValueObjectSEIPort</port-name>
+ <java-port-name>ValueObjectSEIPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.tools.jbws1428.ValueObjectSEI</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1428'>portTypeNS:ValueObjectSEI</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1428'>bindingNS:ValueObjectSEIBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>echo</java-method-name>
+ <wsdl-operation>echo</wsdl-operation>
+ <wrapped-element/>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.tools.jbws1428.ValueObject</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1428'>wsdlMsgNS:ValueObjectSEI_echo</wsdl-message>
+ <wsdl-message-part-name>ValueObject_1</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.tools.jbws1428.ValueObject</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1428'>wsdlMsgNS:ValueObjectSEI_echoResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/wstools-config.xml 2006-12-14 11:57:37 UTC (rev 1643)
+++ branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/wstools-config.xml 2006-12-14 12:19:05 UTC (rev 1644)
@@ -0,0 +1,13 @@
+<configuration xmlns="http://www.jboss.org/jbossws-tools"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+
+ <java-wsdl>
+ <service name="ValueObjectService"
+ endpoint="org.jboss.test.ws.tools.jbws1428.ValueObjectSEI" style="document" />
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1428"
+ type-namespace="http://org.jboss.test.ws/jbws1428/types" />
+ <mapping file="jaxrpc-mapping.xml" />
+ </java-wsdl>
+
+</configuration>
\ No newline at end of file
Property changes on: branches/dlofthouse/JBWS-1428/src/test/resources/tools/jbws1428/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years, 4 months
JBossWS SVN: r1643 - in trunk/src: main/java/org/jboss/ws/integration/jboss50 main/java/org/jboss/ws/metadata/builder/jaxrpc main/java/org/jboss/ws/metadata/builder/jaxws main/java/org/jboss/ws/metadata/config main/java/org/jboss/ws/metadata/config/binding main/java/org/jboss/ws/metadata/config/jaxrpc main/java/org/jboss/ws/metadata/config/jaxws main/java/org/jboss/ws/metadata/umdm test/java/org/jboss/test/ws/common/config
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 06:57:37 -0500 (Thu, 14 Dec 2006)
New Revision: 1643
Added:
trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java
trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/config/binding/
trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ClientConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ConfigRootJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/EndpointConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ClientConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ConfigRootJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/EndpointConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/HandlerChainsConfigJAXWS.java
trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
Removed:
trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.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/JAXWSClientEndpointMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
Log:
Cleanup config package
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -31,7 +31,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.server.AbstractServiceEndpointServlet;
import org.jboss.ws.core.server.ServiceEndpoint;
-import org.jboss.ws.metadata.config.WSCommonConfig;
+import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -72,7 +72,7 @@
sepMetaData.clearHandlers();
// Add pre handlers
- WSCommonConfig sepConfig = sepMetaData.getEndpointConfig();
+ CommonConfig sepConfig = sepMetaData.getEndpointConfig();
sepMetaData.addHandlers(sepConfig.getHandlers(sepMetaData, HandlerType.PRE));
// Restore the endpoint handlers
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-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -32,7 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.config.jaxrpc.WSClientConfigJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.ClientConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
@@ -219,7 +219,7 @@
private void setupHandlers(UnifiedServiceRefMetaData serviceRefMetaData, QName portName, EndpointMetaData epMetaData)
{
// Add pre handlers
- WSClientConfigJAXRPC jaxrpcConfig = (WSClientConfigJAXRPC)epMetaData.getEndpointConfig();
+ ClientConfigJAXRPC jaxrpcConfig = (ClientConfigJAXRPC)epMetaData.getEndpointConfig();
epMetaData.addHandlers(jaxrpcConfig.getHandlers(epMetaData, HandlerType.PRE));
// Setup the endpoint handlers
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-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -30,7 +30,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
@@ -221,7 +221,7 @@
setupOperationsFromWSDL(sepMetaData, wsdlEndpoint, seiMapping);
// Add pre handlers
- WSEndpointConfigJAXRPC jaxrpcConfig = (WSEndpointConfigJAXRPC)sepMetaData.getEndpointConfig();
+ EndpointConfigJAXRPC jaxrpcConfig = (EndpointConfigJAXRPC)sepMetaData.getEndpointConfig();
sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.PRE));
// Setup the endpoint handlers
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -27,7 +27,7 @@
import javax.xml.ws.BindingType;
import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.config.jaxws.WSClientConfigJAXWS;
+import org.jboss.ws.metadata.config.jaxws.ClientConfigJAXWS;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -64,7 +64,7 @@
epMetaData.clearHandlers();
// Add pre handlers
- WSClientConfigJAXWS jaxwsConfig = (WSClientConfigJAXWS)epMetaData.getEndpointConfig();
+ ClientConfigJAXWS jaxwsConfig = (ClientConfigJAXWS)epMetaData.getEndpointConfig();
epMetaData.addHandlers(jaxwsConfig.getHandlers(epMetaData, HandlerType.PRE));
// Process an optional @HandlerChain annotation
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-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -74,7 +74,7 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
+import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
@@ -1028,7 +1028,7 @@
log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
// Add pre handlers
- WSEndpointConfigJAXWS jaxrpcConfig = (WSEndpointConfigJAXWS)sepMetaData.getEndpointConfig();
+ EndpointConfigJAXWS jaxrpcConfig = (EndpointConfigJAXWS)sepMetaData.getEndpointConfig();
sepMetaData.addHandlers(jaxrpcConfig.getHandlers(sepMetaData, HandlerType.PRE));
// Process an optional @HandlerChain annotation
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,115 @@
+/*
+ * 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.metadata.config;
+
+//$Id$
+
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A common configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class CommonConfig
+{
+ private String configName;
+ private List<URI> features = new ArrayList<URI>();
+ private List<EndpointProperty> properties = new ArrayList<EndpointProperty>();
+
+ public String getConfigName()
+ {
+ return configName;
+ }
+
+ public void setConfigName(String configName)
+ {
+ this.configName = configName;
+ }
+
+ public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type);
+
+ public boolean getFeature(URI type) {
+ return features.contains(type);
+ }
+
+ public boolean getFeature(String uri)
+ {
+ return getFeature(nameToURI(uri));
+ }
+
+ public void setFeature(String type, boolean enabled) {
+
+ if(enabled) {
+ features.add(nameToURI(type));
+ }
+ else
+ features.remove(nameToURI(type));
+ }
+
+ public void addProperty(String name, String value)
+ {
+ EndpointProperty p = new EndpointProperty();
+ p.name = nameToURI(name);
+ p.value = value;
+ properties.add(p);
+ }
+
+ public String getProperty(String name)
+ {
+ String value = null;
+ URI uri = nameToURI(name);
+
+ for(EndpointProperty wsp : properties)
+ {
+ if(wsp.name.equals(uri))
+ {
+ value = wsp.value;
+ break;
+ }
+ }
+ return value;
+ }
+
+ public List<EndpointProperty> getProperties() {
+ return properties;
+ }
+
+ private static URI nameToURI(String name)
+ {
+ URI uri = null;
+ try {
+ uri = new URI(name);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ return uri;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/CommonConfig.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/EndpointProperty.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,12 @@
+package org.jboss.ws.metadata.config;
+
+import java.net.URI;
+
+public class EndpointProperty
+{
+ public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
+
+ public URI name;
+ public String value;
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,103 @@
+/*
+ * 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.metadata.config;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.metadata.config.binding.OMFactoryJAXRPC;
+import org.jboss.ws.metadata.config.binding.OMFactoryJAXWS;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * A factory for the JBossWS endpoint/client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class JBossWSConfigFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(JBossWSConfigFactory.class);
+
+ private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
+ private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
+
+ // Hide constructor
+ private JBossWSConfigFactory()
+ {
+ }
+
+ /** Create a new instance of the factory
+ */
+ public static JBossWSConfigFactory newInstance()
+ {
+ return new JBossWSConfigFactory();
+ }
+
+ public Object parse(URL configURL) throws IOException, JBossXBException
+ {
+ log.debug("parse: " + configURL);
+
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+
+ Object wsConfig;
+ String nsURI = getNamespaceURI(configURL);
+ if (URN_JAXRPC_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXRPC(), null);
+ }
+ else if (URN_JAXWS_CONFIG.equals(nsURI))
+ {
+ wsConfig = unmarshaller.unmarshal(configURL.openStream(), new OMFactoryJAXWS(), null);
+ }
+ else
+ {
+ throw new WSException("Invalid config namespace: " + nsURI);
+ }
+
+ return wsConfig;
+ }
+
+ private String getNamespaceURI(URL configURL)
+ {
+ try
+ {
+ Element root = DOMUtils.parse(configURL.openStream());
+ return root.getNamespaceURI();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/JBossWSConfigFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,115 +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.metadata.config;
-
-//$Id$
-
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A common configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfig
-{
- private String configName;
- private List<URI> features = new ArrayList<URI>();
- private List<WSEndpointProperty> properties = new ArrayList<WSEndpointProperty>();
-
- public String getConfigName()
- {
- return configName;
- }
-
- public void setConfigName(String configName)
- {
- this.configName = configName;
- }
-
- public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type);
-
- public boolean getFeature(URI type) {
- return features.contains(type);
- }
-
- public boolean getFeature(String uri)
- {
- return getFeature(nameToURI(uri));
- }
-
- public void setFeature(String type, boolean enabled) {
-
- if(enabled) {
- features.add(nameToURI(type));
- }
- else
- features.remove(nameToURI(type));
- }
-
- public void addProperty(String name, String value)
- {
- WSEndpointProperty p = new WSEndpointProperty();
- p.name = nameToURI(name);
- p.value = value;
- properties.add(p);
- }
-
- public String getProperty(String name)
- {
- String value = null;
- URI uri = nameToURI(name);
-
- for(WSEndpointProperty wsp : properties)
- {
- if(wsp.name.equals(uri))
- {
- value = wsp.value;
- break;
- }
- }
- return value;
- }
-
- public List<WSEndpointProperty> getProperties() {
- return properties;
- }
-
- private static URI nameToURI(String name)
- {
- URI uri = null;
- try {
- uri = new URI(name);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
- return uri;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,103 +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.metadata.config;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
-import org.jboss.ws.metadata.config.jaxws.WSConfigFactoryJAXWS;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.w3c.dom.Element;
-
-import java.io.IOException;
-import java.net.URL;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactory.class);
-
- private static String URN_JAXRPC_CONFIG = "urn:jboss:jaxrpc-config:2.0";
- private static String URN_JAXWS_CONFIG = "urn:jboss:jaxws-config:2.0";
-
- // Hide constructor
- private WSConfigFactory()
- {
- }
-
- /** Create a new instance of the factory
- */
- public static WSConfigFactory newInstance()
- {
- return new WSConfigFactory();
- }
-
- public Object parse(URL configURL) throws IOException, JBossXBException
- {
- log.debug("parse: " + configURL);
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
-
- Object wsConfig;
- String nsURI = getNamespaceURI(configURL);
- if (URN_JAXRPC_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXRPC(), null);
- }
- else if (URN_JAXWS_CONFIG.equals(nsURI))
- {
- wsConfig = unmarshaller.unmarshal(configURL.openStream(), new WSConfigFactoryJAXWS(), null);
- }
- else
- {
- throw new WSException("Invalid config namespace: " + nsURI);
- }
-
- return wsConfig;
- }
-
- private String getNamespaceURI(URL configURL)
- {
- try
- {
- Element root = DOMUtils.parse(configURL.openStream());
- return root.getNamespaceURI();
- }
- catch (IOException ex)
- {
- throw new WSException(ex);
- }
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,12 +0,0 @@
-package org.jboss.ws.metadata.config;
-
-import java.net.URI;
-
-public class WSEndpointProperty
-{
- public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
-
- public URI name;
- public String value;
-
-}
\ No newline at end of file
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,180 @@
+/*
+ * 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.metadata.config.binding;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.config.EndpointProperty;
+import org.jboss.ws.metadata.config.jaxrpc.ClientConfigJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.CommonConfigJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+import java.util.List;
+
+/**
+ * ObjectModelFactory for JAXRPC configurations.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class OMFactoryJAXRPC implements ObjectModelFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(OMFactoryJAXRPC.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new ConfigRootJAXRPC();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(ConfigRootJAXRPC config, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ EndpointConfigJAXRPC wsEndpointConfig = new EndpointConfigJAXRPC();
+ config.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ ClientConfigJAXRPC clientConfig = new ClientConfigJAXRPC();
+ config.getClientConfig().add(clientConfig);
+ return clientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(CommonConfigJAXRPC commonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("CommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ commonConfig.setConfigName(value);
+ if(localName.equals("feature"))
+ commonConfig.setFeature(value, true);
+
+ if("property-name".equals(localName))
+ {
+ commonConfig.addProperty(value, null);
+ }
+ else if("property-value".equals(localName))
+ {
+ int lastEntry = commonConfig.getProperties().isEmpty() ? 0 : commonConfig.getProperties().size()-1;
+ EndpointProperty p = commonConfig.getProperties().get(lastEntry);
+ p.value = value;
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(CommonConfigJAXRPC commonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("CommonConfig newChild: " + localName);
+
+ if ("pre-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
+ commonConfig.setPreHandlerChain(preHandlerChain);
+ return preHandlerChain;
+ }
+ if ("post-handler-chain".equals(localName))
+ {
+ HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
+ commonConfig.setPostHandlerChain(postHandlerChain);
+ return postHandlerChain;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainConfig newChild: " + localName);
+ if ("handler".equals(localName))
+ {
+ UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData(handlerChainMetaData);
+ List<UnifiedHandlerMetaData> handlers = handlerChainMetaData.getHandlers();
+ handlers.add(handler);
+ return handler;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("handler-name"))
+ handler.setHandlerName(value);
+ else if (localName.equals("handler-class"))
+ handler.setHandlerClass(value);
+ else if (localName.equals("soap-header"))
+ handler.addSoapHeader(navigator.resolveQName(value));
+ else if (localName.equals("soap-role"))
+ handler.addSoapRole(value);
+ else if (localName.equals("port-name"))
+ handler.addPortName(value);
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("param-name"))
+ param.setParamName(value);
+ else if (localName.equals("param-value"))
+ param.setParamValue(value);
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,140 @@
+/*
+ * 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.metadata.config.binding;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.config.EndpointProperty;
+import org.jboss.ws.metadata.config.jaxws.*;
+import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * ObjectModelFactory for JAXRPC configurations.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author Heiko.Braun(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class OMFactoryJAXWS extends HandlerChainFactory
+{
+ // provide logging
+ private final Logger log = Logger.getLogger(OMFactoryJAXWS.class);
+
+ public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new ConfigRootJAXWS();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
+ {
+ return root;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(ConfigRootJAXWS config, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSConfig newChild: " + localName);
+ if ("endpoint-config".equals(localName))
+ {
+ EndpointConfigJAXWS wsEndpointConfig = new EndpointConfigJAXWS();
+ config.getEndpointConfig().add(wsEndpointConfig);
+ return wsEndpointConfig;
+ }
+ if ("client-config".equals(localName))
+ {
+ ClientConfigJAXWS clientConfig = new ClientConfigJAXWS();
+ config.getClientConfig().add(clientConfig);
+ return clientConfig;
+ }
+ return null;
+ }
+
+ /**
+ * Called when a new simple child element with text value was read from the XML content.
+ */
+ public void setValue(CommonConfigJAXWS commonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ if (log.isTraceEnabled())
+ log.trace("CommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
+
+ if (localName.equals("config-name"))
+ commonConfig.setConfigName(value);
+ if(localName.equals("feature"))
+ commonConfig.setFeature(value, true);
+
+ if("property-name".equals(localName))
+ {
+ commonConfig.addProperty(value, null);
+ }
+ else if("property-value".equals(localName))
+ {
+ int lastEntry = commonConfig.getProperties().isEmpty() ? 0 : commonConfig.getProperties().size()-1;
+ EndpointProperty p = commonConfig.getProperties().get(lastEntry);
+ p.value = value;
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(CommonConfigJAXWS commonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("CommonConfig newChild: " + localName);
+
+ if ("pre-handler-chains".equals(localName))
+ {
+ HandlerChainsConfigJAXWS preHandlerChains = new HandlerChainsConfigJAXWS();
+ commonConfig.setPreHandlerChains(preHandlerChains);
+ return preHandlerChains;
+ }
+ if ("post-handler-chains".equals(localName))
+ {
+ HandlerChainsConfigJAXWS postHandlerChains = new HandlerChainsConfigJAXWS();
+ commonConfig.setPostHandlerChains(postHandlerChains);
+ return postHandlerChains;
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(HandlerChainsConfigJAXWS handlerChains, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("WSHandlerChainsConfig newChild: " + localName);
+
+ if ("handler-chain".equals(localName))
+ {
+ HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
+ handlerChains.getHandlerChains().add(handlerChain);
+ return handlerChain;
+ }
+ return null;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/binding/OMFactoryJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ClientConfigJAXRPC.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ClientConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,35 @@
+/*
+ * 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.metadata.config.jaxrpc;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class ClientConfigJAXRPC extends CommonConfigJAXRPC
+{
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ClientConfigJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,91 @@
+/*
+ * 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.metadata.config.jaxrpc;
+
+import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class CommonConfigJAXRPC extends CommonConfig
+{
+ private HandlerChainMetaData preHandlerChain;
+ private HandlerChainMetaData postHandlerChain;
+
+ public HandlerChainMetaData getPostHandlerChain()
+ {
+ return postHandlerChain;
+ }
+
+ public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
+ {
+ this.postHandlerChain = postHandlerChain;
+ }
+
+ public HandlerChainMetaData getPreHandlerChain()
+ {
+ return preHandlerChain;
+ }
+
+ public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
+ {
+ this.preHandlerChain = preHandlerChain;
+ }
+
+ @Override
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ HandlerChainMetaData handlerChain;
+ if (type == HandlerType.PRE)
+ handlerChain = getPreHandlerChain();
+ else if (type == HandlerType.POST)
+ handlerChain = getPostHandlerChain();
+ else
+ throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (handlerChain != null)
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
+ }
+ }
+
+ return handlers;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ConfigRootJAXRPC.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ConfigRootJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,94 @@
+/*
+ * 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.metadata.config.jaxrpc;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class ConfigRootJAXRPC
+{
+ private List<ClientConfigJAXRPC> clientConfigList = new ArrayList<ClientConfigJAXRPC>();
+ private List<EndpointConfigJAXRPC> endpointConfigList = new ArrayList<EndpointConfigJAXRPC>();
+
+ public List<ClientConfigJAXRPC> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<ClientConfigJAXRPC> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<EndpointConfigJAXRPC> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<EndpointConfigJAXRPC> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public ClientConfigJAXRPC getClientConfigByName(String configName)
+ {
+ ClientConfigJAXRPC config = null;
+ for(ClientConfigJAXRPC aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public EndpointConfigJAXRPC getEndpointConfigByName(String configName)
+ {
+ EndpointConfigJAXRPC config = null;
+ for(EndpointConfigJAXRPC aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/ConfigRootJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/EndpointConfigJAXRPC.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/EndpointConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -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.ws.metadata.config.jaxrpc;
+
+
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class EndpointConfigJAXRPC extends CommonConfigJAXRPC
+{
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/EndpointConfigJAXRPC.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSClientConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,35 +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.metadata.config.jaxrpc;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSCommonConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,91 +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.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXRPC extends WSCommonConfig
-{
- private HandlerChainMetaData preHandlerChain;
- private HandlerChainMetaData postHandlerChain;
-
- public HandlerChainMetaData getPostHandlerChain()
- {
- return postHandlerChain;
- }
-
- public void setPostHandlerChain(HandlerChainMetaData postHandlerChain)
- {
- this.postHandlerChain = postHandlerChain;
- }
-
- public HandlerChainMetaData getPreHandlerChain()
- {
- return preHandlerChain;
- }
-
- public void setPreHandlerChain(HandlerChainMetaData preHandlerChain)
- {
- this.preHandlerChain = preHandlerChain;
- }
-
- @Override
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- HandlerChainMetaData handlerChain;
- if (type == HandlerType.PRE)
- handlerChain = getPreHandlerChain();
- else if (type == HandlerType.POST)
- handlerChain = getPostHandlerChain();
- else
- throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChain != null)
- {
- for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
- }
- }
-
- return handlers;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,175 +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.metadata.config.jaxrpc;
-
-//$Id$
-
-import java.util.List;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
-import org.jboss.ws.metadata.config.WSEndpointProperty;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXRPC implements ObjectModelFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXRPC.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
- {
- return new WSConfigRootJAXRPC();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXRPC wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXRPC wsEndpointConfig = new WSEndpointConfigJAXRPC();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXRPC wsClientConfig = new WSClientConfigJAXRPC();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- if(localName.equals("feature"))
- wsCommonConfig.setFeature(value, true);
-
- if("property-name".equals(localName))
- {
- wsCommonConfig.addProperty(value, null);
- }
- else if("property-value".equals(localName))
- {
- int lastEntry = wsCommonConfig.getProperties().isEmpty() ? 0 : wsCommonConfig.getProperties().size()-1;
- WSEndpointProperty p = wsCommonConfig.getProperties().get(lastEntry);
- p.value = value;
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXRPC wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chain".equals(localName))
- {
- HandlerChainMetaData preHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPreHandlerChain(preHandlerChain);
- return preHandlerChain;
- }
- if ("post-handler-chain".equals(localName))
- {
- HandlerChainMetaData postHandlerChain = new HandlerChainMetaData(null);
- wsCommonConfig.setPostHandlerChain(postHandlerChain);
- return postHandlerChain;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(HandlerChainMetaData handlerChainMetaData, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainConfig newChild: " + localName);
- if ("handler".equals(localName))
- {
- UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData(handlerChainMetaData);
- List<UnifiedHandlerMetaData> handlers = handlerChainMetaData.getHandlers();
- handlers.add(handler);
- return handler;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(UnifiedHandlerMetaData handler, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedHandlerMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("handler-name"))
- handler.setHandlerName(value);
- else if (localName.equals("handler-class"))
- handler.setHandlerClass(value);
- else if (localName.equals("soap-header"))
- handler.addSoapHeader(navigator.resolveQName(value));
- else if (localName.equals("soap-role"))
- handler.addSoapRole(value);
- else if (localName.equals("port-name"))
- handler.addPortName(value);
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(HandlerInitParam param, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("UnifiedInitParamMetaData setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("param-name"))
- param.setParamName(value);
- else if (localName.equals("param-value"))
- param.setParamValue(value);
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigRootJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,94 +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.metadata.config.jaxrpc;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXRPC
-{
- private List<WSClientConfigJAXRPC> clientConfigList = new ArrayList<WSClientConfigJAXRPC>();
- private List<WSEndpointConfigJAXRPC> endpointConfigList = new ArrayList<WSEndpointConfigJAXRPC>();
-
- public List<WSClientConfigJAXRPC> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXRPC> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXRPC> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXRPC> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXRPC getClientConfigByName(String configName)
- {
- WSClientConfigJAXRPC config = null;
- for(WSClientConfigJAXRPC aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXRPC getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXRPC config = null;
- for(WSEndpointConfigJAXRPC aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSEndpointConfigJAXRPC.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,36 +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.metadata.config.jaxrpc;
-
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXRPC extends WSCommonConfigJAXRPC
-{
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ClientConfigJAXWS.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ClientConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,35 @@
+/*
+ * 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.metadata.config.jaxws;
+
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class ClientConfigJAXWS extends CommonConfigJAXWS
+{
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ClientConfigJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java (from rev 1642, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,91 @@
+/*
+ * 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.metadata.config.jaxws;
+
+import org.jboss.ws.metadata.config.CommonConfig;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// $Id$
+
+/**
+ * A JBossWS client configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public abstract class CommonConfigJAXWS extends CommonConfig
+{
+ private HandlerChainsConfigJAXWS preHandlerChains;
+ private HandlerChainsConfigJAXWS postHandlerChains;
+
+ public HandlerChainsConfigJAXWS getPostHandlerChains()
+ {
+ return postHandlerChains;
+ }
+
+ public void setPostHandlerChains(HandlerChainsConfigJAXWS postHandlerChain)
+ {
+ this.postHandlerChains = postHandlerChain;
+ }
+
+ public HandlerChainsConfigJAXWS getPreHandlerChains()
+ {
+ return preHandlerChains;
+ }
+
+ public void setPreHandlerChains(HandlerChainsConfigJAXWS preHandlerChains)
+ {
+ this.preHandlerChains = preHandlerChains;
+ }
+
+ public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
+ {
+ List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
+
+ HandlerChainsConfigJAXWS handlerChains;
+ if (type == HandlerType.PRE)
+ handlerChains = getPreHandlerChains();
+ else if (type == HandlerType.POST)
+ handlerChains = getPostHandlerChains();
+ else throw new IllegalArgumentException("Invalid handler type: " + type);
+
+ if (handlerChains != null)
+ {
+ for (HandlerChainMetaData handlerChainMetaData : handlerChains.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
+ }
+ }
+ }
+
+ return handlers;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ConfigRootJAXWS.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ConfigRootJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,94 @@
+/*
+ * 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.metadata.config.jaxws;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class ConfigRootJAXWS
+{
+ private List<ClientConfigJAXWS> clientConfigList = new ArrayList<ClientConfigJAXWS>();
+ private List<EndpointConfigJAXWS> endpointConfigList = new ArrayList<EndpointConfigJAXWS>();
+
+ public List<ClientConfigJAXWS> getClientConfig()
+ {
+ return clientConfigList;
+ }
+
+ public void setClientConfig(List<ClientConfigJAXWS> clientConfig)
+ {
+ this.clientConfigList = clientConfig;
+ }
+
+ public List<EndpointConfigJAXWS> getEndpointConfig()
+ {
+ return endpointConfigList;
+ }
+
+ public void setEndpointConfig(List<EndpointConfigJAXWS> endpointConfig)
+ {
+ this.endpointConfigList = endpointConfig;
+ }
+
+ public ClientConfigJAXWS getClientConfigByName(String configName)
+ {
+ ClientConfigJAXWS config = null;
+ for(ClientConfigJAXWS aux : clientConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && clientConfigList.size() == 1)
+ config = clientConfigList.get(0);
+
+ return config;
+ }
+
+ public EndpointConfigJAXWS getEndpointConfigByName(String configName)
+ {
+ EndpointConfigJAXWS config = null;
+ for(EndpointConfigJAXWS aux : endpointConfigList)
+ {
+ if (aux.getConfigName().equals(configName))
+ {
+ config = aux;
+ break;
+ }
+ }
+
+ if (config == null && endpointConfigList.size() == 1)
+ config = endpointConfigList.get(0);
+
+ return config;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/ConfigRootJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/EndpointConfigJAXWS.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/EndpointConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,35 @@
+/*
+ * 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.metadata.config.jaxws;
+
+
+// $Id$
+
+/**
+ * A JBossWS endpoint configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class EndpointConfigJAXWS extends CommonConfigJAXWS
+{
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/EndpointConfigJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/HandlerChainsConfigJAXWS.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/HandlerChainsConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.metadata.config.jaxws;
+
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * A JBossWS handler chains configuration
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 18-Dec-2005
+ */
+public class HandlerChainsConfigJAXWS
+{
+ private List<HandlerChainMetaData> chains = new ArrayList<HandlerChainMetaData>();
+
+ public HandlerChainsConfigJAXWS()
+ {
+ }
+
+ public List<HandlerChainMetaData> getHandlerChains()
+ {
+ return chains;
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/HandlerChainsConfigJAXWS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSClientConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,35 +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.metadata.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSClientConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,93 +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.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.net.URI;
-
-import org.jboss.ws.metadata.config.WSCommonConfig;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-// $Id$
-
-/**
- * A JBossWS client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public abstract class WSCommonConfigJAXWS extends WSCommonConfig
-{
- private WSHandlerChainsConfigJAXWS preHandlerChains;
- private WSHandlerChainsConfigJAXWS postHandlerChains;
-
- public WSHandlerChainsConfigJAXWS getPostHandlerChains()
- {
- return postHandlerChains;
- }
-
- public void setPostHandlerChains(WSHandlerChainsConfigJAXWS postHandlerChain)
- {
- this.postHandlerChains = postHandlerChain;
- }
-
- public WSHandlerChainsConfigJAXWS getPreHandlerChains()
- {
- return preHandlerChains;
- }
-
- public void setPreHandlerChains(WSHandlerChainsConfigJAXWS preHandlerChains)
- {
- this.preHandlerChains = preHandlerChains;
- }
-
- public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
- {
- List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
-
- WSHandlerChainsConfigJAXWS handlerChains;
- if (type == HandlerType.PRE)
- handlerChains = getPreHandlerChains();
- else if (type == HandlerType.POST)
- handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException("Invalid handler type: " + type);
-
- if (handlerChains != null)
- {
- for (HandlerChainMetaData handlerChainMetaData : handlerChains.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
- }
- }
- }
-
- return handlers;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,138 +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.metadata.config.jaxws;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.config.WSEndpointProperty;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A factory for the JBossWS endpoint/client configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigFactoryJAXWS extends HandlerChainFactory
-{
- // provide logging
- private final Logger log = Logger.getLogger(WSConfigFactoryJAXWS.class);
-
- public Object newRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName, Attributes attrs)
- {
- return new WSConfigRootJAXWS();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String namespaceURI, String localName)
- {
- return root;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSConfigRootJAXWS wsConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSConfig newChild: " + localName);
- if ("endpoint-config".equals(localName))
- {
- WSEndpointConfigJAXWS wsEndpointConfig = new WSEndpointConfigJAXWS();
- wsConfig.getEndpointConfig().add(wsEndpointConfig);
- return wsEndpointConfig;
- }
- if ("client-config".equals(localName))
- {
- WSClientConfigJAXWS wsClientConfig = new WSClientConfigJAXWS();
- wsConfig.getClientConfig().add(wsClientConfig);
- return wsClientConfig;
- }
- return null;
- }
-
- /**
- * Called when a new simple child element with text value was read from the XML content.
- */
- public void setValue(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- if (log.isTraceEnabled())
- log.trace("WSCommonConfig setValue: nuri=" + namespaceURI + " localName=" + localName + " value=" + value);
-
- if (localName.equals("config-name"))
- wsCommonConfig.setConfigName(value);
- if(localName.equals("feature"))
- wsCommonConfig.setFeature(value, true);
-
- if("property-name".equals(localName))
- {
- wsCommonConfig.addProperty(value, null);
- }
- else if("property-value".equals(localName))
- {
- int lastEntry = wsCommonConfig.getProperties().isEmpty() ? 0 : wsCommonConfig.getProperties().size()-1;
- WSEndpointProperty p = wsCommonConfig.getProperties().get(lastEntry);
- p.value = value;
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSCommonConfigJAXWS wsCommonConfig, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSCommonConfig newChild: " + localName);
-
- if ("pre-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS preHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPreHandlerChains(preHandlerChains);
- return preHandlerChains;
- }
- if ("post-handler-chains".equals(localName))
- {
- WSHandlerChainsConfigJAXWS postHandlerChains = new WSHandlerChainsConfigJAXWS();
- wsCommonConfig.setPostHandlerChains(postHandlerChains);
- return postHandlerChains;
- }
-
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSHandlerChainsConfigJAXWS wsHandlerChains, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("WSHandlerChainsConfig newChild: " + localName);
-
- if ("handler-chain".equals(localName))
- {
- HandlerChainMetaData handlerChain = new HandlerChainMetaData(null);
- wsHandlerChains.getHandlerChains().add(handlerChain);
- return handlerChain;
- }
- return null;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigRootJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,94 +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.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * A JBossWS configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSConfigRootJAXWS
-{
- private List<WSClientConfigJAXWS> clientConfigList = new ArrayList<WSClientConfigJAXWS>();
- private List<WSEndpointConfigJAXWS> endpointConfigList = new ArrayList<WSEndpointConfigJAXWS>();
-
- public List<WSClientConfigJAXWS> getClientConfig()
- {
- return clientConfigList;
- }
-
- public void setClientConfig(List<WSClientConfigJAXWS> clientConfig)
- {
- this.clientConfigList = clientConfig;
- }
-
- public List<WSEndpointConfigJAXWS> getEndpointConfig()
- {
- return endpointConfigList;
- }
-
- public void setEndpointConfig(List<WSEndpointConfigJAXWS> endpointConfig)
- {
- this.endpointConfigList = endpointConfig;
- }
-
- public WSClientConfigJAXWS getClientConfigByName(String configName)
- {
- WSClientConfigJAXWS config = null;
- for(WSClientConfigJAXWS aux : clientConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
- return config;
- }
-
- public WSEndpointConfigJAXWS getEndpointConfigByName(String configName)
- {
- WSEndpointConfigJAXWS config = null;
- for(WSEndpointConfigJAXWS aux : endpointConfigList)
- {
- if (aux.getConfigName().equals(configName))
- {
- config = aux;
- break;
- }
- }
-
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
- return config;
- }
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSEndpointConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,35 +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.metadata.config.jaxws;
-
-
-// $Id$
-
-/**
- * A JBossWS endpoint configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSEndpointConfigJAXWS extends WSCommonConfigJAXWS
-{
-}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSHandlerChainsConfigJAXWS.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,48 +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.metadata.config.jaxws;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-
-
-/**
- * A JBossWS handler chains configuration
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 18-Dec-2005
- */
-public class WSHandlerChainsConfigJAXWS
-{
- private List<HandlerChainMetaData> chains = new ArrayList<HandlerChainMetaData>();
-
- public WSHandlerChainsConfigJAXWS()
- {
- }
-
- public List<HandlerChainMetaData> getHandlerChains()
- {
- return chains;
- }
-}
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -30,9 +30,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-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.config.JBossWSConfigFactory;
+import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
@@ -114,7 +114,7 @@
Object wsConfig;
try
{
- WSConfigFactory factory = WSConfigFactory.newInstance();
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
wsConfig = factory.parse(configURL);
}
catch (RuntimeException rte)
@@ -127,15 +127,15 @@
}
// Get the client config
- if (wsConfig instanceof WSConfigRootJAXRPC)
+ if (wsConfig instanceof ConfigRootJAXRPC)
{
- endpointConfig = ((WSConfigRootJAXRPC)wsConfig).getClientConfigByName(configName);
+ endpointConfig = ((ConfigRootJAXRPC)wsConfig).getClientConfigByName(configName);
if (endpointConfig == null)
throw new WSException("Cannot obtain client config: " + configName);
}
else
{
- endpointConfig = ((WSConfigRootJAXWS)wsConfig).getClientConfigByName(configName);
+ endpointConfig = ((ConfigRootJAXWS)wsConfig).getClientConfigByName(configName);
if (endpointConfig == null)
throw new WSException("Cannot obtain client config: " + configName);
}
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-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -36,7 +36,7 @@
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.metadata.config.WSCommonConfig;
+import org.jboss.ws.metadata.config.CommonConfig;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import javax.jws.soap.SOAPBinding.ParameterStyle;
@@ -66,7 +66,7 @@
private ServiceMetaData serviceMetaData;
// The REQUIRED endpoint config
- protected WSCommonConfig endpointConfig;
+ protected CommonConfig endpointConfig;
// The REQUIRED name
private QName portName;
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-14 11:39:46 UTC (rev 1642)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -25,10 +25,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-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.config.CommonConfig;
+import org.jboss.ws.metadata.config.JBossWSConfigFactory;
+import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import javax.management.ObjectName;
@@ -185,7 +185,7 @@
}
@Override
- public WSCommonConfig getEndpointConfig()
+ public CommonConfig getEndpointConfig()
{
if (endpointConfig == null)
{
@@ -235,7 +235,7 @@
Object wsConfig;
try
{
- WSConfigFactory factory = WSConfigFactory.newInstance();
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
wsConfig = factory.parse(configURL);
}
catch (RuntimeException rte)
@@ -248,15 +248,15 @@
}
// Get the endpoint config
- if (wsConfig instanceof WSConfigRootJAXRPC)
+ if (wsConfig instanceof ConfigRootJAXRPC)
{
- endpointConfig = ((WSConfigRootJAXRPC)wsConfig).getEndpointConfigByName(configName);
+ endpointConfig = ((ConfigRootJAXRPC)wsConfig).getEndpointConfigByName(configName);
if (endpointConfig == null)
throw new WSException("Cannot obtain endpoint config: " + configName);
}
else
{
- endpointConfig = ((WSConfigRootJAXWS)wsConfig).getEndpointConfigByName(configName);
+ endpointConfig = ((ConfigRootJAXWS)wsConfig).getEndpointConfigByName(configName);
if (endpointConfig == null)
throw new WSException("Cannot obtain endpoint config: " + configName);
}
Copied: trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java (from rev 1642, trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java)
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -0,0 +1,103 @@
+/*
+ * 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.common.config;
+
+import java.io.File;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.metadata.config.JBossWSConfigFactory;
+import org.jboss.ws.metadata.config.EndpointProperty;
+import org.jboss.ws.metadata.config.jaxws.ConfigRootJAXWS;
+import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
+import org.jboss.ws.metadata.config.jaxrpc.ConfigRootJAXRPC;
+import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+
+/**
+ * Test parsing of the JBossWS config
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Dec-2004
+ */
+public class ConfigFactoryTestCase extends JBossWSTest
+{
+
+ public void testJAXRPCObjectModelFactory() throws Exception
+ {
+ File confFile = new File("resources/common/config/jaxrpc-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ ConfigRootJAXRPC config = (ConfigRootJAXRPC)factory.parse(confFile.toURL());
+
+ assertNotNull("Null config", config);
+
+ assertEquals(2, config.getEndpointConfig().size());
+ EndpointConfigJAXRPC epc1 = (EndpointConfigJAXRPC)config.getEndpointConfig().get(0);
+ EndpointConfigJAXRPC epc2 = (EndpointConfigJAXRPC)config.getEndpointConfig().get(1);
+
+ assertEquals("Standard Endpoint", epc1.getConfigName());
+ assertNull(epc1.getPreHandlerChain());
+ assertNull(epc1.getPostHandlerChain());
+
+ assertEquals("Standard WSSecurity Endpoint", epc2.getConfigName());
+ HandlerChainMetaData preChain = epc2.getPreHandlerChain();
+ assertEquals(1, preChain.getHandlers().size());
+ UnifiedHandlerMetaData h1 = (UnifiedHandlerMetaData)preChain.getHandlers().get(0);
+ assertEquals("WSSecurityHandlerInbound", h1.getHandlerName());
+ assertEquals("org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound", h1.getHandlerClass());
+ }
+
+ public void testFeatures() throws Exception
+ {
+ File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURL());
+ assertNotNull("Null config", config);
+
+ EndpointConfigJAXWS epConfig = config.getEndpointConfig().get(1);
+ assertTrue("Feature not set" , epConfig.getFeature("http://org.jboss.ws/mtom"));
+
+ // disable feature
+ epConfig.setFeature("http://org.jboss.ws/mtom", false);
+ assertFalse("Feature still set", epConfig.getFeature("http://org.jboss.ws/mtom"));
+
+ }
+
+ public void testProperties() throws Exception
+ {
+ File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ JBossWSConfigFactory factory = JBossWSConfigFactory.newInstance();
+ ConfigRootJAXWS config = (ConfigRootJAXWS)factory.parse(confFile.toURL());
+ assertNotNull("Null config", config);
+
+ EndpointConfigJAXWS epConfig = config.getEndpointConfig().get(1);
+ String value = epConfig.getProperty(EndpointProperty.MTOM_THRESHOLD);
+ assertNotNull("Property does not exist", value);
+ assertEquals("Wrong property valule", value, "5000");
+ }
+}
Property changes on: trunk/src/test/java/org/jboss/test/ws/common/config/ConfigFactoryTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-14 11:39:46 UTC (rev 1642)
+++ trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-14 11:57:37 UTC (rev 1643)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.common.config;
-
-import java.io.File;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.ws.metadata.config.WSConfigFactory;
-import org.jboss.ws.metadata.config.WSEndpointProperty;
-import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
-import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
-import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
-import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-
-/**
- * Test parsing of the JBossWS config
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Dec-2004
- */
-public class WSConfigTestCase extends JBossWSTest
-{
- public void testParseWithSchemaBinding() throws Exception
- {
- File confFile = new File("resources/common/config/jaxrpc-endpoint-config.xml");
- assertTrue(confFile.exists());
-
- WSConfigFactory factory = WSConfigFactory.newInstance();
- //WSConfig wsConfig = factory.parseWithSchemaBinding(confFile.toURL());
- //assertJAXRPCConfig(wsConfig);
- }
-
- public void testJAXRPCObjectModelFactory() throws Exception
- {
- File confFile = new File("resources/common/config/jaxrpc-endpoint-config.xml");
- assertTrue(confFile.exists());
-
- WSConfigFactory factory = WSConfigFactory.newInstance();
- WSConfigRootJAXRPC wsConfig = (WSConfigRootJAXRPC)factory.parse(confFile.toURL());
-
- assertNotNull("Null wsConfig", wsConfig);
-
- assertEquals(2, wsConfig.getEndpointConfig().size());
- WSEndpointConfigJAXRPC epc1 = (WSEndpointConfigJAXRPC)wsConfig.getEndpointConfig().get(0);
- WSEndpointConfigJAXRPC epc2 = (WSEndpointConfigJAXRPC)wsConfig.getEndpointConfig().get(1);
-
- assertEquals("Standard Endpoint", epc1.getConfigName());
- assertNull(epc1.getPreHandlerChain());
- assertNull(epc1.getPostHandlerChain());
-
- assertEquals("Standard WSSecurity Endpoint", epc2.getConfigName());
- HandlerChainMetaData preChain = epc2.getPreHandlerChain();
- assertEquals(1, preChain.getHandlers().size());
- UnifiedHandlerMetaData h1 = (UnifiedHandlerMetaData)preChain.getHandlers().get(0);
- assertEquals("WSSecurityHandlerInbound", h1.getHandlerName());
- assertEquals("org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound", h1.getHandlerClass());
- }
-
- public void testFeatures() throws Exception
- {
- File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
- assertTrue(confFile.exists());
-
- WSConfigFactory factory = WSConfigFactory.newInstance();
- WSConfigRootJAXWS wsConfig = (WSConfigRootJAXWS)factory.parse(confFile.toURL());
- assertNotNull("Null wsConfig", wsConfig);
-
- WSEndpointConfigJAXWS epConfig = wsConfig.getEndpointConfig().get(1);
- assertTrue("Feature not set" , epConfig.getFeature("http://org.jboss.ws/mtom"));
-
- // disable feature
- epConfig.setFeature("http://org.jboss.ws/mtom", false);
- assertFalse("Feature still set", epConfig.getFeature("http://org.jboss.ws/mtom"));
-
- }
-
- public void testProperties() throws Exception
- {
- File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
- assertTrue(confFile.exists());
-
- WSConfigFactory factory = WSConfigFactory.newInstance();
- WSConfigRootJAXWS wsConfig = (WSConfigRootJAXWS)factory.parse(confFile.toURL());
- assertNotNull("Null wsConfig", wsConfig);
-
- WSEndpointConfigJAXWS epConfig = wsConfig.getEndpointConfig().get(1);
- String value = epConfig.getProperty(WSEndpointProperty.MTOM_THRESHOLD);
- assertNotNull("Property does not exist", value);
- assertEquals("Wrong property valule", value, "5000");
- }
-}
19 years, 4 months
JBossWS SVN: r1642 - in trunk/src: main/java/org/jboss/ws/core main/java/org/jboss/ws/metadata/config main/java/org/jboss/ws/metadata/config/jaxrpc main/java/org/jboss/ws/metadata/config/jaxws main/java/org/jboss/ws/metadata/umdm main/resources/schema test/java/org/jboss/test/ws/common/config test/resources/common/config
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 06:39:46 -0500 (Thu, 14 Dec 2006)
New Revision: 1642
Added:
trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java
Modified:
trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/src/main/resources/schema/jaxws-config_2_0.xsd
trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
Log:
Added properties and features to configuration
Modified: trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -129,7 +129,7 @@
public boolean isMTOMEnabled()
{
- return mtomEnabled;
+ return this.mtomEnabled;
}
public void setMTOMEnabled(boolean flag)
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSCommonConfig.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -23,13 +23,16 @@
//$Id$
-import java.util.List;
-
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-/**
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
* A common configuration
*
* @author Thomas.Diesler(a)jboss.org
@@ -38,6 +41,8 @@
public abstract class WSCommonConfig
{
private String configName;
+ private List<URI> features = new ArrayList<URI>();
+ private List<WSEndpointProperty> properties = new ArrayList<WSEndpointProperty>();
public String getConfigName()
{
@@ -48,6 +53,63 @@
{
this.configName = configName;
}
-
+
public abstract List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type);
+
+ public boolean getFeature(URI type) {
+ return features.contains(type);
+ }
+
+ public boolean getFeature(String uri)
+ {
+ return getFeature(nameToURI(uri));
+ }
+
+ public void setFeature(String type, boolean enabled) {
+
+ if(enabled) {
+ features.add(nameToURI(type));
+ }
+ else
+ features.remove(nameToURI(type));
+ }
+
+ public void addProperty(String name, String value)
+ {
+ WSEndpointProperty p = new WSEndpointProperty();
+ p.name = nameToURI(name);
+ p.value = value;
+ properties.add(p);
+ }
+
+ public String getProperty(String name)
+ {
+ String value = null;
+ URI uri = nameToURI(name);
+
+ for(WSEndpointProperty wsp : properties)
+ {
+ if(wsp.name.equals(uri))
+ {
+ value = wsp.value;
+ break;
+ }
+ }
+ return value;
+ }
+
+ public List<WSEndpointProperty> getProperties() {
+ return properties;
+ }
+
+ private static URI nameToURI(String name)
+ {
+ URI uri = null;
+ try {
+ uri = new URI(name);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ return uri;
+ }
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSConfigFactory.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -23,23 +23,19 @@
//$Id$
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
import org.jboss.ws.metadata.config.jaxrpc.WSConfigFactoryJAXRPC;
import org.jboss.ws.metadata.config.jaxws.WSConfigFactoryJAXWS;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.binding.sunday.unmarshalling.XsdBinder;
import org.w3c.dom.Element;
+import java.io.IOException;
+import java.net.URL;
+
/**
* A factory for the JBossWS endpoint/client configuration
*
@@ -66,35 +62,13 @@
return new WSConfigFactory();
}
- public Object parseWithSchemaBinding(URL configURL) throws IOException, JBossXBException
+ public Object parse(URL configURL) throws IOException, JBossXBException
{
log.debug("parse: " + configURL);
- String configSchema = "schema/jaxrpc-config_2_0.xsd";
- URL xsdURL = Thread.currentThread().getContextClassLoader().getResource(configSchema);
- if (xsdURL == null)
- throw new WSException("Cannot find: " + configSchema);
-
- InputStream xsd = xsdURL.openStream();
- SchemaBinding schemaBinding = XsdBinder.bind(xsd, "UTF-8");
-
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
unmarshaller.setValidation(true);
unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- Object wsConfig = unmarshaller.unmarshal(configURL.openStream(), schemaBinding);
- return wsConfig;
- }
-
- // Below is ObjectModelFactory stuff, which should be removed when parseWithSchemaBinding works.
-
- public Object parseWithObjectModelFactory(URL configURL) throws IOException, JBossXBException
- {
- log.debug("parse: " + configURL);
-
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
Object wsConfig;
String nsURI = getNamespaceURI(configURL);
Added: trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/WSEndpointProperty.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -0,0 +1,12 @@
+package org.jboss.ws.metadata.config;
+
+import java.net.URI;
+
+public class WSEndpointProperty
+{
+ public final static String MTOM_THRESHOLD = "http://org.jboss.ws/mtom#threshold";
+
+ public URI name;
+ public String value;
+
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxrpc/WSConfigFactoryJAXRPC.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -29,6 +29,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
+import org.jboss.ws.metadata.config.WSEndpointProperty;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
@@ -85,6 +86,19 @@
if (localName.equals("config-name"))
wsCommonConfig.setConfigName(value);
+ if(localName.equals("feature"))
+ wsCommonConfig.setFeature(value, true);
+
+ if("property-name".equals(localName))
+ {
+ wsCommonConfig.addProperty(value, null);
+ }
+ else if("property-value".equals(localName))
+ {
+ int lastEntry = wsCommonConfig.getProperties().isEmpty() ? 0 : wsCommonConfig.getProperties().size()-1;
+ WSEndpointProperty p = wsCommonConfig.getProperties().get(lastEntry);
+ p.value = value;
+ }
}
/**
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSCommonConfigJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -23,6 +23,8 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
+import java.net.URI;
import org.jboss.ws.metadata.config.WSCommonConfig;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
@@ -63,7 +65,7 @@
{
this.preHandlerChains = preHandlerChains;
}
-
+
public List<HandlerMetaData> getHandlers(EndpointMetaData epMetaData, HandlerType type)
{
List<HandlerMetaData> handlers = new ArrayList<HandlerMetaData>();
Modified: trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/config/jaxws/WSConfigFactoryJAXWS.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -26,10 +26,11 @@
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.config.WSEndpointProperty;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
-/**
+/**
* A factory for the JBossWS endpoint/client configuration
*
* @author Thomas.Diesler(a)jboss.org
@@ -81,6 +82,19 @@
if (localName.equals("config-name"))
wsCommonConfig.setConfigName(value);
+ if(localName.equals("feature"))
+ wsCommonConfig.setFeature(value, true);
+
+ if("property-name".equals(localName))
+ {
+ wsCommonConfig.addProperty(value, null);
+ }
+ else if("property-value".equals(localName))
+ {
+ int lastEntry = wsCommonConfig.getProperties().isEmpty() ? 0 : wsCommonConfig.getProperties().size()-1;
+ WSEndpointProperty p = wsCommonConfig.getProperties().get(lastEntry);
+ p.value = value;
+ }
}
/**
@@ -102,6 +116,7 @@
wsCommonConfig.setPostHandlerChains(postHandlerChains);
return postHandlerChains;
}
+
return null;
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -115,7 +115,7 @@
try
{
WSConfigFactory factory = WSConfigFactory.newInstance();
- wsConfig = factory.parseWithObjectModelFactory(configURL);
+ wsConfig = factory.parse(configURL);
}
catch (RuntimeException rte)
{
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-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -236,7 +236,7 @@
try
{
WSConfigFactory factory = WSConfigFactory.newInstance();
- wsConfig = factory.parseWithObjectModelFactory(configURL);
+ wsConfig = factory.parse(configURL);
}
catch (RuntimeException rte)
{
Modified: trunk/src/main/resources/schema/jaxws-config_2_0.xsd
===================================================================
--- trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/main/resources/schema/jaxws-config_2_0.xsd 2006-12-14 11:39:46 UTC (rev 1642)
@@ -1,66 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="urn:jboss:jaxws-config:2.0"
- xmlns:tns="urn:jboss:jaxws-config:2.0"
- xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
-
- <xsd:annotation>
- <xsd:documentation>
- <![CDATA[
- This is the schema definition for JBossWS configurations JAXWS.
- It relies on the handler definitions that are part of the standard J2EE-1.5 deployment descriptors.
- ]]>
- </xsd:documentation>
- </xsd:annotation>
-
- <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="javaee_web_services_1_2.xsd"/>
-
- <xsd:complexType name="jaxwsConfigType">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.ws.metadata.config.WSConfig"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="endpoint-config" type="tns:endpointConfigType" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="client-config" type="tns:clientConfigType" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:choice>
- </xsd:complexType>
-
- <xsd:element name="jaxws-config" type="tns:jaxwsConfigType"/>
-
- <xsd:complexType name="endpointConfigType">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.ws.metadata.config.WSEndpointConfig"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="tns:commonConfigType"/>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="clientConfigType">
- <xsd:annotation>
- <xsd:appinfo>
- <jbxb:class impl="org.jboss.ws.metadata.config.WSClientConfig"/>
- </xsd:appinfo>
- </xsd:annotation>
- <xsd:complexContent>
- <xsd:extension base="tns:commonConfigType"/>
- </xsd:complexContent>
- </xsd:complexType>
-
- <xsd:complexType name="commonConfigType">
- <xsd:sequence>
- <xsd:element name="config-name" type="xsd:string"/>
- <xsd:element name="pre-handler-chains" type="javaee:handler-chainsType" minOccurs="0"/>
- <xsd:element name="post-handler-chains" type="javaee:handler-chainsType" minOccurs="0"/>
- </xsd:sequence>
- </xsd:complexType>
-
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:jaxws-config:2.0"
+ xmlns:tns="urn:jboss:jaxws-config:2.0"
+ xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
+
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+ This is the schema definition for JBossWS configurations JAXWS.
+ It relies on the handler definitions that are part of the standard J2EE-1.5 deployment descriptors.
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="javaee_web_services_1_2.xsd"/>
+
+ <xsd:element name="jaxws-config" type="tns:jaxwsConfigType"/>
+ <xsd:complexType name="jaxwsConfigType">
+ <xsd:choice>
+ <xsd:element name="endpoint-config" type="tns:endpointConfigType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="client-config" type="tns:clientConfigType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:choice>
+ </xsd:complexType>
+
+ <xsd:complexType name="endpointConfigType">
+ <xsd:complexContent>
+ <xsd:extension base="tns:commonConfigType"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <!-- client config -->
+ <xsd:complexType name="clientConfigType">
+ <xsd:complexContent>
+ <xsd:extension base="tns:commonConfigType"/>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="commonConfigType">
+ <xsd:sequence>
+ <xsd:element name="config-name" type="xsd:string"/>
+ <xsd:element name="pre-handler-chains" type="javaee:handler-chainsType" minOccurs="0"/>
+ <xsd:element name="post-handler-chains" type="javaee:handler-chainsType" minOccurs="0"/>
+ <xsd:element name="feature" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="property" type="tns:propertyType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="propertyType">
+ <xsd:annotation>
+ <xsd:documentation>
+
+ A property models name value pairs.
+
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="property-name" type="xsd:anyURI"/>
+ <xsd:element name="property-value" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
</xsd:schema>
Modified: trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/test/java/org/jboss/test/ws/common/config/WSConfigTestCase.java 2006-12-14 11:39:46 UTC (rev 1642)
@@ -25,6 +25,9 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.metadata.config.WSConfigFactory;
+import org.jboss.ws.metadata.config.WSEndpointProperty;
+import org.jboss.ws.metadata.config.jaxws.WSConfigRootJAXWS;
+import org.jboss.ws.metadata.config.jaxws.WSEndpointConfigJAXWS;
import org.jboss.ws.metadata.config.jaxrpc.WSConfigRootJAXRPC;
import org.jboss.ws.metadata.config.jaxrpc.WSEndpointConfigJAXRPC;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
@@ -54,7 +57,7 @@
assertTrue(confFile.exists());
WSConfigFactory factory = WSConfigFactory.newInstance();
- WSConfigRootJAXRPC wsConfig = (WSConfigRootJAXRPC)factory.parseWithObjectModelFactory(confFile.toURL());
+ WSConfigRootJAXRPC wsConfig = (WSConfigRootJAXRPC)factory.parse(confFile.toURL());
assertNotNull("Null wsConfig", wsConfig);
@@ -73,4 +76,37 @@
assertEquals("WSSecurityHandlerInbound", h1.getHandlerName());
assertEquals("org.jboss.ws.extensions.security.jaxrpc.WSSecurityHandlerInbound", h1.getHandlerClass());
}
+
+ public void testFeatures() throws Exception
+ {
+ File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ WSConfigFactory factory = WSConfigFactory.newInstance();
+ WSConfigRootJAXWS wsConfig = (WSConfigRootJAXWS)factory.parse(confFile.toURL());
+ assertNotNull("Null wsConfig", wsConfig);
+
+ WSEndpointConfigJAXWS epConfig = wsConfig.getEndpointConfig().get(1);
+ assertTrue("Feature not set" , epConfig.getFeature("http://org.jboss.ws/mtom"));
+
+ // disable feature
+ epConfig.setFeature("http://org.jboss.ws/mtom", false);
+ assertFalse("Feature still set", epConfig.getFeature("http://org.jboss.ws/mtom"));
+
+ }
+
+ public void testProperties() throws Exception
+ {
+ File confFile = new File("resources/common/config/jaxws-endpoint-config.xml");
+ assertTrue(confFile.exists());
+
+ WSConfigFactory factory = WSConfigFactory.newInstance();
+ WSConfigRootJAXWS wsConfig = (WSConfigRootJAXWS)factory.parse(confFile.toURL());
+ assertNotNull("Null wsConfig", wsConfig);
+
+ WSEndpointConfigJAXWS epConfig = wsConfig.getEndpointConfig().get(1);
+ String value = epConfig.getProperty(WSEndpointProperty.MTOM_THRESHOLD);
+ assertNotNull("Property does not exist", value);
+ assertEquals("Wrong property valule", value, "5000");
+ }
}
Modified: trunk/src/test/resources/common/config/jaxws-endpoint-config.xml
===================================================================
--- trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2006-12-14 11:08:20 UTC (rev 1641)
+++ trunk/src/test/resources/common/config/jaxws-endpoint-config.xml 2006-12-14 11:39:46 UTC (rev 1642)
@@ -3,25 +3,35 @@
<!-- $Id$ -->
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:javaee="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
-
- <endpoint-config>
- <config-name>Standard Endpoint</config-name>
- </endpoint-config>
-
- <endpoint-config>
- <config-name>Standard WSSecurity Endpoint</config-name>
- <pre-handler-chains>
- <javaee:handler-chain>
- <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
- <javaee:handler>
- <javaee:handler-name>WSSecurityHandlerInbound</javaee:handler-name>
- <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
- </javaee:handler>
- </javaee:handler-chain>
- </pre-handler-chains>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+
+ <endpoint-config>
+ <config-name>Standard Endpoint</config-name>
</endpoint-config>
-
+
+ <endpoint-config>
+
+ <config-name>Standard WSSecurity Endpoint</config-name>
+
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+ <javaee:handler>
+ <javaee:handler-name>WSSecurityHandlerInbound</javaee:handler-name>
+ <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerInbound</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+
+ <feature>http://org.jboss.ws/mtom</feature>
+
+ <property>
+ <property-name>http://org.jboss.ws/mtom#threshold</property-name>
+ <property-value>5000</property-value>
+ </property>
+
+ </endpoint-config>
+
</jaxws-config>
\ No newline at end of file
19 years, 4 months