JBossWS SVN: r1661 - in branches/dlofthouse/JBWS-1260/src: main/java/org/jboss/ws/tools/helpers test/java/org/jboss/test/ws/tools/validation test/resources/tools/jbws1260/scenario_AA test/resources/tools/jbws1260/scenario_G test/resources/tools/jbws1260/scenario_H test/resources/tools/jbws1260/scenario_I test/resources/tools/jbws1260/scenario_P test/resources/tools/jbws1260/scenario_Q test/resources/tools/jbws1260/scenario_R
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2006-12-16 13:01:08 -0500 (Sat, 16 Dec 2006)
New Revision: 1661
Modified:
branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_AA/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_G/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_H/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_I/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_P/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_Q/wrapped-mapping.xml
branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_R/wrapped-mapping.xml
Log:
JBWS-1260 - Removed checks for mapping arrays as anonymous types.
Modified: branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2006-12-16 18:01:08 UTC (rev 1661)
@@ -653,7 +653,7 @@
{
XSElementDeclaration xe = (XSElementDeclaration)xsterm;
XSTypeDefinition typeDefinition = xe.getTypeDefinition();
- addJavaXMLTypeMap(typeDefinition, xe.getName(), containingElement, containingType, jwm, true);
+ addJavaXMLTypeMap(typeDefinition, xe.getName(), containingElement, containingType, jwm, !isDocStyle());
}
}
}
Modified: branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2006-12-16 18:01:08 UTC (rev 1661)
@@ -134,12 +134,11 @@
private boolean validateJavaXmlTypeMappings(JavaXmlTypeMapping[] jm1, JavaXmlTypeMapping[] jm2)
{
- boolean bool = true;
int len1 = jm1 != null ? jm1.length : 0;
int len2 = jm2 != null ? jm2.length : 0;
if (len1 != len2)
{
- throw new IllegalStateException("Length of JavaXmlTypeMapping[] do not match");
+ throw new IllegalStateException("Length of JavaXmlTypeMapping[] do not match expected=" + len1 + " actual=" + len2);
}
// Don't need the order to be the same so cope with this.
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_AA/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_AA/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_AA/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -62,16 +62,19 @@
<xml-element-name>text</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>org.jboss.test.ws.jbws1260.Telephone[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>TelephoneNumber>Number>...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>org.jboss.test.ws.jbws1260.Title[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>Person>Name>surname[1,u...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_G/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_G/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_G/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -26,16 +26,19 @@
<xml-element-name>surname</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookupResponse>number[1,un...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookup>surname[1,unbounded]</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_H/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_H/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_H/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -26,16 +26,19 @@
<xml-element-name>surname</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:TelephoneNumber>number[1,unbou...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:Person>surname[1,unbounded]</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_I/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_I/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_I/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -44,16 +44,19 @@
<xml-element-name>Name</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>Person>Name>surname[1,u...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>TelephoneNumber>Number>...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_P/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_P/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_P/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -34,16 +34,19 @@
<xml-element-name>number</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookup>surname[1,unbounded]</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>lookupResponse>number[1,un...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_Q/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_Q/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_Q/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -34,16 +34,19 @@
<xml-element-name>number</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:Person>surname[1,unbounded]</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:TelephoneNumber>number[1,unbou...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
Modified: branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_R/wrapped-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_R/wrapped-mapping.xml 2006-12-15 15:59:56 UTC (rev 1660)
+++ branches/dlofthouse/JBWS-1260/src/test/resources/tools/jbws1260/scenario_R/wrapped-mapping.xml 2006-12-16 18:01:08 UTC (rev 1661)
@@ -52,16 +52,19 @@
<xml-element-name>number</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
- <java-xml-type-mapping>
+
+ <!-- Anonymous wrapping of arrays not required for JBossWS -->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>Person>Name>surname[1,u...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
+ </java-xml-type-mapping-->
+ <!--java-xml-type-mapping>
<java-type>java.lang.String[]</java-type>
<anonymous-type-qname>http://test.jboss.org/ws/jbws1260/types:>TelephoneNumber>Number>...</anonymous-type-qname>
<qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
+ </java-xml-type-mapping-->
+
<service-interface-mapping>
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
<wsdl-service-name xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceNS:PhoneBook</wsdl-service-name>
19 years, 4 months
JBossWS SVN: r1660 - in trunk: . src/main/java/javax/xml/soap src/main/java/javax/xml/ws/spi src/main/java/org/jboss/ws/core/jaxws src/main/java/org/jboss/ws/core/server src/main/java/org/jboss/ws/core/utils src/main/java/org/jboss/ws/metadata/wsdl/xmlschema src/main/java/org/jboss/ws/tools src/main/java/org/jboss/ws/tools/wsdl src/test/java/org/jboss/test/ws/jaxws/provider src/test/resources/jaxws/eardeployment/WEB-INF/wsdl
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 10:59:56 -0500 (Fri, 15 Dec 2006)
New Revision: 1660
Added:
trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd
Removed:
trunk/src/main/java/org/jboss/ws/core/jaxws/util/
Modified:
trunk/
trunk/src/main/java/javax/xml/soap/FactoryLoader.java
trunk/src/main/java/javax/xml/soap/MessageFactory.java
trunk/src/main/java/javax/xml/soap/SOAPFactory.java
trunk/src/main/java/javax/xml/ws/spi/Provider.java
trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java
trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl
Log:
Fix handling of wsdl/xsd imports. It now also uses ResourceURL
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
-
clipboard.xml
output
output-eclipse
thirdparty
ant.properties
version.properties.md5
clipboard.txt
+
clipboard.xml
output
output-eclipse
thirdparty
ant.properties
version.properties.md5
clipboard.txt
.settings
Modified: trunk/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -41,7 +41,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 14-Dec-2006
*/
-class FactoryLoader
+public class FactoryLoader
{
// provide logging
private static Logger log = Logger.getLogger(MessageFactory.class);
@@ -60,7 +60,7 @@
*
* @return the factory impl, or null
*/
- static Object loadFactory(String propertyName, String defaultFactory) throws SOAPException
+ public static Object loadFactory(String propertyName, String defaultFactory)
{
Object factory = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
@@ -78,7 +78,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
@@ -105,7 +105,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
}
@@ -119,7 +119,7 @@
{
try
{
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
factoryName = br.readLine();
br.close();
if (factoryName != null)
@@ -131,7 +131,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
}
@@ -148,7 +148,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
Modified: trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -66,8 +66,16 @@
*/
public static MessageFactory newInstance() throws SOAPException
{
- String propertyName = "javax.xml.soap.MessageFactory";
- MessageFactory factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
+ MessageFactory factory = null;
+ try
+ {
+ String propertyName = "javax.xml.soap.MessageFactory";
+ factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
+ }
+ catch (RuntimeException rte)
+ {
+ throw new SOAPException(rte);
+ }
// Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
if (factory == null)
Modified: trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -58,8 +58,15 @@
{
if (soapFactory == null)
{
- String propertyName = "javax.xml.soap.SOAPFactory";
- soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+ try
+ {
+ String propertyName = "javax.xml.soap.SOAPFactory";
+ soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+ }
+ catch (RuntimeException rte)
+ {
+ throw new SOAPException(rte);
+ }
// Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
if (soapFactory == null)
Modified: trunk/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -26,6 +26,7 @@
import java.util.List;
import javax.xml.namespace.QName;
+import javax.xml.soap.FactoryLoader;
import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
@@ -33,7 +34,6 @@
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import org.jboss.ws.core.jaxws.util.FactoryFinder;
import org.w3c.dom.Element;
/**
@@ -47,258 +47,255 @@
public static final String JAXWSPROVIDER_PROPERTY = "javax.xml.ws.spi.Provider";
private static final String DEFAULT_JAXWSPROVIDER = "org.jboss.ws.core.jaxws.spi.ProviderImpl";
- /**
- * Creates a new instance of Provider
- */
- protected Provider() {
- }
-
- /**
- *
- * Creates a new provider object.
- * <p>
- * The algorithm used to locate the provider subclass to use consists
- * of the following steps:
- * <p>
- * <ul>
- * <li>
- * If a resource with the name of
- * <code>META-INF/services/javax.xml.ws.spi.Provider</code>
- * exists, then its first line, if present, is used as the UTF-8 encoded
- * name of the implementation class.
- * </li>
- * <li>
- * If the $java.home/lib/jaxws.properties file exists and it is readable by
- * the <code>java.util.Properties.load(InputStream)</code> method and it contains
- * an entry whose key is <code>javax.xml.ws.spi.Provider</code>, then the value of
- * that entry is used as the name of the implementation class.
- * </li>
- * <li>
- * If a system property with the name <code>javax.xml.ws.spi.Provider</code>
- * is defined, then its value is used as the name of the implementation class.
- * </li>
- * <li>
- * Finally, a default implementation class name is used.
- * </li>
- * </ul>
- *
- */
- public static Provider provider() {
- try {
- return (Provider)
- FactoryFinder.find(JAXWSPROVIDER_PROPERTY,
- DEFAULT_JAXWSPROVIDER);
- } catch (WebServiceException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new WebServiceException("Unable to createEndpointReference Provider: "+
- ex.getMessage());
- }
-
- }
-
- /**
- * Creates a service delegate object.
- * <p>
- * @param wsdlDocumentLocation A URL pointing to the WSDL document
- * for the service, or <code>null</code> if there isn't one.
- * @param serviceName The qualified name of the service.
- * @param serviceClass The service class, which MUST be either
- * <code>javax.xml.ws.Service</code> or a subclass thereof.
- * @return The newly created service delegate.
- */
- public abstract ServiceDelegate createServiceDelegate(
- java.net.URL wsdlDocumentLocation,
- QName serviceName, Class serviceClass);
-
-
- /**
- *
- * Creates an endpoint object with the provided binding and implementation
- * object.
- *
- * @param bindingId A URI specifying the desired binding (e.g. SOAP/HTTP)
- * @param implementor A service implementation object to which
- * incoming requests will be dispatched. The corresponding
- * class MUST be annotated with all the necessary Web service
- * annotations.
- * @return The newly created endpoint.
- */
- public abstract Endpoint createEndpoint(String bindingId,
- Object implementor);
-
-
- /**
- * Creates and publishes an endpoint object with the specified
- * address and implementation object.
- *
- * @param address A URI specifying the address and transport/protocol
- * to use. A http: URI MUST result in the SOAP 1.1/HTTP
- * binding being used. Implementations may support other
- * URI schemes.
- * @param implementor A service implementation object to which
- * incoming requests will be dispatched. The corresponding
- * class MUST be annotated with all the necessary Web service
- * annotations.
- * @return The newly created endpoint.
- */
- public abstract Endpoint createAndPublishEndpoint(String address,
- Object implementor);
- /**
- * read an EndpointReference from the infoset contained in
- * <code>eprInfoset</code>.
- *
- * @returns the <code>EndpointReference</code> unmarshalled from
- * <code>eprInfoset</code>. This method never returns <code>null</code>.
- *
- * @throws WebServiceException If there is an error creating the
- * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
- *
- * @throws NullPointerException If the <code>null</code>
- * <code>eprInfoset</code> value is given.
- *
- * @since JAX-WS 2.1
- **/
- public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
-
- /**
- * Create an EndpointReference for <code>serviceName</code>
- * service and <code>portName</code> port from the WSDL <code>wsdlDocumentLocation</code>. The instance
- * returned will be of type <code>clazz</code> and contain the <code>referenceParameters</code>
- * reference parameters. This method delegates to the vendor specific
- * implementation of the {@link javax.xml.ws.spi.Provider#createEndpointReference(Class<T>, javax.xml.namespace.QName, javax.xml.namespace.QName, javax.xml.transform.Source, org.w3c.dom.Element...)} method.
- *
- * @param clazz Specifies the type of <code>EndpointReference</code> that MUST be returned.
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param wsdlDocumentLocation URL for the WSDL document location for the service.
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- *
- * @return the EndpointReference created from <code>serviceName</code>, <code>portName</code>,
- * <code>wsdlDocumentLocation</code> and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- * @throws WebServiceException
- * <UL>
- * <li>If the <code>serviceName</code> service is not present in the WSDL.
- * <li>If the <code>portName</code> port is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> does not represent a valid WSDL.
- * <li>If an error occurs while creating the <code>EndpointReference</code>.
- * <li>If the Class <code>clazz</code> is not supported by this implementation.
- * </UL>
- * @throws java.lang.IllegalArgumentException
- * if any of the <code>clazz</code>, <code>serviceName</code>, <code>portName</code> and <code>wsdlDocumentLocation</code> is null.
- */
- public abstract <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation, Element... referenceParameters);
-
-
- /**
- * The getPort method returns a proxy. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * The parameter <code>endpointReference</code> specifies the
- * endpoint that will be invoked by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL Metadata from the <code>EndpointReference</code>.
- *
- *
- * @param endpointReference the EndpointReference that will
- * be invoked by the returned proxy.
- * @param serviceEndpointInterface Service endpoint interface
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface
- * @throws WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If this
- * <code>endpointReference</code>
- * is illegal
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified
- * <LI>If feature is enabled that is not compatible with
- * this port or is unsupported.
- * </UL>
- *
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(EndpointReference endpointReference,
- Class<T> serviceEndpointInterface,
- WebServiceFeature... features);
-
- /**
- * Factory method to create a <code>W3CEndpointReference</code>.
- *
- * <p>
- * This method can be used to create a <code>W3CEndpointReference</code>
- * for any endpoint by specifying the <code>address</code> property along
- * with any other desired properties. This method
- * can also be used to create a <code>W3CEndpointReference</code> for
- * an endpoint that is published by the same Java EE application.
- * To do so the <code>address</code> property can be provided or this
- * method can automatically determine the <code>address</code> of
- * an endpoint that is published by the same Java EE application and is
- * identified by the <code>serviceName</code> and
- * <code>portName</code> propeties. If the <code>address</code> is
- * <code>null</code> and the <code>serviceName</code> and
- * <code>portName</code> do not identify an endpoint published by the
- * same Java EE application, a
- * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
- *
- * @param address Specifies the address of the target endpoint
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param metadata A list of elements that should be added to the
- * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
- * element.
- * @param wsdlDocumentLocation URL for the WSDL document location for
- * the service.
- * @param referenceParameters Reference parameters to be associated
- * with the returned <code>EndpointReference</code> instance.
- *
- * @return the <code>W3CEndpointReference<code> created from
- * <code>serviceName</code>, <code>portName</code>,
- * <code>metadata</code>, <code>wsdlDocumentLocation</code>
- * and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- *
- * @throws javax.lang.IllegalArgumentException
- * <ul>
- * <li>If the <code>address</code>, <code>serviceName</code> and
- * <code>portName</code> are all <code>null</code>.
- * <li>If the <code>serviceName</code> service is <code>null</code> and the
- * <code>portName> is NOT <code>null</code>.
- * <li>If the <code>address</code> property is <code>null</code> and
- * the <code>serviceName</code> and <code>portName</code> do not
- * specify a valid endpoint published by the same Java EE
- * application.
- * <li>If the <code>serviceName</code>is NOT <code>null</code>
- * and is not present in the specified WSDL.
- * <li>If the <code>portName</code> port is not <code>null<code> and it
- * is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
- * and does not represent a valid WSDL.
- * </ul>
- * @throws WebServiceException If an error occurs while creating the
- * <code>W3CEndpointReference</code>.
- *
- * @since JAX-WS 2.1
- */
- public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName,
- List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters);
+ /**
+ * Creates a new instance of Provider
+ */
+ protected Provider()
+ {
+ }
+
+ /**
+ *
+ * Creates a new provider object.
+ * <p>
+ * The algorithm used to locate the provider subclass to use consists
+ * of the following steps:
+ * <p>
+ * <ul>
+ * <li>
+ * If a resource with the name of
+ * <code>META-INF/services/javax.xml.ws.spi.Provider</code>
+ * exists, then its first line, if present, is used as the UTF-8 encoded
+ * name of the implementation class.
+ * </li>
+ * <li>
+ * If the $java.home/lib/jaxws.properties file exists and it is readable by
+ * the <code>java.util.Properties.load(InputStream)</code> method and it contains
+ * an entry whose key is <code>javax.xml.ws.spi.Provider</code>, then the value of
+ * that entry is used as the name of the implementation class.
+ * </li>
+ * <li>
+ * If a system property with the name <code>javax.xml.ws.spi.Provider</code>
+ * is defined, then its value is used as the name of the implementation class.
+ * </li>
+ * <li>
+ * Finally, a default implementation class name is used.
+ * </li>
+ * </ul>
+ *
+ */
+ public static Provider provider()
+ {
+ try
+ {
+ return (Provider)FactoryLoader.loadFactory(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER);
+ }
+ catch (WebServiceException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException("Unable to createEndpointReference Provider: " + ex.getMessage());
+ }
+
+ }
+
+ /**
+ * Creates a service delegate object.
+ * <p>
+ * @param wsdlDocumentLocation A URL pointing to the WSDL document
+ * for the service, or <code>null</code> if there isn't one.
+ * @param serviceName The qualified name of the service.
+ * @param serviceClass The service class, which MUST be either
+ * <code>javax.xml.ws.Service</code> or a subclass thereof.
+ * @return The newly created service delegate.
+ */
+ public abstract ServiceDelegate createServiceDelegate(java.net.URL wsdlDocumentLocation, QName serviceName, Class serviceClass);
+
+ /**
+ *
+ * Creates an endpoint object with the provided binding and implementation
+ * object.
+ *
+ * @param bindingId A URI specifying the desired binding (e.g. SOAP/HTTP)
+ * @param implementor A service implementation object to which
+ * incoming requests will be dispatched. The corresponding
+ * class MUST be annotated with all the necessary Web service
+ * annotations.
+ * @return The newly created endpoint.
+ */
+ public abstract Endpoint createEndpoint(String bindingId, Object implementor);
+
+ /**
+ * Creates and publishes an endpoint object with the specified
+ * address and implementation object.
+ *
+ * @param address A URI specifying the address and transport/protocol
+ * to use. A http: URI MUST result in the SOAP 1.1/HTTP
+ * binding being used. Implementations may support other
+ * URI schemes.
+ * @param implementor A service implementation object to which
+ * incoming requests will be dispatched. The corresponding
+ * class MUST be annotated with all the necessary Web service
+ * annotations.
+ * @return The newly created endpoint.
+ */
+ public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);
+
+ /**
+ * read an EndpointReference from the infoset contained in
+ * <code>eprInfoset</code>.
+ *
+ * @returns the <code>EndpointReference</code> unmarshalled from
+ * <code>eprInfoset</code>. This method never returns <code>null</code>.
+ *
+ * @throws WebServiceException If there is an error creating the
+ * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
+ *
+ * @throws NullPointerException If the <code>null</code>
+ * <code>eprInfoset</code> value is given.
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
+
+ /**
+ * Create an EndpointReference for <code>serviceName</code>
+ * service and <code>portName</code> port from the WSDL <code>wsdlDocumentLocation</code>. The instance
+ * returned will be of type <code>clazz</code> and contain the <code>referenceParameters</code>
+ * reference parameters. This method delegates to the vendor specific
+ * implementation of the {@link javax.xml.ws.spi.Provider#createEndpointReference(Class<T>, javax.xml.namespace.QName, javax.xml.namespace.QName, javax.xml.transform.Source, org.w3c.dom.Element...)} method.
+ *
+ * @param clazz Specifies the type of <code>EndpointReference</code> that MUST be returned.
+ * @param serviceName Qualified name of the service in the WSDL.
+ * @param portName Qualified name of the endpoint in the WSDL.
+ * @param wsdlDocumentLocation URL for the WSDL document location for the service.
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ *
+ * @return the EndpointReference created from <code>serviceName</code>, <code>portName</code>,
+ * <code>wsdlDocumentLocation</code> and <code>referenceParameters</code>. This method
+ * never returns <code>null</code>.
+ * @throws WebServiceException
+ * <UL>
+ * <li>If the <code>serviceName</code> service is not present in the WSDL.
+ * <li>If the <code>portName</code> port is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> does not represent a valid WSDL.
+ * <li>If an error occurs while creating the <code>EndpointReference</code>.
+ * <li>If the Class <code>clazz</code> is not supported by this implementation.
+ * </UL>
+ * @throws java.lang.IllegalArgumentException
+ * if any of the <code>clazz</code>, <code>serviceName</code>, <code>portName</code> and <code>wsdlDocumentLocation</code> is null.
+ */
+ public abstract <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation,
+ Element... referenceParameters);
+
+ /**
+ * The getPort method returns a proxy. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * The parameter <code>endpointReference</code> specifies the
+ * endpoint that will be invoked by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL Metadata from the <code>EndpointReference</code>.
+ *
+ *
+ * @param endpointReference the EndpointReference that will
+ * be invoked by the returned proxy.
+ * @param serviceEndpointInterface Service endpoint interface
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If this
+ * <code>endpointReference</code>
+ * is illegal
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified
+ * <LI>If feature is enabled that is not compatible with
+ * this port or is unsupported.
+ * </UL>
+ *
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ /**
+ * Factory method to create a <code>W3CEndpointReference</code>.
+ *
+ * <p>
+ * This method can be used to create a <code>W3CEndpointReference</code>
+ * for any endpoint by specifying the <code>address</code> property along
+ * with any other desired properties. This method
+ * can also be used to create a <code>W3CEndpointReference</code> for
+ * an endpoint that is published by the same Java EE application.
+ * To do so the <code>address</code> property can be provided or this
+ * method can automatically determine the <code>address</code> of
+ * an endpoint that is published by the same Java EE application and is
+ * identified by the <code>serviceName</code> and
+ * <code>portName</code> propeties. If the <code>address</code> is
+ * <code>null</code> and the <code>serviceName</code> and
+ * <code>portName</code> do not identify an endpoint published by the
+ * same Java EE application, a
+ * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
+ *
+ * @param address Specifies the address of the target endpoint
+ * @param serviceName Qualified name of the service in the WSDL.
+ * @param portName Qualified name of the endpoint in the WSDL.
+ * @param metadata A list of elements that should be added to the
+ * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
+ * element.
+ * @param wsdlDocumentLocation URL for the WSDL document location for
+ * the service.
+ * @param referenceParameters Reference parameters to be associated
+ * with the returned <code>EndpointReference</code> instance.
+ *
+ * @return the <code>W3CEndpointReference<code> created from
+ * <code>serviceName</code>, <code>portName</code>,
+ * <code>metadata</code>, <code>wsdlDocumentLocation</code>
+ * and <code>referenceParameters</code>. This method
+ * never returns <code>null</code>.
+ *
+ * @throws javax.lang.IllegalArgumentException
+ * <ul>
+ * <li>If the <code>address</code>, <code>serviceName</code> and
+ * <code>portName</code> are all <code>null</code>.
+ * <li>If the <code>serviceName</code> service is <code>null</code> and the
+ * <code>portName> is NOT <code>null</code>.
+ * <li>If the <code>address</code> property is <code>null</code> and
+ * the <code>serviceName</code> and <code>portName</code> do not
+ * specify a valid endpoint published by the same Java EE
+ * application.
+ * <li>If the <code>serviceName</code>is NOT <code>null</code>
+ * and is not present in the specified WSDL.
+ * <li>If the <code>portName</code> port is not <code>null<code> and it
+ * is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+ * and does not represent a valid WSDL.
+ * </ul>
+ * @throws WebServiceException If an error occurs while creating the
+ * <code>W3CEndpointReference</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+ public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata,
+ String wsdlDocumentLocation, List<Element> referenceParameters);
}
Modified: trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -26,10 +26,9 @@
import java.util.HashMap;
import java.util.Map;
+import javax.xml.soap.FactoryLoader;
import javax.xml.ws.Endpoint;
-import org.jboss.ws.core.jaxws.util.FactoryFinder;
-
/**
* An abstract HTTP Server
*
@@ -54,7 +53,7 @@
*/
public static HttpServer create()
{
- HttpServer server = (HttpServer)FactoryFinder.find(HTTP_SERVER_PROPERTY, DEFAULT_HTTP_SERVER_PROPERTY);
+ HttpServer server = (HttpServer)FactoryLoader.loadFactory(HTTP_SERVER_PROPERTY, DEFAULT_HTTP_SERVER_PROPERTY);
return server;
}
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -44,6 +44,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
@@ -214,7 +215,8 @@
resourcePath = resourcePath + "/";
resourcePath = expLocation + resourcePath + schemaLocation;
- InputStream is = udi.classLoader.getResourceAsStream(resourcePath);
+ URL resourceURL = udi.getMetaDataFile(resourcePath);
+ InputStream is = new ResourceURL(resourceURL).openStream();
if (is == null)
throw new IllegalArgumentException("Cannot find schema import in deployment: " + resourcePath);
Modified: trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -24,6 +24,8 @@
// $Id$
import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.logging.Logger;
@@ -47,7 +49,7 @@
registerEntity("urn:jboss:jaxrpc-config:2.0", "schema/jaxrpc-config_2_0.xsd");
registerEntity("urn:jboss:jaxws-config:2.0", "schema/jaxws-config_2_0.xsd");
registerEntity("http://java.sun.com/xml/ns/javaee", "schema/javaee_web_services_1_2.xsd");
- registerEntity("http://www.w3.org/2005/08/addressing", "schema/ws-addr.xsd");
+ registerEntity("http://www.w3.org/2005/08/addressing", "schema/ws-addr.xsd");
registerEntity("http://schemas.xmlsoap.org/ws/2004/08/eventing", "eventing.xsd");
}
@@ -55,28 +57,62 @@
{
log.debug("resolveEntity: [pub=" + publicId + ",sysid=" + systemId + "]");
InputSource inputSource = super.resolveEntity(publicId, systemId);
+
+ if (inputSource == null)
+ {
+ inputSource = resolveSystemIDasURL(systemId, log.isTraceEnabled());
+ }
+
return inputSource;
}
-
- public URL resolveNamespaceURI(String nsURI)
+
+ /** This method should be protected in the super class. */
+ protected InputSource resolveSystemIDasURL(String systemId, boolean trace)
{
- URL url = null;
-
- String resource = (String)getEntityMap().get(nsURI);
- if (resource != null)
+ if (systemId == null)
+ return null;
+
+ if (trace)
+ log.trace("resolveSystemIDasURL, systemId=" + systemId);
+
+ InputSource inputSource = null;
+
+ // Try to use the systemId as a URL to the schema
+ try
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- url = loader.getResource(resource);
- if( url == null )
+ if (trace)
+ log.trace("Trying to resolve systemId as a URL");
+
+ URL url = new URL(systemId);
+ if (url.getProtocol().equalsIgnoreCase("file") == false)
{
- if( resource.endsWith(".dtd") )
- resource = "dtd/" + resource;
- else if( resource.endsWith(".xsd") )
- resource = "schema/" + resource;
- url = loader.getResource(resource);
+ log.warn("Trying to resolve systemId as a non-file URL: " + systemId);
}
+
+ InputStream ins = new ResourceURL(url).openStream();
+ if (ins != null)
+ {
+ inputSource = new InputSource(ins);
+ inputSource.setSystemId(systemId);
+ }
+ else
+ {
+ log.warn("Cannot load systemId as URL: " + systemId);
+ }
+
+ if (trace)
+ log.trace("Resolved systemId as a URL");
}
-
- return url;
+ catch (MalformedURLException ignored)
+ {
+ if (trace)
+ log.trace("SystemId is not a url: " + systemId, ignored);
+ }
+ catch (IOException e)
+ {
+ if (trace)
+ log.trace("Failed to obtain URL.InputStream from systemId: " + systemId, e);
+ }
+ return inputSource;
}
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -35,6 +35,7 @@
import org.apache.xerces.xni.parser.XMLInputSource;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.ResourceURL;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -162,7 +163,7 @@
private XMLInputSource getXMLInputSource(URL url, XMLResourceIdentifier resId) throws IOException
{
- InputStream inputStream = url.openStream();
+ InputStream inputStream = new ResourceURL(url).openStream();
InputSource inputSource = new InputSource(inputStream);
return getXMLInputSource(inputSource, resId);
}
Modified: trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -31,16 +31,19 @@
import javax.xml.namespace.QName;
+import org.apache.xerces.impl.xs.SchemaGrammar;
import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.impl.xs.XSModelImpl;
+import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSStringList;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.helpers.JavaToXSDHelper;
@@ -129,11 +132,11 @@
JBossWSEntityResolver resolver = new JBossWSEntityResolver();
JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, new HashMap<String, URL>());
XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);
-
+
XSModel xsmodel = loader.loadURI(xsdURL.toExternalForm());
if (xsmodel == null)
throw new WSException("Cannot load schema: " + xsdURL);
-
+
WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
JBossXSModel jbxs = new JBossXSModel();
sutils.copyXSModel(xsmodel, jbxs);
@@ -154,34 +157,61 @@
JBossWSEntityResolver resolver = new JBossWSEntityResolver();
JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, locs);
XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);
-
- JBossXSStringList slist = new JBossXSStringList();
- Iterator<String> keys = locs.keySet().iterator();
- while (keys.hasNext())
+
+ int index = 0;
+ SchemaGrammar[] gs = new SchemaGrammar[locs.size()];
+ Iterator<String> it = locs.keySet().iterator();
+ while (it.hasNext())
{
- String nsURI = keys.next();
- URL orgURL = locs.get(nsURI);
- URL resURL = resolver.resolveNamespaceURI(nsURI);
- URL url = resURL != null ? resURL : orgURL;
- log.debug("load schema: " + nsURI + "=" + url);
- slist.addItem(url.toExternalForm());
+ try
+ {
+ String nsURI = it.next();
+ URL orgURL = locs.get(nsURI);
+ URL resURL = resolveNamespaceURI(resolver, nsURI);
+ URL url = resURL != null ? resURL : orgURL;
+ log.debug("Load schema: " + nsURI + "=" + url);
+ XMLInputSource inputSource = new XMLInputSource(null, url.toExternalForm(), null);
+ inputSource.setByteStream(new ResourceURL(url).openStream());
+ gs[index++] = (SchemaGrammar)loader.loadGrammar(inputSource);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot parse schema", ex);
+ return null;
+ }
}
-
- XSModel xsmodel = loader.loadURIList(slist);
- if (xsmodel == null)
- throw new WSException("Cannot load schema: " + slist);
+ XSModel xsmodel = new XSModelImpl(gs);
- //TODO: Once JBXB-33 is fixed, migrate Schema Parsing to XB
- //XSModel xsmodel = Util.loadSchema(slist,this.getSchemaBindingResolver(locs));
-
// Convert Xerces XSModel into r/w JBossXSModel
WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
JBossXSModel jbxs = new JBossXSModel();
sutils.copyXSModel(xsmodel, jbxs);
-
+
return jbxs;
}
+ private URL resolveNamespaceURI(JBossWSEntityResolver resolver, String nsURI)
+ {
+ URL url = null;
+
+ String resource = (String)resolver.getEntityMap().get(nsURI);
+ if (resource != null)
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ url = loader.getResource(resource);
+ if (url == null)
+ {
+ if (resource.endsWith(".dtd"))
+ resource = "dtd/" + resource;
+ else if (resource.endsWith(".xsd"))
+ resource = "schema/" + resource;
+ url = loader.getResource(resource);
+ }
+ }
+
+ return url;
+ }
+
/**
* @see org.jboss.ws.tools.interfaces.JavaToXSDIntf#setPackageNamespaceMap(java.util.Map)
*/
@@ -207,7 +237,8 @@
*/
private SchemaBindingResolver getSchemaBindingResolver(final Map<String, URL> map)
{
- return new SchemaBindingResolver() {
+ return new SchemaBindingResolver()
+ {
public String getBaseURI()
{
throw new UnsupportedOperationException("getBaseURI is not implemented.");
Modified: trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -70,6 +70,7 @@
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
@@ -320,7 +321,7 @@
throw new IllegalArgumentException("schemaLocation is null for xsd:import");
URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
+ Element rootElement = DOMUtils.parse(new ResourceURL(locationURL).openStream());
URL newloc = processSchemaInclude(types, locationURL, rootElement);
if (newloc != null)
importEl.setAttribute("schemaLocation", newloc.toExternalForm());
@@ -354,7 +355,7 @@
throw new IllegalArgumentException("schemaLocation is null for xsd:include");
URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
+ Element rootElement = DOMUtils.parse(new ResourceURL(locationURL).openStream());
URL newloc = processSchemaInclude(types, locationURL, rootElement);
if (newloc != null)
includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/provider/ProviderBeanPayload.java 2006-12-15 15:59:56 UTC (rev 1660)
@@ -24,40 +24,43 @@
// $Id$
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.Provider;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceProvider;
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
-import org.w3c.dom.Element;
-
/**
* Test a Provider<Source>
*
* @author Thomas.Diesler(a)jboss.org
* @since 29-Jun-2006
*/
-@WebServiceProvider(
- serviceName = "ProviderService",
- portName = "ProviderPort",
- targetNamespace = "http://org.jboss.ws/provider",
- wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
-// in absence PAYLOAD is implicit
-// @ServiceMode(value = Service.Mode.PAYLOAD)
+@WebServiceProvider(serviceName = "ProviderService", portName = "ProviderPort", targetNamespace = "http://org.jboss.ws/provider", wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
+// @ServiceMode(value = Service.Mode.PAYLOAD) in absence PAYLOAD is implicit
public class ProviderBeanPayload implements Provider<Source>
{
public Source invoke(Source req)
{
try
{
- Element reqPayload = DOMUtils.parse(((StreamSource)req).getInputStream());
- String xmlReq = DOMWriter.printNode(reqPayload, false);
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml");
+ OutputStream out = new ByteArrayOutputStream();
+ StreamResult streamResult = new StreamResult();
+ streamResult.setOutputStream(out);
+ transformer.transform(req, streamResult);
+ String xmlReq = streamResult.getOutputStream().toString();
- String expReq = "<ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>";
+ String expReq = "<ns1:somePayload xmlns:ns1=\"http://org.jboss.ws/provider\"/>";
if (!expReq.equals(xmlReq))
throw new WebServiceException("Unexpected payload: " + xmlReq);
Modified: trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl
===================================================================
--- trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl 2006-12-15 14:53:18 UTC (rev 1659)
+++ trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl 2006-12-15 15:59:56 UTC (rev 1660)
@@ -7,7 +7,12 @@
-->
<definitions name="TestEndpointService" targetNamespace="http://eardeployment.jaxws.ws.test.jboss.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://eardeployment.jaxws.ws.test.jboss.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types/>
+
+ <!-- Test a schema import -->
+ <types>
+ <xsd:import namespace="http://org.jboss.ws/jaxrpc/types" schemaLocation="TestService.xsd"/>
+ </types>
+
<message name="TestEndpoint_echoResponse">
<part name="return" type="xsd:string"/>
</message>
Copied: trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd (from rev 1659, branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd)
19 years, 4 months
JBossWS SVN: r1659 - in branches/tdiesler/trunk: . src/main/java/org/jboss/ws/tools
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 09:53:18 -0500 (Fri, 15 Dec 2006)
New Revision: 1659
Modified:
branches/tdiesler/trunk/.classpath
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
Log:
Fix handling of imported wsdl resources
Modified: branches/tdiesler/trunk/.classpath
===================================================================
--- branches/tdiesler/trunk/.classpath 2006-12-15 13:30:24 UTC (rev 1658)
+++ branches/tdiesler/trunk/.classpath 2006-12-15 14:53:18 UTC (rev 1659)
@@ -8,7 +8,7 @@
<classpathentry kind="lib" path="thirdparty/qdox.jar"/>
<classpathentry kind="lib" path="thirdparty/servlet-api.jar"/>
<classpathentry kind="lib" path="thirdparty/wsdl4j.jar"/>
- <classpathentry kind="lib" path="thirdparty/xercesImpl.jar"/>
+ <classpathentry kind="lib" path="thirdparty/xercesImpl.jar" sourcepath="/home/tdiesler/workspace/xerces-2_9_0/src"/>
<classpathentry kind="lib" path="thirdparty/xml-apis.jar"/>
<classpathentry kind="lib" path="thirdparty/xmlsec.jar"/>
<classpathentry kind="lib" path="thirdparty/xmlunit1.0.jar"/>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 13:30:24 UTC (rev 1658)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 14:53:18 UTC (rev 1659)
@@ -31,16 +31,19 @@
import javax.xml.namespace.QName;
+import org.apache.xerces.impl.xs.SchemaGrammar;
import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.impl.xs.XSModelImpl;
+import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
-import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSStringList;
import org.jboss.ws.metadata.wsdl.xmlschema.WSSchemaUtils;
import org.jboss.ws.metadata.wsdl.xsd.SchemaUtils;
import org.jboss.ws.tools.helpers.JavaToXSDHelper;
@@ -129,11 +132,11 @@
JBossWSEntityResolver resolver = new JBossWSEntityResolver();
JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, new HashMap<String, URL>());
XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);
-
+
XSModel xsmodel = loader.loadURI(xsdURL.toExternalForm());
if (xsmodel == null)
throw new WSException("Cannot load schema: " + xsdURL);
-
+
WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
JBossXSModel jbxs = new JBossXSModel();
sutils.copyXSModel(xsmodel, jbxs);
@@ -154,56 +157,61 @@
JBossWSEntityResolver resolver = new JBossWSEntityResolver();
JBossXSEntityResolver xsresolve = new JBossXSEntityResolver(resolver, locs);
XMLSchemaLoader loader = (XMLSchemaLoader)schemautils.getXSLoader(xserr, xsresolve);
-
- JBossXSStringList slist = new JBossXSStringList();
- Iterator<String> keys = locs.keySet().iterator();
- while (keys.hasNext())
+
+ int index = 0;
+ SchemaGrammar[] gs = new SchemaGrammar[locs.size()];
+ Iterator<String> it = locs.keySet().iterator();
+ while (it.hasNext())
{
- String nsURI = keys.next();
- URL orgURL = locs.get(nsURI);
- URL resURL = resolveNamespaceURI(resolver, nsURI);
- URL url = resURL != null ? resURL : orgURL;
- log.debug("load schema: " + nsURI + "=" + url);
- slist.addItem(url.toExternalForm());
+ try
+ {
+ String nsURI = it.next();
+ URL orgURL = locs.get(nsURI);
+ URL resURL = resolveNamespaceURI(resolver, nsURI);
+ URL url = resURL != null ? resURL : orgURL;
+ log.debug("Load schema: " + nsURI + "=" + url);
+ XMLInputSource inputSource = new XMLInputSource(null, url.toExternalForm(), null);
+ inputSource.setByteStream(new ResourceURL(url).openStream());
+ gs[index++] = (SchemaGrammar)loader.loadGrammar(inputSource);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot parse schema", ex);
+ return null;
+ }
}
-
- XSModel xsmodel = loader.loadURIList(slist);
- if (xsmodel == null)
- throw new WSException("Cannot load schema: " + slist);
+ XSModel xsmodel = new XSModelImpl(gs);
- //TODO: Once JBXB-33 is fixed, migrate Schema Parsing to XB
- //XSModel xsmodel = Util.loadSchema(slist,this.getSchemaBindingResolver(locs));
-
// Convert Xerces XSModel into r/w JBossXSModel
WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
JBossXSModel jbxs = new JBossXSModel();
sutils.copyXSModel(xsmodel, jbxs);
-
+
return jbxs;
}
private URL resolveNamespaceURI(JBossWSEntityResolver resolver, String nsURI)
{
URL url = null;
-
+
String resource = (String)resolver.getEntityMap().get(nsURI);
if (resource != null)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
url = loader.getResource(resource);
- if( url == null )
+ if (url == null)
{
- if( resource.endsWith(".dtd") )
+ if (resource.endsWith(".dtd"))
resource = "dtd/" + resource;
- else if( resource.endsWith(".xsd") )
+ else if (resource.endsWith(".xsd"))
resource = "schema/" + resource;
url = loader.getResource(resource);
}
}
-
+
return url;
}
-
+
/**
* @see org.jboss.ws.tools.interfaces.JavaToXSDIntf#setPackageNamespaceMap(java.util.Map)
*/
@@ -229,7 +237,8 @@
*/
private SchemaBindingResolver getSchemaBindingResolver(final Map<String, URL> map)
{
- return new SchemaBindingResolver() {
+ return new SchemaBindingResolver()
+ {
public String getBaseURI()
{
throw new UnsupportedOperationException("getBaseURI is not implemented.");
19 years, 4 months
JBossWS SVN: r1658 - in branches/tdiesler/trunk: . src/main/java/javax/xml/soap src/main/java/javax/xml/ws/spi src/main/java/org/jboss/ws/core/jaxws src/main/java/org/jboss/ws/core/server src/main/java/org/jboss/ws/core/utils src/main/java/org/jboss/ws/metadata/wsdl/xmlschema src/main/java/org/jboss/ws/tools src/main/java/org/jboss/ws/tools/wsdl src/test/resources/jaxws/eardeployment/WEB-INF/wsdl
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 08:30:24 -0500 (Fri, 15 Dec 2006)
New Revision: 1658
Added:
branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd
Removed:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/jaxws/util/
Modified:
branches/tdiesler/trunk/
branches/tdiesler/trunk/.classpath
branches/tdiesler/trunk/src/main/java/javax/xml/soap/FactoryLoader.java
branches/tdiesler/trunk/src/main/java/javax/xml/soap/MessageFactory.java
branches/tdiesler/trunk/src/main/java/javax/xml/soap/SOAPFactory.java
branches/tdiesler/trunk/src/main/java/javax/xml/ws/spi/Provider.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl
Log:
Fix handling of imported wsdl resources
Property changes on: branches/tdiesler/trunk
___________________________________________________________________
Name: svn:ignore
-
clipboard.xml
output
output-eclipse
thirdparty
ant.properties
version.properties.md5
clipboard.txt
+
clipboard.xml
output
output-eclipse
thirdparty
ant.properties
version.properties.md5
clipboard.txt
.settings
Modified: branches/tdiesler/trunk/.classpath
===================================================================
--- branches/tdiesler/trunk/.classpath 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/.classpath 2006-12-15 13:30:24 UTC (rev 1658)
@@ -29,7 +29,7 @@
<classpathentry kind="lib" path="thirdparty/jaxb-xjc.jar"/>
<classpathentry kind="lib" path="thirdparty/jaxb-impl.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-deployers.jar" sourcepath="/home/tdiesler/svn/jbossmc/trunk/deployers/src/main"/>
- <classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
+ <classpathentry kind="lib" path="thirdparty/jboss-common-core.jar" sourcepath="/home/tdiesler/svn/common/common-core/tags/2.0.3.GA/src/main/java"/>
<classpathentry kind="lib" path="thirdparty/jboss-dependency.jar"/>
<classpathentry kind="lib" path="thirdparty/jboss-logging-spi.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
Modified: branches/tdiesler/trunk/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/soap/FactoryLoader.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -41,7 +41,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 14-Dec-2006
*/
-class FactoryLoader
+public class FactoryLoader
{
// provide logging
private static Logger log = Logger.getLogger(MessageFactory.class);
@@ -60,7 +60,7 @@
*
* @return the factory impl, or null
*/
- static Object loadFactory(String propertyName, String defaultFactory) throws SOAPException
+ public static Object loadFactory(String propertyName, String defaultFactory)
{
Object factory = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
@@ -78,7 +78,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
@@ -105,7 +105,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
}
@@ -119,7 +119,7 @@
{
try
{
- BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
+ BufferedReader br = new BufferedReader(new InputStreamReader(inStream, "UTF-8"));
factoryName = br.readLine();
br.close();
if (factoryName != null)
@@ -131,7 +131,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
}
@@ -148,7 +148,7 @@
}
catch (Throwable t)
{
- throw new SOAPException("Failed to load " + propertyName + ": " + factoryName, t);
+ throw new IllegalStateException("Failed to load " + propertyName + ": " + factoryName, t);
}
}
Modified: branches/tdiesler/trunk/src/main/java/javax/xml/soap/MessageFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/soap/MessageFactory.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -66,8 +66,16 @@
*/
public static MessageFactory newInstance() throws SOAPException
{
- String propertyName = "javax.xml.soap.MessageFactory";
- MessageFactory factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
+ MessageFactory factory = null;
+ try
+ {
+ String propertyName = "javax.xml.soap.MessageFactory";
+ factory = (MessageFactory)FactoryLoader.loadFactory(propertyName, null);
+ }
+ catch (RuntimeException rte)
+ {
+ throw new SOAPException(rte);
+ }
// Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
if (factory == null)
Modified: branches/tdiesler/trunk/src/main/java/javax/xml/soap/SOAPFactory.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/soap/SOAPFactory.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -58,8 +58,15 @@
{
if (soapFactory == null)
{
- String propertyName = "javax.xml.soap.SOAPFactory";
- soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+ try
+ {
+ String propertyName = "javax.xml.soap.SOAPFactory";
+ soapFactory = (SOAPFactory)FactoryLoader.loadFactory(propertyName, null);
+ }
+ catch (RuntimeException rte)
+ {
+ throw new SOAPException(rte);
+ }
// Use the SAAJMetaFactory instance to locate the MessageFactory implementation class.
if (soapFactory == null)
Modified: branches/tdiesler/trunk/src/main/java/javax/xml/ws/spi/Provider.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -26,6 +26,7 @@
import java.util.List;
import javax.xml.namespace.QName;
+import javax.xml.soap.FactoryLoader;
import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
@@ -33,7 +34,6 @@
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
-import org.jboss.ws.core.jaxws.util.FactoryFinder;
import org.w3c.dom.Element;
/**
@@ -47,258 +47,255 @@
public static final String JAXWSPROVIDER_PROPERTY = "javax.xml.ws.spi.Provider";
private static final String DEFAULT_JAXWSPROVIDER = "org.jboss.ws.core.jaxws.spi.ProviderImpl";
- /**
- * Creates a new instance of Provider
- */
- protected Provider() {
- }
-
- /**
- *
- * Creates a new provider object.
- * <p>
- * The algorithm used to locate the provider subclass to use consists
- * of the following steps:
- * <p>
- * <ul>
- * <li>
- * If a resource with the name of
- * <code>META-INF/services/javax.xml.ws.spi.Provider</code>
- * exists, then its first line, if present, is used as the UTF-8 encoded
- * name of the implementation class.
- * </li>
- * <li>
- * If the $java.home/lib/jaxws.properties file exists and it is readable by
- * the <code>java.util.Properties.load(InputStream)</code> method and it contains
- * an entry whose key is <code>javax.xml.ws.spi.Provider</code>, then the value of
- * that entry is used as the name of the implementation class.
- * </li>
- * <li>
- * If a system property with the name <code>javax.xml.ws.spi.Provider</code>
- * is defined, then its value is used as the name of the implementation class.
- * </li>
- * <li>
- * Finally, a default implementation class name is used.
- * </li>
- * </ul>
- *
- */
- public static Provider provider() {
- try {
- return (Provider)
- FactoryFinder.find(JAXWSPROVIDER_PROPERTY,
- DEFAULT_JAXWSPROVIDER);
- } catch (WebServiceException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new WebServiceException("Unable to createEndpointReference Provider: "+
- ex.getMessage());
- }
-
- }
-
- /**
- * Creates a service delegate object.
- * <p>
- * @param wsdlDocumentLocation A URL pointing to the WSDL document
- * for the service, or <code>null</code> if there isn't one.
- * @param serviceName The qualified name of the service.
- * @param serviceClass The service class, which MUST be either
- * <code>javax.xml.ws.Service</code> or a subclass thereof.
- * @return The newly created service delegate.
- */
- public abstract ServiceDelegate createServiceDelegate(
- java.net.URL wsdlDocumentLocation,
- QName serviceName, Class serviceClass);
-
-
- /**
- *
- * Creates an endpoint object with the provided binding and implementation
- * object.
- *
- * @param bindingId A URI specifying the desired binding (e.g. SOAP/HTTP)
- * @param implementor A service implementation object to which
- * incoming requests will be dispatched. The corresponding
- * class MUST be annotated with all the necessary Web service
- * annotations.
- * @return The newly created endpoint.
- */
- public abstract Endpoint createEndpoint(String bindingId,
- Object implementor);
-
-
- /**
- * Creates and publishes an endpoint object with the specified
- * address and implementation object.
- *
- * @param address A URI specifying the address and transport/protocol
- * to use. A http: URI MUST result in the SOAP 1.1/HTTP
- * binding being used. Implementations may support other
- * URI schemes.
- * @param implementor A service implementation object to which
- * incoming requests will be dispatched. The corresponding
- * class MUST be annotated with all the necessary Web service
- * annotations.
- * @return The newly created endpoint.
- */
- public abstract Endpoint createAndPublishEndpoint(String address,
- Object implementor);
- /**
- * read an EndpointReference from the infoset contained in
- * <code>eprInfoset</code>.
- *
- * @returns the <code>EndpointReference</code> unmarshalled from
- * <code>eprInfoset</code>. This method never returns <code>null</code>.
- *
- * @throws WebServiceException If there is an error creating the
- * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
- *
- * @throws NullPointerException If the <code>null</code>
- * <code>eprInfoset</code> value is given.
- *
- * @since JAX-WS 2.1
- **/
- public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
-
- /**
- * Create an EndpointReference for <code>serviceName</code>
- * service and <code>portName</code> port from the WSDL <code>wsdlDocumentLocation</code>. The instance
- * returned will be of type <code>clazz</code> and contain the <code>referenceParameters</code>
- * reference parameters. This method delegates to the vendor specific
- * implementation of the {@link javax.xml.ws.spi.Provider#createEndpointReference(Class<T>, javax.xml.namespace.QName, javax.xml.namespace.QName, javax.xml.transform.Source, org.w3c.dom.Element...)} method.
- *
- * @param clazz Specifies the type of <code>EndpointReference</code> that MUST be returned.
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param wsdlDocumentLocation URL for the WSDL document location for the service.
- * @param referenceParameters Reference parameters to be associated with the
- * returned <code>EndpointReference</code> instance.
- *
- * @return the EndpointReference created from <code>serviceName</code>, <code>portName</code>,
- * <code>wsdlDocumentLocation</code> and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- * @throws WebServiceException
- * <UL>
- * <li>If the <code>serviceName</code> service is not present in the WSDL.
- * <li>If the <code>portName</code> port is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> does not represent a valid WSDL.
- * <li>If an error occurs while creating the <code>EndpointReference</code>.
- * <li>If the Class <code>clazz</code> is not supported by this implementation.
- * </UL>
- * @throws java.lang.IllegalArgumentException
- * if any of the <code>clazz</code>, <code>serviceName</code>, <code>portName</code> and <code>wsdlDocumentLocation</code> is null.
- */
- public abstract <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation, Element... referenceParameters);
-
-
- /**
- * The getPort method returns a proxy. If there
- * are any reference parameters in the
- * <code>endpointReference</code>, then those reference
- * parameters MUST appear as SOAP headers, indicating them to be
- * reference parameters, on all messages sent to the endpoint.
- * The parameter <code>serviceEndpointInterface</code> specifies
- * the service endpoint interface that is supported by the
- * returned proxy.
- * The parameter <code>endpointReference</code> specifies the
- * endpoint that will be invoked by the returned proxy.
- * In the implementation of this method, the JAX-WS
- * runtime system takes the responsibility of selecting a protocol
- * binding (and a port) and configuring the proxy accordingly from
- * the WSDL Metadata from the <code>EndpointReference</code>.
- *
- *
- * @param endpointReference the EndpointReference that will
- * be invoked by the returned proxy.
- * @param serviceEndpointInterface Service endpoint interface
- * @param features A list of WebServiceFeatures to configure on the
- * proxy. Supported features not in the <code>features
- * </code> parameter will have their default values.
- * @return Object Proxy instance that supports the
- * specified service endpoint interface
- * @throws WebServiceException
- * <UL>
- * <LI>If there is an error during creation
- * of the proxy
- * <LI>If there is any missing WSDL metadata
- * as required by this method
- * <LI>If this
- * <code>endpointReference</code>
- * is illegal
- * <LI>If an illegal
- * <code>serviceEndpointInterface</code>
- * is specified
- * <LI>If feature is enabled that is not compatible with
- * this port or is unsupported.
- * </UL>
- *
- * @see WebServiceFeature
- *
- * @since JAX-WS 2.1
- **/
- public abstract <T> T getPort(EndpointReference endpointReference,
- Class<T> serviceEndpointInterface,
- WebServiceFeature... features);
-
- /**
- * Factory method to create a <code>W3CEndpointReference</code>.
- *
- * <p>
- * This method can be used to create a <code>W3CEndpointReference</code>
- * for any endpoint by specifying the <code>address</code> property along
- * with any other desired properties. This method
- * can also be used to create a <code>W3CEndpointReference</code> for
- * an endpoint that is published by the same Java EE application.
- * To do so the <code>address</code> property can be provided or this
- * method can automatically determine the <code>address</code> of
- * an endpoint that is published by the same Java EE application and is
- * identified by the <code>serviceName</code> and
- * <code>portName</code> propeties. If the <code>address</code> is
- * <code>null</code> and the <code>serviceName</code> and
- * <code>portName</code> do not identify an endpoint published by the
- * same Java EE application, a
- * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
- *
- * @param address Specifies the address of the target endpoint
- * @param serviceName Qualified name of the service in the WSDL.
- * @param portName Qualified name of the endpoint in the WSDL.
- * @param metadata A list of elements that should be added to the
- * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
- * element.
- * @param wsdlDocumentLocation URL for the WSDL document location for
- * the service.
- * @param referenceParameters Reference parameters to be associated
- * with the returned <code>EndpointReference</code> instance.
- *
- * @return the <code>W3CEndpointReference<code> created from
- * <code>serviceName</code>, <code>portName</code>,
- * <code>metadata</code>, <code>wsdlDocumentLocation</code>
- * and <code>referenceParameters</code>. This method
- * never returns <code>null</code>.
- *
- * @throws javax.lang.IllegalArgumentException
- * <ul>
- * <li>If the <code>address</code>, <code>serviceName</code> and
- * <code>portName</code> are all <code>null</code>.
- * <li>If the <code>serviceName</code> service is <code>null</code> and the
- * <code>portName> is NOT <code>null</code>.
- * <li>If the <code>address</code> property is <code>null</code> and
- * the <code>serviceName</code> and <code>portName</code> do not
- * specify a valid endpoint published by the same Java EE
- * application.
- * <li>If the <code>serviceName</code>is NOT <code>null</code>
- * and is not present in the specified WSDL.
- * <li>If the <code>portName</code> port is not <code>null<code> and it
- * is not present in <code>serviceName</code> service in the WSDL.
- * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
- * and does not represent a valid WSDL.
- * </ul>
- * @throws WebServiceException If an error occurs while creating the
- * <code>W3CEndpointReference</code>.
- *
- * @since JAX-WS 2.1
- */
- public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName,
- List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters);
+ /**
+ * Creates a new instance of Provider
+ */
+ protected Provider()
+ {
+ }
+
+ /**
+ *
+ * Creates a new provider object.
+ * <p>
+ * The algorithm used to locate the provider subclass to use consists
+ * of the following steps:
+ * <p>
+ * <ul>
+ * <li>
+ * If a resource with the name of
+ * <code>META-INF/services/javax.xml.ws.spi.Provider</code>
+ * exists, then its first line, if present, is used as the UTF-8 encoded
+ * name of the implementation class.
+ * </li>
+ * <li>
+ * If the $java.home/lib/jaxws.properties file exists and it is readable by
+ * the <code>java.util.Properties.load(InputStream)</code> method and it contains
+ * an entry whose key is <code>javax.xml.ws.spi.Provider</code>, then the value of
+ * that entry is used as the name of the implementation class.
+ * </li>
+ * <li>
+ * If a system property with the name <code>javax.xml.ws.spi.Provider</code>
+ * is defined, then its value is used as the name of the implementation class.
+ * </li>
+ * <li>
+ * Finally, a default implementation class name is used.
+ * </li>
+ * </ul>
+ *
+ */
+ public static Provider provider()
+ {
+ try
+ {
+ return (Provider)FactoryLoader.loadFactory(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER);
+ }
+ catch (WebServiceException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException("Unable to createEndpointReference Provider: " + ex.getMessage());
+ }
+
+ }
+
+ /**
+ * Creates a service delegate object.
+ * <p>
+ * @param wsdlDocumentLocation A URL pointing to the WSDL document
+ * for the service, or <code>null</code> if there isn't one.
+ * @param serviceName The qualified name of the service.
+ * @param serviceClass The service class, which MUST be either
+ * <code>javax.xml.ws.Service</code> or a subclass thereof.
+ * @return The newly created service delegate.
+ */
+ public abstract ServiceDelegate createServiceDelegate(java.net.URL wsdlDocumentLocation, QName serviceName, Class serviceClass);
+
+ /**
+ *
+ * Creates an endpoint object with the provided binding and implementation
+ * object.
+ *
+ * @param bindingId A URI specifying the desired binding (e.g. SOAP/HTTP)
+ * @param implementor A service implementation object to which
+ * incoming requests will be dispatched. The corresponding
+ * class MUST be annotated with all the necessary Web service
+ * annotations.
+ * @return The newly created endpoint.
+ */
+ public abstract Endpoint createEndpoint(String bindingId, Object implementor);
+
+ /**
+ * Creates and publishes an endpoint object with the specified
+ * address and implementation object.
+ *
+ * @param address A URI specifying the address and transport/protocol
+ * to use. A http: URI MUST result in the SOAP 1.1/HTTP
+ * binding being used. Implementations may support other
+ * URI schemes.
+ * @param implementor A service implementation object to which
+ * incoming requests will be dispatched. The corresponding
+ * class MUST be annotated with all the necessary Web service
+ * annotations.
+ * @return The newly created endpoint.
+ */
+ public abstract Endpoint createAndPublishEndpoint(String address, Object implementor);
+
+ /**
+ * read an EndpointReference from the infoset contained in
+ * <code>eprInfoset</code>.
+ *
+ * @returns the <code>EndpointReference</code> unmarshalled from
+ * <code>eprInfoset</code>. This method never returns <code>null</code>.
+ *
+ * @throws WebServiceException If there is an error creating the
+ * <code>EndpointReference</code> from the specified <code>eprInfoset</code>.
+ *
+ * @throws NullPointerException If the <code>null</code>
+ * <code>eprInfoset</code> value is given.
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract EndpointReference readEndpointReference(javax.xml.transform.Source eprInfoset);
+
+ /**
+ * Create an EndpointReference for <code>serviceName</code>
+ * service and <code>portName</code> port from the WSDL <code>wsdlDocumentLocation</code>. The instance
+ * returned will be of type <code>clazz</code> and contain the <code>referenceParameters</code>
+ * reference parameters. This method delegates to the vendor specific
+ * implementation of the {@link javax.xml.ws.spi.Provider#createEndpointReference(Class<T>, javax.xml.namespace.QName, javax.xml.namespace.QName, javax.xml.transform.Source, org.w3c.dom.Element...)} method.
+ *
+ * @param clazz Specifies the type of <code>EndpointReference</code> that MUST be returned.
+ * @param serviceName Qualified name of the service in the WSDL.
+ * @param portName Qualified name of the endpoint in the WSDL.
+ * @param wsdlDocumentLocation URL for the WSDL document location for the service.
+ * @param referenceParameters Reference parameters to be associated with the
+ * returned <code>EndpointReference</code> instance.
+ *
+ * @return the EndpointReference created from <code>serviceName</code>, <code>portName</code>,
+ * <code>wsdlDocumentLocation</code> and <code>referenceParameters</code>. This method
+ * never returns <code>null</code>.
+ * @throws WebServiceException
+ * <UL>
+ * <li>If the <code>serviceName</code> service is not present in the WSDL.
+ * <li>If the <code>portName</code> port is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> does not represent a valid WSDL.
+ * <li>If an error occurs while creating the <code>EndpointReference</code>.
+ * <li>If the Class <code>clazz</code> is not supported by this implementation.
+ * </UL>
+ * @throws java.lang.IllegalArgumentException
+ * if any of the <code>clazz</code>, <code>serviceName</code>, <code>portName</code> and <code>wsdlDocumentLocation</code> is null.
+ */
+ public abstract <T extends EndpointReference> T createEndpointReference(Class<T> clazz, QName serviceName, QName portName, Source wsdlDocumentLocation,
+ Element... referenceParameters);
+
+ /**
+ * The getPort method returns a proxy. If there
+ * are any reference parameters in the
+ * <code>endpointReference</code>, then those reference
+ * parameters MUST appear as SOAP headers, indicating them to be
+ * reference parameters, on all messages sent to the endpoint.
+ * The parameter <code>serviceEndpointInterface</code> specifies
+ * the service endpoint interface that is supported by the
+ * returned proxy.
+ * The parameter <code>endpointReference</code> specifies the
+ * endpoint that will be invoked by the returned proxy.
+ * In the implementation of this method, the JAX-WS
+ * runtime system takes the responsibility of selecting a protocol
+ * binding (and a port) and configuring the proxy accordingly from
+ * the WSDL Metadata from the <code>EndpointReference</code>.
+ *
+ *
+ * @param endpointReference the EndpointReference that will
+ * be invoked by the returned proxy.
+ * @param serviceEndpointInterface Service endpoint interface
+ * @param features A list of WebServiceFeatures to configure on the
+ * proxy. Supported features not in the <code>features
+ * </code> parameter will have their default values.
+ * @return Object Proxy instance that supports the
+ * specified service endpoint interface
+ * @throws WebServiceException
+ * <UL>
+ * <LI>If there is an error during creation
+ * of the proxy
+ * <LI>If there is any missing WSDL metadata
+ * as required by this method
+ * <LI>If this
+ * <code>endpointReference</code>
+ * is illegal
+ * <LI>If an illegal
+ * <code>serviceEndpointInterface</code>
+ * is specified
+ * <LI>If feature is enabled that is not compatible with
+ * this port or is unsupported.
+ * </UL>
+ *
+ * @see WebServiceFeature
+ *
+ * @since JAX-WS 2.1
+ **/
+ public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features);
+
+ /**
+ * Factory method to create a <code>W3CEndpointReference</code>.
+ *
+ * <p>
+ * This method can be used to create a <code>W3CEndpointReference</code>
+ * for any endpoint by specifying the <code>address</code> property along
+ * with any other desired properties. This method
+ * can also be used to create a <code>W3CEndpointReference</code> for
+ * an endpoint that is published by the same Java EE application.
+ * To do so the <code>address</code> property can be provided or this
+ * method can automatically determine the <code>address</code> of
+ * an endpoint that is published by the same Java EE application and is
+ * identified by the <code>serviceName</code> and
+ * <code>portName</code> propeties. If the <code>address</code> is
+ * <code>null</code> and the <code>serviceName</code> and
+ * <code>portName</code> do not identify an endpoint published by the
+ * same Java EE application, a
+ * <code>javax.lang.IllegalArgumentException</code> MUST be thrown.
+ *
+ * @param address Specifies the address of the target endpoint
+ * @param serviceName Qualified name of the service in the WSDL.
+ * @param portName Qualified name of the endpoint in the WSDL.
+ * @param metadata A list of elements that should be added to the
+ * <code>W3CEndpointReference</code> instances <code>wsa:metadata</code>
+ * element.
+ * @param wsdlDocumentLocation URL for the WSDL document location for
+ * the service.
+ * @param referenceParameters Reference parameters to be associated
+ * with the returned <code>EndpointReference</code> instance.
+ *
+ * @return the <code>W3CEndpointReference<code> created from
+ * <code>serviceName</code>, <code>portName</code>,
+ * <code>metadata</code>, <code>wsdlDocumentLocation</code>
+ * and <code>referenceParameters</code>. This method
+ * never returns <code>null</code>.
+ *
+ * @throws javax.lang.IllegalArgumentException
+ * <ul>
+ * <li>If the <code>address</code>, <code>serviceName</code> and
+ * <code>portName</code> are all <code>null</code>.
+ * <li>If the <code>serviceName</code> service is <code>null</code> and the
+ * <code>portName> is NOT <code>null</code>.
+ * <li>If the <code>address</code> property is <code>null</code> and
+ * the <code>serviceName</code> and <code>portName</code> do not
+ * specify a valid endpoint published by the same Java EE
+ * application.
+ * <li>If the <code>serviceName</code>is NOT <code>null</code>
+ * and is not present in the specified WSDL.
+ * <li>If the <code>portName</code> port is not <code>null<code> and it
+ * is not present in <code>serviceName</code> service in the WSDL.
+ * <li>If the <code>wsdlDocumentLocation</code> is NOT <code>null</code>
+ * and does not represent a valid WSDL.
+ * </ul>
+ * @throws WebServiceException If an error occurs while creating the
+ * <code>W3CEndpointReference</code>.
+ *
+ * @since JAX-WS 2.1
+ */
+ public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata,
+ String wsdlDocumentLocation, List<Element> referenceParameters);
}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/HttpServer.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -26,10 +26,9 @@
import java.util.HashMap;
import java.util.Map;
+import javax.xml.soap.FactoryLoader;
import javax.xml.ws.Endpoint;
-import org.jboss.ws.core.jaxws.util.FactoryFinder;
-
/**
* An abstract HTTP Server
*
@@ -54,7 +53,7 @@
*/
public static HttpServer create()
{
- HttpServer server = (HttpServer)FactoryFinder.find(HTTP_SERVER_PROPERTY, DEFAULT_HTTP_SERVER_PROPERTY);
+ HttpServer server = (HttpServer)FactoryLoader.loadFactory(HTTP_SERVER_PROPERTY, DEFAULT_HTTP_SERVER_PROPERTY);
return server;
}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -44,6 +44,7 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
@@ -214,7 +215,8 @@
resourcePath = resourcePath + "/";
resourcePath = expLocation + resourcePath + schemaLocation;
- InputStream is = udi.classLoader.getResourceAsStream(resourcePath);
+ URL resourceURL = udi.getMetaDataFile(resourcePath);
+ InputStream is = new ResourceURL(resourceURL).openStream();
if (is == null)
throw new IllegalArgumentException("Cannot find schema import in deployment: " + resourcePath);
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/core/utils/JBossWSEntityResolver.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -24,6 +24,8 @@
// $Id$
import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.logging.Logger;
@@ -47,7 +49,7 @@
registerEntity("urn:jboss:jaxrpc-config:2.0", "schema/jaxrpc-config_2_0.xsd");
registerEntity("urn:jboss:jaxws-config:2.0", "schema/jaxws-config_2_0.xsd");
registerEntity("http://java.sun.com/xml/ns/javaee", "schema/javaee_web_services_1_2.xsd");
- registerEntity("http://www.w3.org/2005/08/addressing", "schema/ws-addr.xsd");
+ registerEntity("http://www.w3.org/2005/08/addressing", "schema/ws-addr.xsd");
registerEntity("http://schemas.xmlsoap.org/ws/2004/08/eventing", "eventing.xsd");
}
@@ -55,28 +57,62 @@
{
log.debug("resolveEntity: [pub=" + publicId + ",sysid=" + systemId + "]");
InputSource inputSource = super.resolveEntity(publicId, systemId);
+
+ if (inputSource == null)
+ {
+ inputSource = resolveSystemIDasURL(systemId, log.isTraceEnabled());
+ }
+
return inputSource;
}
-
- public URL resolveNamespaceURI(String nsURI)
+
+ /** This method should be protected in the super class. */
+ protected InputSource resolveSystemIDasURL(String systemId, boolean trace)
{
- URL url = null;
-
- String resource = (String)getEntityMap().get(nsURI);
- if (resource != null)
+ if (systemId == null)
+ return null;
+
+ if (trace)
+ log.trace("resolveSystemIDasURL, systemId=" + systemId);
+
+ InputSource inputSource = null;
+
+ // Try to use the systemId as a URL to the schema
+ try
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- url = loader.getResource(resource);
- if( url == null )
+ if (trace)
+ log.trace("Trying to resolve systemId as a URL");
+
+ URL url = new URL(systemId);
+ if (url.getProtocol().equalsIgnoreCase("file") == false)
{
- if( resource.endsWith(".dtd") )
- resource = "dtd/" + resource;
- else if( resource.endsWith(".xsd") )
- resource = "schema/" + resource;
- url = loader.getResource(resource);
+ log.warn("Trying to resolve systemId as a non-file URL: " + systemId);
}
+
+ InputStream ins = new ResourceURL(url).openStream();
+ if (ins != null)
+ {
+ inputSource = new InputSource(ins);
+ inputSource.setSystemId(systemId);
+ }
+ else
+ {
+ log.warn("Cannot load systemId as URL: " + systemId);
+ }
+
+ if (trace)
+ log.trace("Resolved systemId as a URL");
}
-
- return url;
+ catch (MalformedURLException ignored)
+ {
+ if (trace)
+ log.trace("SystemId is not a url: " + systemId, ignored);
+ }
+ catch (IOException e)
+ {
+ if (trace)
+ log.trace("Failed to obtain URL.InputStream from systemId: " + systemId, e);
+ }
+ return inputSource;
}
}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSEntityResolver.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -35,6 +35,7 @@
import org.apache.xerces.xni.parser.XMLInputSource;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.utils.ResourceURL;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -162,7 +163,7 @@
private XMLInputSource getXMLInputSource(URL url, XMLResourceIdentifier resId) throws IOException
{
- InputStream inputStream = url.openStream();
+ InputStream inputStream = new ResourceURL(url).openStream();
InputSource inputSource = new InputSource(inputStream);
return getXMLInputSource(inputSource, resId);
}
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -161,7 +161,7 @@
{
String nsURI = keys.next();
URL orgURL = locs.get(nsURI);
- URL resURL = resolver.resolveNamespaceURI(nsURI);
+ URL resURL = resolveNamespaceURI(resolver, nsURI);
URL url = resURL != null ? resURL : orgURL;
log.debug("load schema: " + nsURI + "=" + url);
slist.addItem(url.toExternalForm());
@@ -182,6 +182,28 @@
return jbxs;
}
+ private URL resolveNamespaceURI(JBossWSEntityResolver resolver, String nsURI)
+ {
+ URL url = null;
+
+ String resource = (String)resolver.getEntityMap().get(nsURI);
+ if (resource != null)
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ url = loader.getResource(resource);
+ if( url == null )
+ {
+ if( resource.endsWith(".dtd") )
+ resource = "dtd/" + resource;
+ else if( resource.endsWith(".xsd") )
+ resource = "schema/" + resource;
+ url = loader.getResource(resource);
+ }
+ }
+
+ return url;
+ }
+
/**
* @see org.jboss.ws.tools.interfaces.JavaToXSDIntf#setPackageNamespaceMap(java.util.Map)
*/
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2006-12-15 13:30:24 UTC (rev 1658)
@@ -70,6 +70,7 @@
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
+import org.jboss.ws.core.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
@@ -320,7 +321,7 @@
throw new IllegalArgumentException("schemaLocation is null for xsd:import");
URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
+ Element rootElement = DOMUtils.parse(new ResourceURL(locationURL).openStream());
URL newloc = processSchemaInclude(types, locationURL, rootElement);
if (newloc != null)
importEl.setAttribute("schemaLocation", newloc.toExternalForm());
@@ -354,7 +355,7 @@
throw new IllegalArgumentException("schemaLocation is null for xsd:include");
URL locationURL = getLocationURL(wsdlLoc, location);
- Element rootElement = DOMUtils.parse(locationURL.openStream());
+ Element rootElement = DOMUtils.parse(new ResourceURL(locationURL).openStream());
URL newloc = processSchemaInclude(types, locationURL, rootElement);
if (newloc != null)
includeEl.setAttribute("schemaLocation", newloc.toExternalForm());
Modified: branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl
===================================================================
--- branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestEndpoint.wsdl 2006-12-15 13:30:24 UTC (rev 1658)
@@ -7,7 +7,12 @@
-->
<definitions name="TestEndpointService" targetNamespace="http://eardeployment.jaxws.ws.test.jboss.org/" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://eardeployment.jaxws.ws.test.jboss.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types/>
+
+ <!-- Test a schema import -->
+ <types>
+ <xsd:import namespace="http://org.jboss.ws/jaxrpc/types" schemaLocation="TestService.xsd"/>
+ </types>
+
<message name="TestEndpoint_echoResponse">
<part name="return" type="xsd:string"/>
</message>
Added: branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd
===================================================================
--- branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd 2006-12-15 10:07:02 UTC (rev 1657)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd 2006-12-15 13:30:24 UTC (rev 1658)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<schema targetNamespace="http://org.jboss.ws/jaxrpc/types" xmlns:tns="http://org.jboss.ws/jaxrpc/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="SimpleUserType">
+ <sequence>
+ <element name="a" type="int"/>
+ <element name="b" type="int"/>
+ </sequence>
+ </complexType>
+</schema>
Property changes on: branches/tdiesler/trunk/src/test/resources/jaxws/eardeployment/WEB-INF/wsdl/TestService.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years, 4 months
JBossWS SVN: r1657 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 05:07:02 -0500 (Fri, 15 Dec 2006)
New Revision: 1657
Added:
branches/tdiesler/trunk/
Log:
recreate from -r1655
Copied: branches/tdiesler/trunk (from rev 1656, trunk)
19 years, 4 months
JBossWS SVN: r1656 - branches/tdiesler
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 05:06:43 -0500 (Fri, 15 Dec 2006)
New Revision: 1656
Removed:
branches/tdiesler/trunk/
Log:
recreate from -r1655
19 years, 4 months
JBossWS SVN: r1655 - in trunk/src: main/java/org/jboss/ws/core main/java/org/jboss/ws/core/jaxrpc main/java/org/jboss/ws/core/jaxws/binding main/java/org/jboss/ws/core/server main/java/org/jboss/ws/core/soap test
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-15 05:05:17 -0500 (Fri, 15 Dec 2006)
New Revision: 1655
Modified:
trunk/src/main/java/org/jboss/ws/core/CommonBinding.java
trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/src/test/build.xml
Log:
Fix fault message for Provider
Use DOMSource instead of StreamSource
Modified: trunk/src/main/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonBinding.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/CommonBinding.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -37,7 +37,7 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2006
*/
-public interface CommonBinding
+public interface CommonBinding
{
/** On the client side, generate the Object from IN parameters. */
Object bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
@@ -50,4 +50,7 @@
/** On the client side, extract the OUT parameters from the Object and return them to the client. */
void unbindResponseMessage(OperationMetaData opMetaData, Object resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+
+ /** bind an exception to a fault message */
+ void bindFaultMessage(Exception ex);
}
Modified: trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -52,6 +52,7 @@
import org.jboss.ws.core.jaxrpc.StubExt;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
@@ -85,32 +86,19 @@
public abstract class CommonSOAPBinding implements CommonBinding
{
// provide logging
- private static Logger log = Logger.getLogger(CommonSOAPBinding.class);
+ protected Logger log = Logger.getLogger(getClass());
private boolean mtomEnabled;
- /**
- * A constant representing the identity of the SOAP 1.1 over HTTP binding.
- */
+ /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
public static final String SOAP11HTTP_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http";
-
- /**
- * A constant representing the identity of the SOAP 1.2 over HTTP binding.
- */
+ /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
-
- /**
- * A constant representing the identity of the SOAP 1.1 over HTTP binding
- * with MTOM enabled by default.
- */
+ /** A constant representing the identity of the SOAP 1.1 over HTTP binding with MTOM enabled by default. */
public static final String SOAP11HTTP_MTOM_BINDING = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true";
-
- /**
- * A constant representing the identity of the SOAP 1.2 over HTTP binding
- * with MTOM enabled by default.
- */
+ /** A constant representing the identity of the SOAP 1.2 over HTTP binding with MTOM enabled by default. */
public static final String SOAP12HTTP_MTOM_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true";
-
+ /** The SOAP encoded Array name */
private static final Name SOAP_ARRAY_NAME = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
public CommonSOAPBinding()
@@ -544,8 +532,22 @@
handleException(e);
}
}
+
+ public void bindFaultMessage(Exception ex)
+ {
+ SOAPMessage faultMessage = createFaultMessageFromException(ex);
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext != null)
+ {
+ msgContext.setSOAPMessage(faultMessage);
+ }
+ else
+ {
+ log.warn("Cannot set fault message in message context");
+ }
+ }
- public abstract SOAPMessage exceptionToFaultMessage(Exception ex);
+ protected abstract SOAPMessage createFaultMessageFromException(Exception ex);
private void verifySOAPVersion(OperationMetaData opMetaData, SOAPEnvelope soapEnvelope)
{
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP11BindingJAXRPC.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -50,15 +50,13 @@
delegate.setSOAPActionHeader(opMetaData, reqMessage);
}
- @Override
+ public SOAPMessage createFaultMessageFromException(Exception ex)
+ {
+ return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ }
+
protected void throwFaultException(SOAPFaultImpl fault) throws Exception
{
throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
}
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- }
}
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/SOAP12BindingJAXRPC.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -25,7 +25,9 @@
import javax.xml.soap.SOAPMessage;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAP12Binding;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -50,15 +52,13 @@
delegate.setSOAPActionHeader(opMetaData, reqMessage);
}
- @Override
+ public SOAPMessage createFaultMessageFromException(Exception ex)
+ {
+ return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
+ }
+
protected void throwFaultException(SOAPFaultImpl fault) throws Exception
{
throw SOAPFaultHelperJAXRPC.getSOAPFaultException(fault);
}
-
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXRPC.exceptionToFaultMessage(ex);
- }
}
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/HTTPBindingJAXWS.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -68,6 +68,11 @@
throw new NotImplementedException();
}
+ public void bindFaultMessage(Exception ex)
+ {
+ throw new NotImplementedException();
+ }
+
public List<Handler> getHandlerChain()
{
return delegate.getHandlerChain();
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/MessageBinding.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -34,8 +34,10 @@
import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.UnboundHeader;
@@ -120,6 +122,20 @@
throw new NotImplementedException();
}
+ public void bindFaultMessage(Exception ex)
+ {
+ SOAPMessage faultMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext != null)
+ {
+ msgContext.setSOAPMessage(faultMessage);
+ }
+ else
+ {
+ log.warn("Cannot set fault message in message context");
+ }
+ }
+
public List<Handler> getHandlerChain()
{
return delegate.getHandlerChain();
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 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -36,8 +36,10 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonBinding;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
+import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
@@ -135,6 +137,20 @@
throw new NotImplementedException();
}
+ public void bindFaultMessage(Exception ex)
+ {
+ SOAPMessage faultMessage = SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+ if (msgContext != null)
+ {
+ msgContext.setSOAPMessage(faultMessage);
+ }
+ else
+ {
+ log.warn("Cannot set fault message in message context");
+ }
+ }
+
public List<Handler> getHandlerChain()
{
return delegate.getHandlerChain();
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP11BindingJAXWS.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -96,18 +96,16 @@
delegate.setHandlerChain(handlerChain);
}
- @Override
+ public SOAPMessage createFaultMessageFromException(Exception ex)
+ {
+ return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ }
+
protected void throwFaultException(SOAPFaultImpl fault) throws Exception
{
throw SOAPFaultHelperJAXWS.getSOAPFaultException(fault);
}
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
- }
-
public String getBindingID()
{
throw new NotImplementedException();
Modified: trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/jaxws/binding/SOAP12BindingJAXWS.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -34,8 +34,10 @@
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAP12Binding;
import org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -103,18 +105,16 @@
delegate.setHandlerChain(handlerChain);
}
- @Override
+ public SOAPMessage createFaultMessageFromException(Exception ex)
+ {
+ return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
+ }
+
protected void throwFaultException(SOAPFaultImpl fault) throws Exception
{
throw SOAPFaultHelperJAXWS.getSOAPFaultException(fault);
}
- @Override
- public SOAPMessage exceptionToFaultMessage(Exception ex)
- {
- return SOAPFaultHelperJAXWS.exceptionToFaultMessage(ex);
- }
-
public String getBindingID()
{
throw new NotImplementedException();
Modified: trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -197,10 +197,9 @@
{
try
{
- CommonSOAPBinding soapBinding = (CommonSOAPBinding)bindingProvider.getCommonBinding();
- SOAPMessage faultMessage = soapBinding.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(faultMessage);
-
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.bindFaultMessage(ex);
+
// call the handler chain
boolean handlersPass = callFaultHandlerChain(seInfo, HandlerType.POST, ex);
handlersPass = handlersPass && callFaultHandlerChain(seInfo, HandlerType.ENDPOINT, ex);
Modified: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpoint.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -38,9 +38,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.CommonBinding;
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.CommonSOAPBinding;
import org.jboss.ws.core.jaxrpc.binding.BindingException;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
@@ -215,10 +215,8 @@
if (resMessage == null || ((SOAPMessageImpl)resMessage).isFaultMessage() == false)
{
CommonBindingProvider bindingProvider = getCommonBindingProvider();
- CommonSOAPBinding soapBinding = (CommonSOAPBinding)bindingProvider.getCommonBinding();
-
- resMessage = soapBinding.exceptionToFaultMessage(ex);
- msgContext.setSOAPMessage(resMessage);
+ CommonBinding binding = bindingProvider.getCommonBinding();
+ binding.bindFaultMessage(ex);
}
postProcessResponse(headerSource, resMessage);
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 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/soap/JAXWSPayloadBuilder.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -23,7 +23,6 @@
//$Id$
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
@@ -32,7 +31,7 @@
import javax.xml.soap.Name;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
-import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.dom.DOMSource;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.DOMWriter;
@@ -105,8 +104,7 @@
if (itBody.hasNext())
{
Element domBodyElement = (Element)itBody.next();
- String xmlStr = DOMWriter.printNode(domBodyElement, false);
- soapBody.setPayload(new StreamSource(new ByteArrayInputStream(xmlStr.getBytes())));
+ soapBody.setPayload(new DOMSource(domBodyElement));
}
}
}
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 18:49:44 UTC (rev 1654)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2006-12-15 10:05:17 UTC (rev 1655)
@@ -433,7 +433,7 @@
{
Element child = getBodyElementFromSource();
String xmlPayload = DOMWriter.printNode(child, false);
- log.debug("Content from payload: " + xmlPayload);
+ log.debug("writeElementContent from payload: " + xmlPayload);
writer.write(xmlPayload);
}
else
Modified: trunk/src/test/build.xml
===================================================================
--- trunk/src/test/build.xml 2006-12-14 18:49:44 UTC (rev 1654)
+++ trunk/src/test/build.xml 2006-12-15 10:05:17 UTC (rev 1655)
@@ -156,8 +156,6 @@
<pathelement location="${jboss.client}/jaxb-api.jar"/>
<pathelement location="${jboss.client}/jaxb-impl.jar"/>
<pathelement location="${jboss.client}/jbossall-client.jar"/>
- <pathelement location="${jboss.client}/jbossretro-rt.jar"/>
- <pathelement location="${jboss.client}/jboss-backport-concurrent.jar"/>
<pathelement location="${jboss.client}/jboss-common-core.jar"/>
<pathelement location="${jboss.client}/jboss-xml-binding.jar"/>
<pathelement location="${jboss.client}/jboss-logging-spi.jar"/>
@@ -168,6 +166,7 @@
<pathelement location="${jboss.client}/jboss-saaj.jar"/>
<pathelement location="${jboss.client}/log4j.jar"/>
<pathelement location="${jboss.client}/mail.jar"/>
+ <pathelement location="${jboss.lib}/jboss-container.jar"/>
<pathelement location="${jboss.server.lib}/jbosssx.jar"/>
</path>
19 years, 4 months
JBossWS SVN: r1654 - trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-14 13:49:44 -0500 (Thu, 14 Dec 2006)
New Revision: 1654
Modified:
trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
Log:
Add VFS test
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-14 15:56:18 UTC (rev 1653)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-14 18:49:44 UTC (rev 1654)
@@ -30,6 +30,8 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.core.utils.ResourceURL;
import org.w3c.dom.Element;
@@ -59,6 +61,23 @@
assertNotNull(root);
}
+ public void testVirtualFile() throws Exception
+ {
+ File earFile = new File("libs/jaxws-eardeployment.ear");
+ assertTrue(earFile.exists());
+
+ URL earURL = earFile.toURL();
+ VFS fsEar = VFS.getVFS(earURL);
+ VirtualFile vfWar = fsEar.findChild("jaxws-eardeployment.war");
+ assertNotNull(earURL + "!/jaxws-eardeployment.war", vfWar);
+
+ VirtualFile vfWsdl = vfWar.findChild("WEB-INF/wsdl/TestEndpoint.wsdl");
+ assertNotNull(earURL + "!/jaxws-eardeployment.war!/WEB-INF/wsdl/TestEndpoint.wsdl", vfWsdl);
+
+ Element root = DOMUtils.parse(vfWsdl.openStream());
+ assertNotNull(root);
+ }
+
public void testEJB3Endpoint() throws Exception
{
URL wsdlURL = new URL ("http://" + getServerHost() + ":8080/earejb3/EJB3Bean?wsdl");
19 years, 4 months
JBossWS SVN: r1653 - in trunk/src/main/java: javax/xml/soap org/jboss/ws org/jboss/ws/core/jaxrpc/binding/jbossxb org/jboss/ws/core/soap
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-12-14 10:56:18 -0500 (Thu, 14 Dec 2006)
New Revision: 1653
Modified:
trunk/src/main/java/javax/xml/soap/SAAJResult.java
trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java
trunk/src/main/java/org/jboss/ws/Constants.java
trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
Log:
Implement SAAJResult and SOAPHeaderElement stuff
Modified: trunk/src/main/java/javax/xml/soap/SAAJResult.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SAAJResult.java 2006-12-14 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/javax/xml/soap/SAAJResult.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -25,7 +25,7 @@
import javax.xml.transform.dom.DOMResult;
-import org.jboss.util.NotImplementedException;
+import org.w3c.dom.Element;
/**
* Acts as a holder for the results of a JAXP transformation or a JAXB marshalling, in the form of a SAAJ tree.
@@ -36,6 +36,8 @@
*/
public class SAAJResult extends DOMResult
{
+ private SOAPElement rootElement;
+
/**
* Creates a SAAJResult that will present results in the form of a SAAJ tree that supports the default (SOAP 1.1) protocol.
*
@@ -43,13 +45,12 @@
* takes a parameter whose type, such as SOAPElement, is drawn from the SAAJ API. When used in a transformation,
* the results are populated into the SOAPPart of a SOAPMessage that is created internally.
* The SOAPPart returned by DOMResult.getNode() is not guaranteed to be well-formed.
+ *
* @throws SOAPException if there is a problem creating a SOAPMessage
* @since SAAJ 1.3
*/
public SAAJResult() throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
}
/**
@@ -64,8 +65,6 @@
*/
public SAAJResult(String protocol) throws SOAPException
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
}
/**
@@ -79,8 +78,14 @@
*/
public SAAJResult(SOAPMessage message)
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ try
+ {
+ rootElement = message.getSOAPPart().getEnvelope();
+ }
+ catch (SOAPException ex)
+ {
+ throw new IllegalArgumentException("Cannot create SAAJ result", ex);
+ }
}
/**
@@ -93,8 +98,7 @@
*/
public SAAJResult(SOAPElement rootNode)
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ rootElement = rootNode;
}
/**
@@ -103,7 +107,24 @@
*/
public Node getResult()
{
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
+ return rootElement;
}
+
+ public void setNode(org.w3c.dom.Node node)
+ {
+ rootElement = null;
+ if (node instanceof Element)
+ {
+ try
+ {
+ SOAPFactory factory = SOAPFactory.newInstance();
+ rootElement = factory.createElement((Element)node);
+ }
+ catch (SOAPException ex)
+ {
+ throw new IllegalArgumentException("Cannot set node: " + node, ex);
+ }
+ }
+ }
}
+
Modified: trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java
===================================================================
--- trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java 2006-12-14 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/javax/xml/soap/SOAPHeaderElement.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -72,8 +72,18 @@
* @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Role.
* @since SAAJ 1.3
*/
- public boolean getRole();
+ public String getRole();
+ /**
+ * Sets the Role associated with this SOAPHeaderElement object to the specified Role.
+ *
+ * @param roleURI the URI of the Role
+ * @throws SOAPException if there is an error in setting the role
+ * @throws UnsupportedOperationException if this message does not support the SOAP 1.2 concept of Fault Role
+ * @since SAAJ 1.3
+ */
+ public void setRole(String roleURI);
+
/** Sets the actor associated with this SOAPHeaderElement object to the specified actor.
* The default value of an actor is: SOAPConstants.URI_SOAP_ACTOR_NEXT
*
Modified: trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-14 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/org/jboss/ws/Constants.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -123,7 +123,8 @@
/** SOAP-1.1 attributes */
static final String SOAP11_ATTR_ACTOR = "actor";
- static final String SOAP11_ATTR_ROLE = "role";
+ static final String SOAP12_ATTR_ROLE = "role";
+ static final String SOAP12_ATTR_RELAY = "relay";
static final String SOAP11_ATTR_MUST_UNDERSTAND = "mustUnderstand";
/** SOAP-1.1 fault codes */
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2006-12-14 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/SchemaBindingBuilder.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -246,7 +246,7 @@
// attributeFormDefault="qualified"
String nsURI = typeBinding.getQName().getNamespaceURI();
if (Constants.SOAP11_ATTR_MUST_UNDERSTAND.equals(xmlAttrName) || Constants.SOAP11_ATTR_ACTOR.equals(xmlAttrName)
- || Constants.SOAP11_ATTR_ROLE.equals(xmlAttrName))
+ || Constants.SOAP12_ATTR_ROLE.equals(xmlAttrName))
{
nsURI = Constants.NS_SOAP11_ENV;
}
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 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -103,6 +103,9 @@
if (domElement == null)
throw new IllegalArgumentException("Source node cannot be null");
+ if (domElement instanceof SOAPElement)
+ return (SOAPElement)domElement;
+
String localName = domElement.getLocalName();
String prefix = domElement.getPrefix() != null ? domElement.getPrefix() : "";
String nsURI = domElement.getNamespaceURI() != null ? domElement.getNamespaceURI() : "";
Modified: trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-14 15:23:08 UTC (rev 1652)
+++ trunk/src/main/java/org/jboss/ws/core/soap/SOAPHeaderElementImpl.java 2006-12-14 15:56:18 UTC (rev 1653)
@@ -35,7 +35,6 @@
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
/**
@@ -48,6 +47,7 @@
*/
public class SOAPHeaderElementImpl extends SOAPContentElement implements SOAPHeaderElement
{
+
public SOAPHeaderElementImpl(Name name)
{
super(name);
@@ -58,6 +58,34 @@
super(element);
}
+ public String getRole()
+ {
+ String envURI = Constants.NS_SOAP12_ENV;
+ String attr = getAttributeNS(envURI, Constants.SOAP12_ATTR_ROLE);
+ return attr;
+ }
+
+ public void setRole(String roleURI)
+ {
+ String envURI = Constants.NS_SOAP12_ENV;
+ String qualifiedName = Constants.PREFIX_ENV + ":" + Constants.SOAP12_ATTR_ROLE;
+ setAttributeNS(envURI, qualifiedName, roleURI);
+ }
+
+ public boolean getRelay()
+ {
+ String envURI = Constants.NS_SOAP12_ENV;
+ String attr = getAttributeNS(envURI, Constants.SOAP12_ATTR_RELAY);
+ return "true".equals(attr);
+ }
+
+ public void setRelay(boolean relay)
+ {
+ String envURI = Constants.NS_SOAP12_ENV;
+ String qualifiedName = Constants.PREFIX_ENV + ":" + Constants.SOAP12_ATTR_RELAY;
+ setAttributeNS(envURI, qualifiedName, new Boolean(relay).toString());
+ }
+
public String getActor()
{
String envURI = Constants.NS_SOAP11_ENV;
@@ -140,22 +168,4 @@
writer.write(xmlFragment);
}
-
- public boolean getRelay()
- {
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
- }
-
- public boolean getRole()
- {
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
- }
-
- public void setRelay(boolean relay) throws SOAPException
- {
- //TODO: SAAJ 1.3
- throw new NotImplementedException();
- }
}
19 years, 4 months
JBossWS SVN: r1652 - in trunk/src/main/java/org/jboss/ws: core/jaxrpc metadata/builder metadata/builder/jaxrpc metadata/builder/jaxws metadata/umdm metadata/wsse
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2006-12-14 10:23:08 -0500 (Thu, 14 Dec 2006)
New Revision: 1652
Added:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
Removed:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
Modified:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.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/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:
Refactor WSSE config factory
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-14 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -42,7 +42,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
/**
* A JNDI reference to a javax.xml.rpc.Service
@@ -156,7 +156,7 @@
{
ObjectOutputStream oos = new ObjectOutputStream(baos);
URL securityURL = getSecurityConfigURL();
- WSSecurityConfiguration securityConfig = WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ WSSecurityConfiguration securityConfig = WSSecurityOMFactory.newInstance().parse(securityURL);
oos.writeObject(securityConfig);
oos.close();
}
@@ -171,7 +171,7 @@
{
ClassLoader ctxClassLoader = refMetaData.getResourceCL();
String descriptorLoc = udi.metaData instanceof UnifiedWebMetaData ? "WEB-INF" : "META-INF";
- URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" + WSSecurityConfigurationFactory.CLIENT_RESOURCE_NAME);
+ URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" + WSSecurityOMFactory.CLIENT_RESOURCE_NAME);
return securityURL;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-14 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -37,8 +37,6 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.wsdl.*;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
import org.w3c.dom.Element;
import javax.management.ObjectName;
@@ -69,44 +67,6 @@
// provide logging
private final static Logger log = Logger.getLogger(MetaDataBuilder.class);
- public static WSSecurityConfiguration getWsSecurityConfiguration(UnifiedDeploymentInfo udi) throws IOException
- {
- WSSecurityConfiguration config = null;
-
- String resource = WSSecurityConfigurationFactory.SERVER_RESOURCE_NAME;
- if (udi.metaData instanceof UnifiedWebMetaData)
- {
- resource = "WEB-INF/" + resource;
- }
- else
- {
- resource = "META-INF/" + resource;
- }
-
- URL location = udi.classLoader.getResource(resource);
- if (location != null)
- {
- config = WSSecurityConfigurationFactory.newInstance().parse(location);
-
- // Get and set deployment path to the keystore file
- if (config.getKeyStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getKeyStoreFile());
- if (location != null)
- config.setKeyStoreURL(location);
- }
-
- if (config.getTrustStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getTrustStoreFile());
- if (location != null)
- config.setTrustStoreURL(location);
- }
- }
-
- return config;
- }
-
/** Inititialize the endpoint binding */
protected void initEndpointBinding(WSDLEndpoint wsdlEndpoint, ClientEndpointMetaData epMetaData)
{
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 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -49,7 +49,7 @@
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
/**
* A client side meta data builder.
@@ -79,7 +79,7 @@
WSSecurityConfiguration securityConfig = null;
if (securityURL != null)
{
- securityConfig = WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ securityConfig = WSSecurityOMFactory.newInstance().parse(securityURL);
}
return buildMetaData(serviceQName, wsdlURL, javaWsdlMapping, securityConfig, serviceRefMetaData, loader);
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 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -22,34 +22,30 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxrpc;
-import java.net.URL;
-import java.util.Set;
-
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
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;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.j2ee.*;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.util.Set;
+
/**
* A server side meta data builder that is based on webservices.xml.
*
@@ -84,7 +80,7 @@
// Set wsdl location
String wsdlFile = wsdMetaData.getWsdlFile();
URL wsdlLocation = udi.getMetaDataFile(wsdlFile);
-
+
// Unmarshall the WSDL
serviceMetaData.setWsdlLocation(wsdlLocation);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
@@ -100,7 +96,8 @@
setupTypesMetaData(serviceMetaData);
// Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration = getWsSecurityConfiguration(udi);
+ WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
+ WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(udi);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
// For every port-component build the EndpointMetaData
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:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -23,41 +23,8 @@
// $Id$
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPMessageHandlers;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.AddressingProperties;
-
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -74,25 +41,16 @@
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.EndpointConfigJAXWS;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
-import org.jboss.ws.metadata.umdm.TypesMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.*;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
@@ -102,8 +60,34 @@
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.management.ObjectName;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.AddressingProperties;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
/** An abstract annotation meta data builder.
*
@@ -981,7 +965,8 @@
sepMetaData.setLinkName(linkName);
// Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration = MetaDataBuilder.getWsSecurityConfiguration(udi);
+ WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
+ WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(udi);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
sepMetaData.setServiceEndpointImplName(sepClass.getName());
@@ -1027,7 +1012,7 @@
if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
- // process configuration, this will as well setup the handler
+ // setup handler chain from config
sepMetaData.processEndpointConfig();
// Process an optional @HandlerChain annotation
@@ -1040,7 +1025,6 @@
processHandlerChain(sepMetaData, wsClass);
}
-
// init service endpoint id
ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
sepMetaData.setServiceEndpointID(sepID);
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:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -97,6 +97,9 @@
}
public void processEndpointConfig() {
+
+ log.debug("Process endpoint config");
+
// rebuild handler from config
clearHandlers();
ClientConfigJAXWS jaxwsConfig = (ClientConfigJAXWS)getEndpointConfig();
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:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -157,6 +157,11 @@
public abstract Object getEndpointConfig();
+ /**
+ * Processing the endpoint configuration will
+ * reset parts of the meta data model and update it according to
+ * the configuration given.
+ */
public abstract void processEndpointConfig();
public String getEndpointAddress()
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:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -255,6 +255,8 @@
*/
public void processEndpointConfig()
{
+ log.debug("Process endpoint config");
+
// update handler configuration
List<HandlerMetaData> sepHandlers = getHandlerMetaData(HandlerType.ENDPOINT);
clearHandlers();
Added: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2006-12-14 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -0,0 +1,61 @@
+package org.jboss.ws.metadata.wsse;
+
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: hbraun
+ * Date: 14.12.2006
+ * Time: 16:17:02
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSSecurityConfigFactory {
+
+ public static WSSecurityConfigFactory newInstance()
+ {
+ return new WSSecurityConfigFactory();
+ }
+
+ public WSSecurityConfiguration createConfiguration(UnifiedDeploymentInfo udi) throws IOException
+ {
+ WSSecurityConfiguration config = null;
+
+ String resource = WSSecurityOMFactory.SERVER_RESOURCE_NAME;
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ resource = "WEB-INF/" + resource;
+ }
+ else
+ {
+ resource = "META-INF/" + resource;
+ }
+
+ URL location = udi.classLoader.getResource(resource);
+ if (location != null)
+ {
+ config = WSSecurityOMFactory.newInstance().parse(location);
+
+ // Get and set deployment path to the keystore file
+ if (config.getKeyStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getKeyStoreFile());
+ if (location != null)
+ config.setKeyStoreURL(location);
+ }
+
+ if (config.getTrustStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getTrustStoreFile());
+ if (location != null)
+ config.setTrustStoreURL(location);
+ }
+ }
+
+ return config;
+ }
+
+}
Deleted: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14 14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -1,460 +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.wsse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB Object Model Factory that represets a JBoss WS-Security
- * configuration. See the jboss-ws-security_1_0.xsd file for more info.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfigurationFactory implements ObjectModelFactory
-{
-
- public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
-
- public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
-
- private static HashMap options = new HashMap(6);
-
- static
- {
- options.put("key-store-file", "setKeyStoreFile");
- options.put("key-store-type", "setKeyStoreType");
- options.put("key-store-password", "setKeyStorePassword");
- options.put("trust-store-file", "setTrustStoreFile");
- options.put("trust-store-type", "setTrustStoreType");
- options.put("trust-store-password", "setTrustStorePassword");
- }
-
- // provide logging
- private static final Logger log = Logger.getLogger(WSSecurityConfigurationFactory.class);
-
- // Hide constructor
- private WSSecurityConfigurationFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static WSSecurityConfigurationFactory newInstance()
- {
- return new WSSecurityConfigurationFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public WSSecurityConfiguration parse(URL configurationFile) throws IOException
- {
- if (configurationFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = configurationFile.openStream();
- try
- {
- WSSecurityConfiguration configuration = (WSSecurityConfiguration) unmarshaller.unmarshal(is, this, null);
- return configuration;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " + configurationFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the
- * parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return new WSSecurityConfiguration();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
- {
- return root;
- }
-
- public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext navigator, String namespaceURI,
- String localName, String value)
- {
- log.trace("setValue: [obj=" + configuration + ",value=" + value + "]");
- String method = (String) options.get(localName);
- if (method == null)
- return;
-
- // Dispatch to propper initializer
- try
- {
- WSSecurityConfiguration.class.getMethod(method, new Class[] {String.class}).invoke(configuration, new Object[]{value});
- }
- catch (Exception e)
- {
- log.error("Could not set option: " + method + " to: " + value, e);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext navigator, String namespaceURI,
- String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- if ("port".equals(localName))
- {
- return new Port(attrs.getValue("", "name"));
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Config defaultConfig, UnmarshallingContext navigator,
- String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" + defaultConfig + "]");
- configuration.setDefaultConfig(defaultConfig);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Port port, UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" + port + "]");
- configuration.addPort(port);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Config config, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("sign".equals(localName))
- {
- // By default, we alwyas include a timestamp
- Boolean include = new Boolean(true);
- String timestamp = attrs.getValue("", "includeTimestamp");
- if (timestamp != null)
- include = (Boolean) SimpleTypeBindings.unmarshal(timestamp, SimpleTypeBindings.XS_BOOLEAN_NAME, null);
-
- return new Sign(attrs.getValue("", "type"), attrs.getValue("", "alias"), include.booleanValue());
- }
- else if ("encrypt".equals(localName))
- {
- return new Encrypt(attrs.getValue("", "type"), attrs.getValue("", "alias"), attrs.getValue("", "algorithm"));
- }
- else if ("timestamp".equals(localName))
- {
- return new Timestamp(attrs.getValue("", "ttl"));
- }
- else if ("requires".equals(localName))
- {
- return new Requires();
- }
- else if ("username".equals(localName))
- {
- return new Username();
- }
-
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + encrypt + "]");
- config.setEncrypt(encrypt);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + sign + "]");
- config.setSign(sign);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Timestamp timestamp, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + timestamp + "]");
- config.setTimestamp(timestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Username username, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + username + "]");
- config.setUsername(username);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Requires requires, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + requires + "]");
- config.setRequires(requires);
- }
-
-
- private Object handleTargets(Object object, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("target".equals(localName))
- {
- Target target = new Target(attrs.getValue("", "type"));
- if ("true".equals(attrs.getValue("", "contentOnly")))
- target.setContentOnly(true);
-
- return target;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(sign, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Requires requires, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("signature".equals(localName))
- {
- return new RequireSignature();
- }
- else if ("encryption".equals(localName))
- {
- return new RequireEncryption();
- }
- else if ("timestamp".equals(localName))
- {
- return new RequireTimestamp(attrs.getValue("", "maxAge"));
- }
-
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireSignature requireSignature, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireEncryption, navigator, namespaceURI, localName, attrs);
- }
-
- public void setValue(Target target, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + target + ",value=" + value + "]");
-
- target.setValue(value);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + encrypt + ",child=" + target + "]");
- encrypt.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + sign + ",child=" + target + "]");
- sign.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireEncryption requireEncryption, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" + requireEncryption + "]");
- requires.setRequireEncryption(requireEncryption);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireSignature requireSignature, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" + requireSignature + "]");
- requires.setRequireSignature(requireSignature);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireTimestamp requireTimestamp, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" + requireTimestamp + "]");
- requires.setRequireTimestamp(requireTimestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireEncryption requireEncryption, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireEncryption + ",child=" + target + "]");
- requireEncryption.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireSignature requireSignature, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireSignature + ",child=" + target + "]");
- requireSignature.addTarget(target);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("operation".equals(localName))
- {
- return new Operation(attrs.getValue("", "name"));
- }
- else if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Operation operation, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + operation + "]");
- port.addOperation(operation);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Config config, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + config + "]");
- port.setDefaultConfig(config);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Operation operation, UnmarshallingContext navigator, String namespaceURI, String localName,
- Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Operation operation, Config config, UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + operation + ",child=" + config + "]");
- operation.setConfig(config);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java (from rev 1640, trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java)
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14 01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2006-12-14 15:23:08 UTC (rev 1652)
@@ -0,0 +1,460 @@
+/*
+* 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.wsse;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB Object Model Factory that represets a JBoss WS-Security
+ * configuration. See the jboss-ws-security_1_0.xsd file for more info.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityOMFactory implements ObjectModelFactory
+{
+
+ public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
+
+ public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
+
+ private static HashMap options = new HashMap(6);
+
+ static
+ {
+ options.put("key-store-file", "setKeyStoreFile");
+ options.put("key-store-type", "setKeyStoreType");
+ options.put("key-store-password", "setKeyStorePassword");
+ options.put("trust-store-file", "setTrustStoreFile");
+ options.put("trust-store-type", "setTrustStoreType");
+ options.put("trust-store-password", "setTrustStorePassword");
+ }
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSSecurityOMFactory.class);
+
+ // Hide constructor
+ private WSSecurityOMFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a jaxrpc-mapping factory
+ */
+ public static WSSecurityOMFactory newInstance()
+ {
+ return new WSSecurityOMFactory();
+ }
+
+ /**
+ * Factory method for JavaWsdlMapping
+ */
+ public WSSecurityConfiguration parse(URL configurationFile) throws IOException
+ {
+ if (configurationFile == null)
+ {
+ throw new IllegalArgumentException("URL cannot be null");
+ }
+
+ // setup the XML binding Unmarshaller
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ InputStream is = configurationFile.openStream();
+ try
+ {
+ WSSecurityConfiguration configuration = (WSSecurityConfiguration) unmarshaller.unmarshal(is, this, null);
+ return configuration;
+ }
+ catch (JBossXBException e)
+ {
+ IOException ioex = new IOException("Cannot parse: " + configurationFile);
+ Throwable cause = e.getCause();
+ if (cause != null)
+ ioex.initCause(cause);
+ throw ioex;
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the
+ * parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return new WSSecurityConfiguration();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String name)
+ {
+ return root;
+ }
+
+ public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext navigator, String namespaceURI,
+ String localName, String value)
+ {
+ log.trace("setValue: [obj=" + configuration + ",value=" + value + "]");
+ String method = (String) options.get(localName);
+ if (method == null)
+ return;
+
+ // Dispatch to propper initializer
+ try
+ {
+ WSSecurityConfiguration.class.getMethod(method, new Class[] {String.class}).invoke(configuration, new Object[]{value});
+ }
+ catch (Exception e)
+ {
+ log.error("Could not set option: " + method + " to: " + value, e);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext navigator, String namespaceURI,
+ String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ if ("port".equals(localName))
+ {
+ return new Port(attrs.getValue("", "name"));
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Config defaultConfig, UnmarshallingContext navigator,
+ String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" + defaultConfig + "]");
+ configuration.setDefaultConfig(defaultConfig);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Port port, UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" + port + "]");
+ configuration.addPort(port);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Config config, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("sign".equals(localName))
+ {
+ // By default, we alwyas include a timestamp
+ Boolean include = new Boolean(true);
+ String timestamp = attrs.getValue("", "includeTimestamp");
+ if (timestamp != null)
+ include = (Boolean) SimpleTypeBindings.unmarshal(timestamp, SimpleTypeBindings.XS_BOOLEAN_NAME, null);
+
+ return new Sign(attrs.getValue("", "type"), attrs.getValue("", "alias"), include.booleanValue());
+ }
+ else if ("encrypt".equals(localName))
+ {
+ return new Encrypt(attrs.getValue("", "type"), attrs.getValue("", "alias"), attrs.getValue("", "algorithm"));
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new Timestamp(attrs.getValue("", "ttl"));
+ }
+ else if ("requires".equals(localName))
+ {
+ return new Requires();
+ }
+ else if ("username".equals(localName))
+ {
+ return new Username();
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + encrypt + "]");
+ config.setEncrypt(encrypt);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + sign + "]");
+ config.setSign(sign);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Timestamp timestamp, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + timestamp + "]");
+ config.setTimestamp(timestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Username username, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + username + "]");
+ config.setUsername(username);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Requires requires, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + requires + "]");
+ config.setRequires(requires);
+ }
+
+
+ private Object handleTargets(Object object, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("target".equals(localName))
+ {
+ Target target = new Target(attrs.getValue("", "type"));
+ if ("true".equals(attrs.getValue("", "contentOnly")))
+ target.setContentOnly(true);
+
+ return target;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(sign, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Requires requires, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("signature".equals(localName))
+ {
+ return new RequireSignature();
+ }
+ else if ("encryption".equals(localName))
+ {
+ return new RequireEncryption();
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new RequireTimestamp(attrs.getValue("", "maxAge"));
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireSignature requireSignature, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireEncryption, navigator, namespaceURI, localName, attrs);
+ }
+
+ public void setValue(Target target, UnmarshallingContext navigator, String namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + target + ",value=" + value + "]");
+
+ target.setValue(value);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + encrypt + ",child=" + target + "]");
+ encrypt.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + sign + ",child=" + target + "]");
+ sign.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireEncryption requireEncryption, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" + requireEncryption + "]");
+ requires.setRequireEncryption(requireEncryption);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireSignature requireSignature, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" + requireSignature + "]");
+ requires.setRequireSignature(requireSignature);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireTimestamp requireTimestamp, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" + requireTimestamp + "]");
+ requires.setRequireTimestamp(requireTimestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireEncryption requireEncryption, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireEncryption + ",child=" + target + "]");
+ requireEncryption.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireSignature requireSignature, Target target, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireSignature + ",child=" + target + "]");
+ requireSignature.addTarget(target);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("operation".equals(localName))
+ {
+ return new Operation(attrs.getValue("", "name"));
+ }
+ else if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Operation operation, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + operation + "]");
+ port.addOperation(operation);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Config config, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + config + "]");
+ port.setDefaultConfig(config);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Operation operation, UnmarshallingContext navigator, String namespaceURI, String localName,
+ Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Operation operation, Config config, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + operation + ",child=" + config + "]");
+ operation.setConfig(config);
+ }
+}
Property changes on: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years, 4 months