JBossWS SVN: r2742 - in trunk: build/ant-import and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 15:38:37 -0400 (Sat, 31 Mar 2007)
New Revision: 2742
Modified:
trunk/build/ant-import/build-release.xml
trunk/build/etc/component-info/jbossws-jboss40.xml
trunk/build/etc/component-info/jbossws-jboss42.xml
trunk/build/etc/component-info/jbossws-jboss50.xml
trunk/build/etc/component-info/jbossws.xml
trunk/build/version.properties
trunk/integration-jboss40/build.xml
trunk/integration-jboss42/build.xml
trunk/integration-jboss50/build.xml
trunk/integration-tomcat/build.xml
trunk/jbossws-core/build.xml
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Include src builds in repository
Modified: trunk/build/ant-import/build-release.xml
===================================================================
--- trunk/build/ant-import/build-release.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/ant-import/build-release.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -53,6 +53,7 @@
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
+ <include name="jbossws-core-src.zip"/>
</fileset>
</copy>
<copy tofile="${jboss.repository.dir}/jbossws/${repository.id}/component-info.xml" file="${build.etc.dir}/component-info/jbossws.xml" filtering="true" overwrite="true">
@@ -67,6 +68,7 @@
<fileset dir="${jboss50.output.lib.dir}">
<include name="jbossws50.sar"/>
<include name="jbossws50-deployer.zip"/>
+ <include name="jbossws50-src.zip"/>
</fileset>
</copy>
<copy tofile="${jboss.repository.dir}/jbossws-jboss50/${repository.id}/component-info.xml" file="${build.etc.dir}/component-info/jbossws-jboss50.xml" filtering="true" overwrite="true">
@@ -80,6 +82,7 @@
<copy todir="${jboss.repository.dir}/jbossws-jboss42/${repository.id}/lib" overwrite="true">
<fileset dir="${jboss42.output.lib.dir}">
<include name="jbossws42.sar"/>
+ <include name="jbossws-jboss42-src.zip"/>
</fileset>
</copy>
<copy tofile="${jboss.repository.dir}/jbossws-jboss42/${repository.id}/component-info.xml" file="${build.etc.dir}/component-info/jbossws-jboss42.xml" filtering="true" overwrite="true">
@@ -93,6 +96,7 @@
<copy todir="${jboss.repository.dir}/jbossws-jboss40/${repository.id}/lib" overwrite="true">
<fileset dir="${jboss40.output.lib.dir}">
<include name="jbossws40.sar"/>
+ <include name="jbossws-jboss40-src.zip"/>
</fileset>
</copy>
<copy tofile="${jboss.repository.dir}/jbossws-jboss40/${repository.id}/component-info.xml" file="${build.etc.dir}/component-info/jbossws-jboss40.xml" filtering="true" overwrite="true">
Modified: trunk/build/etc/component-info/jbossws-jboss40.xml
===================================================================
--- trunk/build/etc/component-info/jbossws-jboss40.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/etc/component-info/jbossws-jboss40.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -6,6 +6,7 @@
licenseType="lgpl">
<artifact id="jbossws40.sar"/>
+ <artifact id="jbossws40-src.zip"/>
<import componentref="jboss/jbossws">
<compatible version="@repository.id@"/>
Modified: trunk/build/etc/component-info/jbossws-jboss42.xml
===================================================================
--- trunk/build/etc/component-info/jbossws-jboss42.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/etc/component-info/jbossws-jboss42.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -6,6 +6,7 @@
licenseType="lgpl">
<artifact id="jbossws42.sar"/>
+ <artifact id="jbossws42-src.zip"/>
<import componentref="jboss/jbossws">
<compatible version="@repository.id@"/>
Modified: trunk/build/etc/component-info/jbossws-jboss50.xml
===================================================================
--- trunk/build/etc/component-info/jbossws-jboss50.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/etc/component-info/jbossws-jboss50.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -7,6 +7,7 @@
<artifact id="jbossws50.sar"/>
<artifact id="jbossws50-deployer.zip"/>
+ <artifact id="jbossws50-src.zip"/>
<import componentref="jboss/jbossws">
<compatible version="@repository.id@"/>
Modified: trunk/build/etc/component-info/jbossws.xml
===================================================================
--- trunk/build/etc/component-info/jbossws.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/etc/component-info/jbossws.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -8,6 +8,7 @@
<artifact id="jbossws-integration.jar"/>
<artifact id="jbossws-client.jar"/>
<artifact id="jbossws-core.jar"/>
+ <artifact id="jbossws-core-src.zip"/>
<artifact id="jboss-jaxrpc.jar"/>
<artifact id="jboss-jaxws.jar"/>
<artifact id="jboss-saaj.jar"/>
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/build/version.properties 2007-03-31 19:38:37 UTC (rev 2742)
@@ -25,12 +25,12 @@
# Build and Tomcat
jboss-jbossxb=2.0.0.CR2
jboss-microcontainer=2.0.0.Beta3
-jboss-remoting=2.2.0.Alpha7
+jboss-remoting=2.2.0.GA
# JBossAS-5.0
jboss-jbossxb-jboss50=2.0.0.CR2
jboss-microcontainer-jboss50=2.0.0.Beta3
-jboss-remoting-jboss50=2.2.0.Alpha7
+jboss-remoting-jboss50=2.2.0.GA
# JBossAS-4.2
jboss-jbossxb-jboss42=1.0.0.CR9
Modified: trunk/integration-jboss40/build.xml
===================================================================
--- trunk/integration-jboss40/build.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/integration-jboss40/build.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -200,6 +200,11 @@
</metainf>
</jar>
+ <!-- Build jbossws40-src.zip -->
+ <zip zipfile="${jboss40.output.lib.dir}/jbossws40-src.zip" >
+ <fileset dir="${jboss40.java.dir}"/>
+ </zip>
+
</target>
<!--
Modified: trunk/integration-jboss42/build.xml
===================================================================
--- trunk/integration-jboss42/build.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/integration-jboss42/build.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -149,6 +149,11 @@
</metainf>
</jar>
+ <!-- Build jbossws42-src.zip -->
+ <zip zipfile="${jboss42.output.lib.dir}/jbossws42-src.zip" >
+ <fileset dir="${jboss42.java.dir}"/>
+ </zip>
+
</target>
<!-- ================================================================== -->
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/integration-jboss50/build.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -129,6 +129,11 @@
</fileset>
</zip>
+ <!-- Build jbossws50-src.zip -->
+ <zip zipfile="${jboss50.output.lib.dir}/jbossws50-src.zip" >
+ <fileset dir="${jboss50.java.dir}"/>
+ </zip>
+
</target>
<!-- ================================================================== -->
Modified: trunk/integration-tomcat/build.xml
===================================================================
--- trunk/integration-tomcat/build.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/integration-tomcat/build.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -103,6 +103,11 @@
</webinf>
</war>
+ <!-- Build jbossws-jboss42-src.zip -->
+ <zip zipfile="${tomcat.output.lib.dir}/jbossws-tomcat-src.zip" >
+ <fileset dir="${tomcat.java.dir}"/>
+ </zip>
+
</target>
<target name="tomcat-thirdparty-jar" unless="jbossws.thirdparty.available">
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/jbossws-core/build.xml 2007-03-31 19:38:37 UTC (rev 2742)
@@ -177,6 +177,11 @@
</zipfileset>
</jar>
+ <!-- Build jbossws-core-src.zip -->
+ <zip zipfile="${core.output.lib.dir}/jbossws-core-src.zip" >
+ <fileset dir="${core.java.dir}"/>
+ </zip>
+
</target>
<!-- ================================================================== -->
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 19:12:13 UTC (rev 2741)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 19:38:37 UTC (rev 2742)
@@ -344,9 +344,9 @@
Boolean allowExpand = (Boolean)msgContext.get(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
if (allowExpand != Boolean.TRUE)
{
- log.warn("*****************************");
- log.warn("* Expanding SOAPBody to DOM *");
- log.warn("*****************************");
+ log.warn("******************************************");
+ log.warn("* Unexpectedly expanding SOAPBody to DOM *");
+ log.warn("******************************************");
}
}
17 years, 8 months
JBossWS SVN: r2741 - in trunk/jbossws-core/src/java/org/jboss/ws/core: soap and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 15:12:13 -0400 (Sat, 31 Mar 2007)
New Revision: 2741
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Allow SOAPBody.expandToDOM after logical handler uses LogicalMessage.setPayload(Source)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-31 18:13:42 UTC (rev 2740)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-03-31 19:12:13 UTC (rev 2741)
@@ -192,18 +192,18 @@
if (handlersPass)
{
- // Check if protocol handlers modified the payload
- SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
- if (soapBody.isModifiedFromSource())
- {
- log.debug("Handler modified body payload, unbind message again");
- epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
- }
-
- // Invoke the service endpoint
msgContext.put(CommonMessageContext.ALLOW_EXPAND_TO_DOM, Boolean.TRUE);
try
{
+ // Check if protocol handlers modified the payload
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
+ if (soapBody.isModifiedFromSource())
+ {
+ log.debug("Handler modified body payload, unbind message again");
+ epInv = binding.unbindRequestMessage(opMetaData, reqMessage);
+ }
+
+ // Invoke the service endpoint
invokeServiceEndpointInstance(seInstance, epInv);
}
finally
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 18:13:42 UTC (rev 2740)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 19:12:13 UTC (rev 2741)
@@ -121,7 +121,7 @@
public SOAPElement addChildElement(SOAPElement child) throws SOAPException
{
log.trace("addChildElement: " + child.getElementName());
- expandToDOM(false);
+ expandToDOM();
if ((child instanceof SOAPBodyElement) == false)
child = convertToBodyElement(child);
@@ -132,7 +132,7 @@
public SOAPBodyElement addBodyElement(Name name) throws SOAPException
{
log.trace("addBodyElement: " + name);
- expandToDOM(false);
+ expandToDOM();
SOAPBodyElement child = new SOAPBodyElementDoc(name);
return (SOAPBodyElement)addChildElement(child);
}
@@ -140,7 +140,7 @@
public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
{
log.trace("addBodyElement: " + qname);
- expandToDOM(false);
+ expandToDOM();
SOAPBodyElement child = new SOAPBodyElementDoc(qname);
return (SOAPBodyElement)addChildElement(child);
}
@@ -148,7 +148,7 @@
public SOAPBodyElement addDocument(Document doc) throws SOAPException
{
log.trace("addDocument");
- expandToDOM(false);
+ expandToDOM();
Element rootElement = doc.getDocumentElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPElement soapElement = soapFactory.createElement(rootElement);
@@ -158,7 +158,7 @@
public SOAPFault addFault() throws SOAPException
{
log.trace("addFault");
- expandToDOM(true);
+ expandToDOM();
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -171,7 +171,7 @@
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
{
log.trace("addFault");
- expandToDOM(true);
+ expandToDOM();
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -185,7 +185,7 @@
public SOAPFault addFault(QName faultCode, String faultString) throws SOAPException
{
log.trace("addFault");
- expandToDOM(true);
+ expandToDOM();
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -199,7 +199,7 @@
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
{
log.trace("addFault");
- expandToDOM(true);
+ expandToDOM();
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -213,7 +213,7 @@
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
{
log.trace("addFault");
- expandToDOM(true);
+ expandToDOM();
if (hasFault())
throw new SOAPException("A SOAPBody may contain at most one SOAPFault child element");
@@ -240,14 +240,14 @@
private Iterator faultIterator()
{
- expandToDOM(true);
+ expandToDOM();
return getChildElements(new QName(getNamespaceURI(), "Fault"));
}
public Node appendChild(Node newChild) throws DOMException
{
log.trace("appendChild: " + newChild.getNodeName());
- expandToDOM(false);
+ expandToDOM();
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -257,7 +257,7 @@
public Node insertBefore(Node newChild, Node refChild) throws DOMException
{
log.trace("insertBefore: " + newChild.getNodeName());
- expandToDOM(false);
+ expandToDOM();
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -267,7 +267,7 @@
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
{
log.trace("replaceChild: " + newChild.getNodeName());
- expandToDOM(false);
+ expandToDOM();
if (needsConversionToBodyElement(newChild))
newChild = convertToBodyElement(newChild);
@@ -277,42 +277,42 @@
public Iterator getChildElements()
{
log.trace("getChildElements");
- expandToDOM(false);
+ expandToDOM();
return super.getChildElements();
}
public Iterator getChildElements(Name name)
{
log.trace("getChildElements: " + name);
- expandToDOM(false);
+ expandToDOM();
return super.getChildElements(name);
}
public NodeList getChildNodes()
{
log.trace("getChildNodes");
- expandToDOM(false);
+ expandToDOM();
return super.getChildNodes();
}
public Node getFirstChild()
{
log.trace("getFirstChild");
- expandToDOM(false);
+ expandToDOM();
return super.getFirstChild();
}
public Node getLastChild()
{
log.trace("getLastChild");
- expandToDOM(false);
+ expandToDOM();
return super.getLastChild();
}
public boolean hasChildNodes()
{
log.trace("hasChildNodes");
- expandToDOM(false);
+ expandToDOM();
return super.hasChildNodes();
}
@@ -332,7 +332,7 @@
return new SOAPBodyElementDoc(element);
}
- private void expandToDOM(boolean handleFault)
+ private void expandToDOM()
{
if (isDOMValid == false)
{
@@ -342,8 +342,12 @@
if (msgContext != null && UnifiedMetaData.isFinalRelease() == false)
{
Boolean allowExpand = (Boolean)msgContext.get(CommonMessageContext.ALLOW_EXPAND_TO_DOM);
- if (handleFault == false && allowExpand != Boolean.TRUE)
- throw new WSException("Expanding content element to DOM");
+ if (allowExpand != Boolean.TRUE)
+ {
+ log.warn("*****************************");
+ log.warn("* Expanding SOAPBody to DOM *");
+ log.warn("*****************************");
+ }
}
log.trace("BEGIN expandToDOM");
@@ -391,7 +395,7 @@
public Document extractContentAsDocument() throws SOAPException
{
log.trace("extractContentAsDocument");
- expandToDOM(false);
+ expandToDOM();
Iterator childElements = DOMUtils.getChildElements(this);
// zero child elements?
17 years, 8 months
JBossWS SVN: r2740 - in trunk/jbossws-core/src/java/org/jboss/ws/core: soap and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 14:13:42 -0400 (Sat, 31 Mar 2007)
New Revision: 2740
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Fix SOAPBody.getSource() when in DOM valid
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-03-31 17:33:18 UTC (rev 2739)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/PayloadBinding.java 2007-03-31 18:13:42 UTC (rev 2740)
@@ -91,6 +91,10 @@
SOAPMessage reqMessage = (SOAPMessage)payload;
SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMessage.getSOAPBody();
Source source = soapBody.getSource();
+
+ if (source == null)
+ throw new IllegalStateException ("Payload cannot be null");
+
epInv.setRequestParamValue(xmlName, source);
return epInv;
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 17:33:18 UTC (rev 2739)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 18:13:42 UTC (rev 2740)
@@ -37,6 +37,7 @@
import javax.xml.soap.SOAPFault;
import javax.xml.soap.Text;
import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -91,7 +92,21 @@
public Source getSource()
{
- return (xmlFragment != null ? xmlFragment.getSource() : null);
+ Source source;
+ if (xmlFragment != null)
+ {
+ source = xmlFragment.getSource();
+ }
+ else if (isDOMValid == true)
+ {
+ Element child = (Element)getFirstChild();
+ source = (child != null ? new DOMSource(child) : null);
+ }
+ else
+ {
+ throw new IllegalStateException("SOAPBody must be DOM valid or have a Source attached");
+ }
+ return source;
}
public void setSource(Source source)
17 years, 8 months
JBossWS SVN: r2739 - in trunk: jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 13:33:18 -0400 (Sat, 31 Mar 2007)
New Revision: 2739
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml
Modified:
trunk/build/version.properties
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/jbossws-tests/ant-import/build-samples-jaxws.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanPayload.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
Log:
Add support for logical handlers on Provider
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-03-31 16:40:31 UTC (rev 2738)
+++ trunk/build/version.properties 2007-03-31 17:33:18 UTC (rev 2739)
@@ -28,7 +28,7 @@
jboss-remoting=2.2.0.Alpha7
# JBossAS-5.0
-jboss-jbossxb-jboss50=2.0.0.CR1
+jboss-jbossxb-jboss50=2.0.0.CR2
jboss-microcontainer-jboss50=2.0.0.Beta3
jboss-remoting-jboss50=2.2.0.Alpha7
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-03-31 16:40:31 UTC (rev 2738)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-03-31 17:33:18 UTC (rev 2739)
@@ -126,6 +126,9 @@
serviceMetaData.setWsdlLocation(wsdlURL);
}
+ // process handler chain
+ processHandlerChain(sepMetaData, sepClass);
+
// process config
processEndpointConfig(udi, sepClass, linkName, sepMetaData);
Modified: trunk/jbossws-tests/ant-import/build-samples-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-03-31 16:40:31 UTC (rev 2738)
+++ trunk/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-03-31 17:33:18 UTC (rev 2739)
@@ -176,6 +176,8 @@
<war warfile="${tests.output.dir}/libs/jaxws-samples-provider-payload.war" webxml="${tests.output.dir}/resources/jaxws/samples/provider/payload/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/samples/provider/ProviderBeanPayload.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml"/>
</classes>
<webinf dir="${tests.output.dir}/resources/jaxws/samples/provider/shared">
<include name="wsdl/Provider.wsdl"/>
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.java 2007-03-31 17:33:18 UTC (rev 2739)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.provider;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.core.jaxws.handler.GenericLogicalHandler;
+import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Element;
+
+/**
+ * A jaxws logical handler
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 24-Nov-2005
+ */
+public class LogicalSourceHandler extends GenericLogicalHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(LogicalSourceHandler.class);
+
+ @Override
+ public boolean handleOutbound(MessageContext msgContext)
+ {
+ return appendHandlerName(msgContext, "Outbound");
+ }
+
+ @Override
+ public boolean handleInbound(MessageContext msgContext)
+ {
+ return appendHandlerName(msgContext, "Inbound");
+ }
+
+ public boolean appendHandlerName(MessageContext msgContext, String direction)
+ {
+ try
+ {
+ // Get the payload as Source
+ LogicalMessageContext logicalContext = (LogicalMessageContext)msgContext;
+ Source source = logicalContext.getMessage().getPayload();
+ TransformerFactory tf = TransformerFactory.newInstance();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ tf.newTransformer().transform(source, new StreamResult(baos));
+
+ // Parse the payload and extract the value
+ Element root = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
+
+ String oldValue = DOMUtils.getTextContent(root);
+ String newValue = oldValue + ":" + direction + getHandlerName();
+ root.setTextContent(newValue);
+
+ log.debug("oldValue: " + oldValue);
+ log.debug("newValue: " + newValue);
+
+ // Set the updated payload
+ source = new DOMSource(root);
+ logicalContext.getMessage().setPayload(source);
+
+ return true;
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WebServiceException(ex);
+ }
+ }
+}
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/LogicalSourceHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanPayload.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanPayload.java 2007-03-31 16:40:31 UTC (rev 2738)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanPayload.java 2007-03-31 17:33:18 UTC (rev 2739)
@@ -27,6 +27,7 @@
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
+import javax.jws.HandlerChain;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
@@ -43,8 +44,10 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Jun-2006
*/
+
+@HandlerChain(file = "provider-handlers.xml")
@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
+// @ServiceMode(value = Service.Mode.PAYLOAD) - PAYLOAD is implicit
public class ProviderBeanPayload implements Provider<Source>
{
public Source invoke(Source req)
@@ -60,7 +63,7 @@
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\">Hello:InboundLogicalHandler</ns1:somePayload>";
if (!expReq.equals(xmlReq))
throw new WebServiceException("Unexpected payload: " + xmlReq);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-03-31 16:40:31 UTC (rev 2738)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.java 2007-03-31 17:33:18 UTC (rev 2739)
@@ -33,6 +33,7 @@
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
@@ -58,9 +59,12 @@
*/
public class ProviderPayloadTestCase extends JBossWSTest
{
- private String msgString =
- "<ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>";
+ private String reqString =
+ "<ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'>Hello</ns1:somePayload>";
+ private String resString =
+ "<ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'>Hello:InboundLogicalHandler:OutboundLogicalHandler</ns1:somePayload>";
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(ProviderPayloadTestCase.class, "jaxws-samples-provider-payload.war");
@@ -77,12 +81,36 @@
public void testProviderDispatch() throws Exception
{
Dispatch<Source> dispatch = createDispatch("ProviderEndpoint");
- Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(msgString)));
+ Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
Element docElement = getElementFromSource(resPayload);
- assertEquals(DOMUtils.parse(msgString), docElement);
+ assertEquals(DOMUtils.parse(resString), docElement);
}
+ public void testProviderMessage() throws Exception
+ {
+ String reqEnvStr =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Body>" + reqString + "</env:Body>" +
+ "</env:Envelope>";
+
+ String resEnvString =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Header/>" +
+ " <env:Body>" + resString + "</env:Body>" +
+ "</env:Envelope>";
+
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
+ SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnvStr.getBytes()));
+
+ URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-payload");
+ SOAPMessage resMsg = con.call(reqMsg, epURL);
+ SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
+
+ assertEquals(DOMUtils.parse(resEnvString), resEnv);
+ }
+
private Dispatch<Source> createDispatch(String target) throws MalformedURLException, JAXBException
{
String targetNS = "http://org.jboss.ws/provider";
@@ -96,25 +124,4 @@
Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
return dispatch;
}
-
- public void testProviderMessage() throws Exception
- {
- String reqString =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Body>" +
- " <ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqString.getBytes()));
- SOAPEnvelope reqEnv = reqMsg.getSOAPPart().getEnvelope();
-
- URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-samples-provider-payload");
- SOAPMessage resMsg = con.call(reqMsg, epURL);
- SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
-
- assertEquals(reqEnv, resEnv);
- }
}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml 2007-03-31 17:33:18 UTC (rev 2739)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ns1="http://org.jboss.ws/jaxws/samples/logicalhandler"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
+
+ <handler-chain>
+ <handler>
+ <handler-name> LogicalHandler </handler-name>
+ <handler-class> org.jboss.test.ws.jaxws.samples.provider.LogicalSourceHandler </handler-class>
+ </handler>
+ </handler-chain>
+
+</handler-chains>
\ No newline at end of file
Property changes on: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/provider/provider-handlers.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r2738 - trunk/jbossws-core/src/java/javax/xml/soap.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 12:40:31 -0400 (Sat, 31 Mar 2007)
New Revision: 2738
Modified:
trunk/jbossws-core/src/java/javax/xml/soap/SAAJMetaFactory.java
Log:
Fix default SAAJMetaFactory
Modified: trunk/jbossws-core/src/java/javax/xml/soap/SAAJMetaFactory.java
===================================================================
--- trunk/jbossws-core/src/java/javax/xml/soap/SAAJMetaFactory.java 2007-03-31 14:46:22 UTC (rev 2737)
+++ trunk/jbossws-core/src/java/javax/xml/soap/SAAJMetaFactory.java 2007-03-31 16:40:31 UTC (rev 2738)
@@ -57,7 +57,7 @@
static SAAJMetaFactory getInstance() throws SOAPException
{
String propertyName = "javax.xml.soap.MetaFactory";
- String defaultImpl = "com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl";
+ String defaultImpl = "org.jboss.ws.core.soap.SAAJMetaFactoryImpl";
SAAJMetaFactory factory = (SAAJMetaFactory)FactoryLoader.loadFactory(propertyName, defaultImpl);
if (factory == null)
17 years, 8 months
JBossWS SVN: r2737 - trunk/integration-jboss50.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 10:46:22 -0400 (Sat, 31 Mar 2007)
New Revision: 2737
Modified:
trunk/integration-jboss50/build.xml
Log:
don't deploy jbossxb
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-03-31 14:44:57 UTC (rev 2736)
+++ trunk/integration-jboss50/build.xml 2007-03-31 14:46:22 UTC (rev 2737)
@@ -151,9 +151,6 @@
<include name="jbossws-jboss50-integration.jar"/>
</fileset>
</copy>
-
- <copy todir="${jboss50.home}/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
- <copy todir="${jboss50.home}/client" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
</target>
<!-- ================================================================== -->
17 years, 8 months
JBossWS SVN: r2736 - in trunk: integration-jboss50 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 10:44:57 -0400 (Sat, 31 Mar 2007)
New Revision: 2736
Modified:
trunk/build/version.properties
trunk/integration-jboss50/build.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/serviceref/ServiceRefEJBTestCase.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws1011/META-INF/ejb-jar.xml
trunk/jbossws-tests/src/resources/jaxrpc/serviceref/META-INF/ejb-jar.xml
Log:
Fix invalid DDs
Modified: trunk/build/version.properties
===================================================================
--- trunk/build/version.properties 2007-03-31 13:58:18 UTC (rev 2735)
+++ trunk/build/version.properties 2007-03-31 14:44:57 UTC (rev 2736)
@@ -23,7 +23,7 @@
stax-api=1.0
# Build and Tomcat
-jboss-jbossxb=2.0.0.CR1
+jboss-jbossxb=2.0.0.CR2
jboss-microcontainer=2.0.0.Beta3
jboss-remoting=2.2.0.Alpha7
Modified: trunk/integration-jboss50/build.xml
===================================================================
--- trunk/integration-jboss50/build.xml 2007-03-31 13:58:18 UTC (rev 2735)
+++ trunk/integration-jboss50/build.xml 2007-03-31 14:44:57 UTC (rev 2736)
@@ -151,6 +151,9 @@
<include name="jbossws-jboss50-integration.jar"/>
</fileset>
</copy>
+
+ <copy todir="${jboss50.home}/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
+ <copy todir="${jboss50.home}/client" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
</target>
<!-- ================================================================== -->
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/serviceref/ServiceRefEJBTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/serviceref/ServiceRefEJBTestCase.java 2007-03-31 13:58:18 UTC (rev 2735)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/serviceref/ServiceRefEJBTestCase.java 2007-03-31 14:44:57 UTC (rev 2736)
@@ -76,7 +76,7 @@
public void testEJBClient() throws Exception
{
InitialContext iniCtx = getInitialContext();
- EJBRemoteHome ejbHome = (EJBRemoteHome)iniCtx.lookup("/ejb/EJBClient");
+ EJBRemoteHome ejbHome = (EJBRemoteHome)iniCtx.lookup("/EJBClient");
EJBRemote ejbRemote = ejbHome.create();
String helloWorld = "Hello World!";
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws1011/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws1011/META-INF/ejb-jar.xml 2007-03-31 13:58:18 UTC (rev 2735)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws1011/META-INF/ejb-jar.xml 2007-03-31 14:44:57 UTC (rev 2736)
@@ -1,24 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
- version="2.1">
+<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
+
<enterprise-beans>
-
+
<entity>
<ejb-name>SimpleEntityBean</ejb-name>
- <local-home>
- org.jboss.test.ws.jaxrpc.jbws1011.SimpleEntityHome
- </local-home>
+ <local-home> org.jboss.test.ws.jaxrpc.jbws1011.SimpleEntityHome </local-home>
<local>org.jboss.test.ws.jaxrpc.jbws1011.SimpleEntityLocal</local>
- <ejb-class>
- org.jboss.test.ws.jaxrpc.jbws1011.SimpleEntityBean
- </ejb-class>
+ <ejb-class> org.jboss.test.ws.jaxrpc.jbws1011.SimpleEntityBean </ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
- <reentrant>False</reentrant>
+ <reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Simple</abstract-schema-name>
<cmp-field>
@@ -33,6 +27,6 @@
<ejb-class>org.jboss.test.ws.jaxrpc.jbws1011.TestEndpointBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
- </session>
+ </session>
</enterprise-beans>
</ejb-jar>
\ No newline at end of file
Modified: trunk/jbossws-tests/src/resources/jaxrpc/serviceref/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/serviceref/META-INF/ejb-jar.xml 2007-03-31 13:58:18 UTC (rev 2735)
+++ trunk/jbossws-tests/src/resources/jaxrpc/serviceref/META-INF/ejb-jar.xml 2007-03-31 14:44:57 UTC (rev 2736)
@@ -7,7 +7,7 @@
<enterprise-beans>
<session>
- <ejb-name>ejb/EJBClient</ejb-name>
+ <ejb-name>EJBClient</ejb-name>
<home>org.jboss.test.ws.jaxrpc.serviceref.EJBRemoteHome</home>
<remote>org.jboss.test.ws.jaxrpc.serviceref.EJBRemote</remote>
<ejb-class>org.jboss.test.ws.jaxrpc.serviceref.EJBClient</ejb-class>
17 years, 8 months
JBossWS SVN: r2735 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/handler and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-31 09:58:18 -0400 (Sat, 31 Mar 2007)
New Revision: 2735
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws1121/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml
trunk/jbossws-tests/src/resources/jaxrpc/outparam/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/samples/holder/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/samples/mtom/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/ejb-jar.xml
trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/store-pass-encrypt/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/xop/doclit/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml
Log:
Allow multiple writing of XMLFragment
Fix invalid DD that do not conform to the schema
SOAPBody payload is backed up by XMLFrament instead of source
Remove warning that getHandlerChain() returns a modifiableList
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -60,9 +60,6 @@
if (handlerType == HandlerType.POST || handlerType == HandlerType.ALL)
handlerChain.addAll(postHandlerChain);
- log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a modifyable list");
- // return Collections.unmodifiableList(handlerChain);
-
return handlerChain;
}
@@ -89,9 +86,6 @@
public List<Handler> getHandlerChain()
{
- log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a modifiable list");
- // return Collections.unmodifiableList(jaxwsHandlerChain);
-
return new ArrayList<Handler>(jaxwsHandlerChain);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -104,10 +104,6 @@
if (scopedHandler.matches(info))
handlers.add(scopedHandler.handler);
}
-
- log.warn("[JBCTS-544] - HandlerResolver.getHandlerChain() expected to return a modifiable list");
- // return Collections.unmodifiableList(jaxwsHandlerChain);
-
return handlers;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.IOException;
import java.util.Iterator;
import javax.xml.bind.JAXBContext;
@@ -31,17 +32,17 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.LogicalMessage;
import javax.xml.ws.WebServiceException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.binding.BufferedStreamSource;
import org.jboss.ws.core.soap.EnvelopeBuilderDOM;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -103,9 +104,16 @@
SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
if (style == Style.RPC)
{
- EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
- Element domBodyElement = EnvelopeBuilderDOM.getElementFromSource(source);
- builder.buildBodyElementRpc(soapBody, domBodyElement);
+ try
+ {
+ EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
+ Element domBodyElement = DOMUtils.sourceToElement(source);
+ builder.buildBodyElementRpc(soapBody, domBodyElement);
+ }
+ catch (IOException ex)
+ {
+ WSException.rethrow(ex);
+ }
}
else
{
@@ -122,7 +130,7 @@
{
soapBody.setSource(source);
}
-
+
// The body payload has been modified
soapBody.setModifiedFromSource(true);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -23,11 +23,8 @@
//$Id$
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.Reader;
import java.util.Iterator;
import javax.xml.namespace.QName;
@@ -37,23 +34,15 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
/**
* A SOAPEnvelope builder for JAXRPC based on DOM
@@ -210,17 +199,17 @@
}
}
}
-
+
// Process additional soap encoded body elements
- boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements && itBody.hasNext();
- while(attachHRefElements && itBody.hasNext())
+ boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
+ attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
+ attachHRefElements = attachHRefElements && itBody.hasNext();
+ while (attachHRefElements && itBody.hasNext())
{
Element srcElement = (Element)itBody.next();
soapBody.addChildElement(soapFactory.createElement(srcElement, true));
}
-
+
// Inline all attached href elements
if (attachHRefElements)
{
@@ -234,9 +223,9 @@
public void buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
soapBody.removeContents();
-
+
Element srcElement = (Element)domBodyElement;
-
+
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
@@ -250,7 +239,7 @@
public void buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
soapBody.removeContents();
-
+
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
soapBodyElement = (SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
@@ -272,69 +261,4 @@
destElement.setXMLFragment(xmlFragment);
}
}
-
- public static Element getElementFromSource(Source payload)
- {
- Element child = null;
- try
- {
- if (payload instanceof StreamSource)
- {
- StreamSource streamSource = (StreamSource)payload;
-
- InputStream ins = streamSource.getInputStream();
- if (ins != null)
- {
- child = DOMUtils.parse(ins);
- }
- else
- {
- Reader reader = streamSource.getReader();
- child = DOMUtils.parse(new InputSource(reader));
- }
- }
- else if (payload instanceof DOMSource)
- {
- DOMSource domSource = (DOMSource)payload;
- Node node = domSource.getNode();
- if (node instanceof Element)
- {
- child = (Element)node;
- }
- else if (node instanceof Document)
- {
- child = ((Document)node).getDocumentElement();
- }
- else
- {
- throw new WSException("Unsupported Node type: " + node.getClass().getName());
- }
- }
- else if (payload instanceof SAXSource)
- {
- // The fact that JAXBSource derives from SAXSource is an implementation detail.
- // Thus in general applications are strongly discouraged from accessing methods defined on SAXSource.
- // The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.
-
- TransformerFactory tf = TransformerFactory.newInstance();
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- tf.newTransformer().transform(payload, new StreamResult(baos));
-
- child = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
- }
- else
- {
- throw new WSException("Source type not implemented: " + payload.getClass().getName());
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot get root element from Source" + ex);
- }
- return child;
- }
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -23,7 +23,6 @@
// $Id$
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
@@ -38,15 +37,11 @@
import javax.xml.soap.SOAPFault;
import javax.xml.soap.Text;
import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.jaxrpc.binding.BufferedStreamSource;
import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.core.utils.DOMWriter;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -70,7 +65,7 @@
private static Logger log = Logger.getLogger(SOAPBodyImpl.class);
// Generic JAXWS payload
- private Source source;
+ private XMLFragment xmlFragment;
private boolean isDOMValid = true;
private boolean isModifiedFromSource;
@@ -88,7 +83,7 @@
{
return isModifiedFromSource;
}
-
+
public void setModifiedFromSource(boolean isModified)
{
this.isModifiedFromSource = isModified;
@@ -96,21 +91,15 @@
public Source getSource()
{
- // Do the buffering
- if (source instanceof StreamSource && !(source instanceof BufferedStreamSource))
- source = new BufferedStreamSource((StreamSource)source);
-
- return source;
+ return (xmlFragment != null ? xmlFragment.getSource() : null);
}
public void setSource(Source source)
{
log.debug("setPayload: " + source);
-
removeContents();
-
- this.source = source;
- this.isDOMValid = false;
+ xmlFragment = new XMLFragment(source);
+ isDOMValid = false;
}
/** Convert the child into a SOAPBodyElement */
@@ -347,10 +336,10 @@
isDOMValid = true;
try
{
- Element child = getBodyElementFromSource();
+ Element child = xmlFragment.toElement();
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
addChildElement(soapFactory.createElement(child));
- source = null;
+ xmlFragment = null;
}
catch (RuntimeException rte)
{
@@ -370,25 +359,13 @@
}
}
- private Element getBodyElementFromSource()
- {
- Element child = EnvelopeBuilderDOM.getElementFromSource(source);
- // Allow multiple writing
- source = new DOMSource(child);
-
- return child;
- }
-
@Override
public void writeElementContent(Writer writer) throws IOException
{
- if (source != null)
+ if (xmlFragment != null)
{
- Element child = getBodyElementFromSource();
- String xmlPayload = DOMWriter.printNode(child, false);
- if (log.isDebugEnabled())
- log.debug("writeElementContent from payload: " + xmlPayload);
- writer.write(xmlPayload);
+ log.debug("writeElementContent from payload: " + xmlFragment);
+ xmlFragment.writeTo(writer);
}
else
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLFragment.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -36,6 +36,7 @@
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
@@ -101,8 +102,8 @@
public Source getSource()
{
- source = beginStreamSourceAccess(source);
- endStreamSourceAccess();
+ source = beginSourceAccess(source);
+ endSourceAccess();
return source;
}
@@ -127,18 +128,16 @@
public Element toElement()
{
Element retElement = null;
-
try
{
- source = beginStreamSourceAccess(source);
+ source = beginSourceAccess(source);
retElement = DOMUtils.sourceToElement(source);
- endStreamSourceAccess();
+ endSourceAccess();
}
catch (IOException ex)
{
- handleStreamSourceAccessException(ex);
+ handleSourceAccessException(ex);
}
-
return retElement;
}
@@ -157,17 +156,17 @@
*/
private void writeSourceInternal(Writer writer) throws IOException
{
- if (source instanceof DOMSource)
+ try
{
- DOMSource domSource = (DOMSource)source;
- new DOMWriter(writer).print(domSource.getNode());
- }
- else if (source instanceof StreamSource)
- {
- try
+ source = beginSourceAccess(source);
+
+ if (source instanceof DOMSource)
{
- source = beginStreamSourceAccess(source);
-
+ DOMSource domSource = (DOMSource)source;
+ new DOMWriter(writer).print(domSource.getNode());
+ }
+ else if (source instanceof StreamSource || source instanceof SAXSource)
+ {
StreamSource streamSource = (StreamSource)source;
Reader reader = streamSource.getReader();
@@ -185,30 +184,44 @@
writer.write(cbuf, 0, r);
r = reader.read(cbuf);
}
-
- endStreamSourceAccess();
}
- catch (IOException ex)
+ else
{
- handleStreamSourceAccessException(ex);
+ throw new IllegalArgumentException("Unsupported source type: " + source);
}
+
+ endSourceAccess();
}
- else
+ catch (IOException ex)
{
- throw new IllegalArgumentException("Unable to process source: " + source);
+ handleSourceAccessException(ex);
}
}
- private Source beginStreamSourceAccess(Source source)
+ private Source beginSourceAccess(Source source)
{
// Buffer the source content
if (source instanceof StreamSource && !(source instanceof BufferedStreamSource))
+ {
source = new BufferedStreamSource((StreamSource)source);
-
+ }
+ else
+ {
+ try
+ {
+ Element element = DOMUtils.sourceToElement(source);
+ source = new DOMSource(element);
+ }
+ catch (IOException ex)
+ {
+ WSException.rethrow(ex);
+ }
+ }
+
return source;
}
- private void endStreamSourceAccess()
+ private void endSourceAccess()
{
// Create the marker exception
if (source instanceof StreamSource)
@@ -217,7 +230,7 @@
}
}
- private void handleStreamSourceAccessException(IOException ex)
+ private void handleSourceAccessException(IOException ex)
{
if (source instanceof StreamSource && streamSourceAccessMarker != null)
{
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-03-31 13:58:18 UTC (rev 2735)
@@ -571,7 +571,6 @@
TransformerFactory tf = TransformerFactory.newInstance();
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
tf.newTransformer().transform(source, new StreamResult(baos));
-
retElement = DOMUtils.parse(new ByteArrayInputStream(baos.toByteArray()));
}
else
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws1121/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws1121/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws1121/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard WSSecurity Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws723/META-INF/ejb-jar.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -8,8 +8,8 @@
<enterprise-beans>
<session>
<ejb-name>RoleSecuredSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
@@ -20,8 +20,8 @@
</session>
<session>
<ejb-name>BasicSecuredSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
@@ -29,8 +29,8 @@
</session>
<session>
<ejb-name>ConfidentialSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.jbws723.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.jbws723.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.jbws723.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.jbws723.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/outparam/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/outparam/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/outparam/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/samples/holder/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/holder/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/samples/holder/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/samples/mtom/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/mtom/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/samples/mtom/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard MTOM Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/ejb-jar.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/samples/secureejb/META-INF/ejb-jar.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -8,8 +8,8 @@
<enterprise-beans>
<session>
<ejb-name>RoleSecuredSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
@@ -20,8 +20,8 @@
</session>
<session>
<ejb-name>BasicSecuredSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
@@ -29,8 +29,8 @@
</session>
<session>
<ejb-name>ConfidentialSLSB</ejb-name>
+ <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<remote>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationRemote</remote>
- <home>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationHome</home>
<service-endpoint>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationService</service-endpoint>
<ejb-class>org.jboss.test.ws.jaxrpc.samples.secureejb.OrganizationImpl</ejb-class>
<session-type>Stateless</session-type>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard WSSecurity Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/store-pass-encrypt/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/store-pass-encrypt/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/samples/wssecurity/store-pass-encrypt/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard WSSecurity Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/xop/doclit/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/xop/doclit/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/xop/doclit/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard MTOM Endpoint</param-value>
</context-param>
Modified: trunk/jbossws-tests/src/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml 2007-03-30 23:45:39 UTC (rev 2734)
+++ trunk/jbossws-tests/src/resources/jaxrpc/xop/rpclit/WEB-INF/web.xml 2007-03-31 13:58:18 UTC (rev 2735)
@@ -6,7 +6,7 @@
version="2.4">
<context-param>
- <param-name>jbossws-config-name</param-name>>
+ <param-name>jbossws-config-name</param-name>
<param-value>Standard MTOM Endpoint</param-value>
</context-param>
17 years, 8 months
JBossWS SVN: r2733 - trunk/jbossws-core/src/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-03-30 17:02:28 -0400 (Fri, 30 Mar 2007)
New Revision: 2733
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Fix multiple writes of Source on SOAPBody.
Fixes Response and Async CTS tests
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-03-30 21:02:28 UTC (rev 2733)
@@ -38,6 +38,7 @@
import javax.xml.soap.SOAPFault;
import javax.xml.soap.Text;
import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.jboss.logging.Logger;
@@ -372,12 +373,9 @@
private Element getBodyElementFromSource()
{
Element child = EnvelopeBuilderDOM.getElementFromSource(source);
- if (source instanceof StreamSource)
- {
- // reset the excausted input stream
- String xmlStr = DOMWriter.printNode(child, false);
- source = new StreamSource(new ByteArrayInputStream(xmlStr.getBytes()));
- }
+ // Allow multiple writing
+ source = new DOMSource(child);
+
return child;
}
17 years, 9 months
JBossWS SVN: r2732 - in trunk: jbossws-core/src/java/org/jboss/ws/core/jaxws/binding and 10 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-03-30 13:33:56 -0400 (Fri, 30 Mar 2007)
New Revision: 2732
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java
Log:
Add support for handlers defined on the Service
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/client/HandlerRegistryImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -109,7 +109,8 @@
epMetaData.clearHandlers();
for (HandlerInfo info : infos)
{
- HandlerMetaDataJAXRPC handler = new HandlerMetaDataJAXRPC(epMetaData, HandlerType.ENDPOINT);
+ HandlerMetaDataJAXRPC handler = new HandlerMetaDataJAXRPC(HandlerType.ENDPOINT);
+ handler.setEndpointMetaData(epMetaData);
handler.setHandlerClassName(info.getHandlerClass().getName());
handler.setSoapRoles(roles);
if(log.isDebugEnabled()) log.debug("Add handler to: " + portName + handler);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/binding/BindingImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -89,7 +89,7 @@
public List<Handler> getHandlerChain()
{
- log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a modifyable list");
+ log.warn("[JBCTS-544] - Binding.getHandlerChain() expected to return a modifiable list");
// return Collections.unmodifiableList(jaxwsHandlerChain);
return new ArrayList<Handler>(jaxwsHandlerChain);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ClientImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -76,7 +76,7 @@
{
// provide logging
private static Logger log = Logger.getLogger(ClientImpl.class);
-
+
private final EndpointMetaData epMetaData;
private final HandlerResolver handlerResolver;
private Map<HandlerType, HandlerChainExecutor> executorMap = new HashMap<HandlerType, HandlerChainExecutor>();
@@ -89,7 +89,7 @@
this.epMetaData = epMetaData;
this.handlerResolver = handlerResolver;
- resetCreateBindingHandlerChain();
+ initBindingHandlerChain(false);
// The config may change at some later point in time
// when applications utilize the ServiceDecorator API
@@ -100,7 +100,7 @@
/**
* Reset or create the client handler chain in the binding.<br>
*/
- private void resetCreateBindingHandlerChain()
+ private void initBindingHandlerChain(boolean clearExistingHandlers)
{
BindingExt binding = (BindingExt)getBindingProvider().getBinding();
PortInfoImpl portInfo = new PortInfoImpl(epMetaData);
@@ -108,9 +108,9 @@
if (handlerResolver instanceof HandlerResolverImpl)
{
HandlerResolverImpl impl = (HandlerResolverImpl)handlerResolver;
- impl.initHandlerChain(epMetaData, HandlerType.PRE);
- impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT);
- impl.initHandlerChain(epMetaData, HandlerType.POST);
+ impl.initHandlerChain(epMetaData, HandlerType.PRE, clearExistingHandlers);
+ impl.initHandlerChain(epMetaData, HandlerType.ENDPOINT, clearExistingHandlers);
+ impl.initHandlerChain(epMetaData, HandlerType.POST, clearExistingHandlers);
List<Handler> preChain = impl.getHandlerChain(portInfo, HandlerType.PRE);
binding.setHandlerChain(preChain, HandlerType.PRE);
@@ -133,7 +133,7 @@
log.debug("Configuration change event received. Reconfigure handler chain: " + object);
// re-populate the binding handler chain
- resetCreateBindingHandlerChain();
+ initBindingHandlerChain(true);
}
@Override
@@ -176,15 +176,15 @@
protected void setInboundContextProperties()
{
MessageContext msgContext = (MessageContext)MessageContextAssociation.peekMessageContext();
-
+
// Map of attachments to a message for the inbound message, key is the MIME Content-ID, value is a DataHandler
msgContext.put(MessageContext.INBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
-
+
// Remoting meta data are available on successfull call completion
if (msgContext.containsKey(CommonMessageContext.REMOTING_METADATA))
{
Map<?, ?> remotingMetadata = (Map)msgContext.get(CommonMessageContext.REMOTING_METADATA);
-
+
// Get the HTTP_RESPONSE_CODE
Integer resposeCode = (Integer)remotingMetadata.get(HTTPMetadataConstants.RESPONSE_CODE);
if (resposeCode != null)
@@ -207,7 +207,7 @@
// Mark the message context as outbound
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.put(MessageContextJAXWS.MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
-
+
// Map of attachments to a message for the outbound message, key is the MIME Content-ID, value is a DataHandler
msgContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, new HashMap<String, DataHandler>());
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -76,9 +76,9 @@
// Initialize the handler chain
if (isInitialized() == false)
{
- resolver.initHandlerChain(sepMetaData, HandlerType.PRE);
- resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT);
- resolver.initHandlerChain(sepMetaData, HandlerType.POST);
+ resolver.initHandlerChain(sepMetaData, HandlerType.PRE, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.ENDPOINT, true);
+ resolver.initHandlerChain(sepMetaData, HandlerType.POST, true);
setInitialized(true);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -26,7 +26,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -49,6 +48,7 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
/**
@@ -104,54 +104,75 @@
if (scopedHandler.matches(info))
handlers.add(scopedHandler.handler);
}
- return Collections.unmodifiableList(handlers);
+
+ log.warn("[JBCTS-544] - HandlerResolver.getHandlerChain() expected to return a modifiable list");
+ // return Collections.unmodifiableList(jaxwsHandlerChain);
+
+ return handlers;
}
- public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
+ public void initServiceHandlerChain(ServiceMetaData serviceMetaData)
{
- log.debug("initHandlerChain: " + type);
+ log.debug("initServiceHandlerChain: " + serviceMetaData.getServiceName());
// clear all exisisting handler to avoid double registration
- List<ScopedHandler> handlerMap = getHandlerMap(type);
+ List<ScopedHandler> handlerMap = getHandlerMap(HandlerType.ENDPOINT);
handlerMap.clear();
+ ClassLoader classLoader = serviceMetaData.getUnifiedMetaData().getClassLoader();
+ for (HandlerMetaData handlerMetaData : serviceMetaData.getHandlerMetaData())
+ addHandler(classLoader, HandlerType.ENDPOINT, handlerMetaData);
+ }
+
+ public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type, boolean clearExistingHandlers)
+ {
+ log.debug("initHandlerChain: " + type);
+
+ List<ScopedHandler> handlerMap = getHandlerMap(type);
+
+ if (clearExistingHandlers)
+ handlerMap.clear();
+
+ ClassLoader classLoader = epMetaData.getClassLoader();
for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
+ addHandler(classLoader, type, handlerMetaData);
+ }
+
+ private void addHandler(ClassLoader classLoader, HandlerType type, HandlerMetaData handlerMetaData)
+ {
+ HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
+ String handlerName = jaxwsMetaData.getHandlerName();
+ String className = jaxwsMetaData.getHandlerClassName();
+ Set<QName> soapHeaders = jaxwsMetaData.getSoapHeaders();
+
+ try
{
- HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
- String handlerName = jaxwsMetaData.getHandlerName();
- String className = jaxwsMetaData.getHandlerClassName();
- Set<QName> soapHeaders = jaxwsMetaData.getSoapHeaders();
+ // Load the handler class using the deployments top level CL
+ Class hClass = classLoader.loadClass(className);
+ Handler handler = (Handler)hClass.newInstance();
- try
- {
- // Load the handler class using the deployments top level CL
- ClassLoader classLoader = epMetaData.getClassLoader();
- Class hClass = classLoader.loadClass(className);
- Handler handler = (Handler)hClass.newInstance();
+ if (handler instanceof GenericHandler)
+ ((GenericHandler)handler).setHandlerName(handlerName);
- if (handler instanceof GenericHandler)
- ((GenericHandler)handler).setHandlerName(handlerName);
+ if (handler instanceof GenericSOAPHandler)
+ ((GenericSOAPHandler)handler).setHeaders(soapHeaders);
- if (handler instanceof GenericSOAPHandler)
- ((GenericSOAPHandler)handler).setHeaders(soapHeaders);
+ // Inject resources
+ injectResources(handler);
- // Inject resources
- injectResources(handler);
+ // Call @PostConstruct
+ callPostConstruct(handler);
- // Call @PostConstruct
- callPostConstruct(handler);
-
- addHandler(jaxwsMetaData, handler, type);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot load handler: " + className, ex);
- }
+ addHandler(jaxwsMetaData, handler, type);
}
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot load handler: " + className, ex);
+ }
}
private void injectResources(Handler handler)
@@ -223,18 +244,18 @@
QName servicePattern;
QName portPattern;
String protocols;
-
+
Set<String> bindings;
ScopedHandler(Handler handler)
{
this.handler = handler;
}
-
+
boolean matches(PortInfo info)
{
boolean match = true;
- if (match && servicePattern != null)
+ if (servicePattern != null)
{
QName serviceName = info.getServiceName();
match = matchQNamePattern(servicePattern, serviceName);
@@ -271,10 +292,10 @@
{
if (localPart.endsWith("*"))
localPart = localPart.substring(0, localPart.length() - 1);
-
+
String qnameStr = qname.toString();
String patternStr = new QName(nsURI, localPart).toString();
- match = qnameStr.startsWith(patternStr);
+ match = qnameStr.startsWith(patternStr);
}
return match;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -58,7 +58,7 @@
@Override
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName, Class serviceClass)
{
- ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName);
+ ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName, serviceClass);
return delegate;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -56,14 +56,20 @@
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
+import org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
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;
/**
* Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
@@ -86,22 +92,20 @@
// The ServiceRefMetaData supplied by the ServiceObjectFactory
private UnifiedServiceRefMetaData usRef;
// The handler resolver
- private HandlerResolver handlerResolver = new HandlerResolverImpl();
+ private HandlerResolver handlerResolver;
// The executor service
private ExecutorService executor;
// A list of annotated ports
private List<QName> annotatedPorts = new ArrayList<QName>();
- public ServiceDelegateImpl(URL wsdlURL, QName serviceName)
+ public ServiceDelegateImpl(URL wsdlURL, QName serviceName, Class serviceClass)
{
+ // If this Service was constructed through the ServiceObjectFactory
+ // this thread local association should be available
usRef = ServiceObjectFactory.getServiceRefAssociation();
- UnifiedVirtualFile vfsRoot;
- if(usRef!=null)
- vfsRoot = usRef.getVfsRoot();
- else
- vfsRoot = new ResourceLoaderAdapter();
+ UnifiedVirtualFile vfsRoot = (usRef != null ? usRef.getVfsRoot() : new ResourceLoaderAdapter());
if (wsdlURL != null)
{
@@ -114,15 +118,28 @@
serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
wsMetaData.addService(serviceMetaData);
}
+
+ handlerResolver = new HandlerResolverImpl();
- // If this Service was constructed through the ServiceObjectFactory
- // this thread local association should be available
-
if (usRef != null)
{
serviceMetaData.setServiceRefName(usRef.getServiceRefName());
+
+ // Setup the service handlers
if (usRef.getHandlerChain() != null)
- serviceMetaData.setHandlerChain(usRef.getHandlerChain());
+ {
+ String filename = usRef.getHandlerChain();
+ UnifiedHandlerChainsMetaData handlerChainsMetaData = JAXWSMetaDataBuilder.getHandlerChainsMetaData(serviceClass, filename);
+ for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData : handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : UnifiedHandlerChainMetaData.getHandlers())
+ {
+ HandlerMetaDataJAXWS handler = uhmd.getHandlerMetaDataJAXWS(HandlerType.ENDPOINT);
+ serviceMetaData.addHandler(handler);
+ }
+ }
+ ((HandlerResolverImpl)handlerResolver).initServiceHandlerChain(serviceMetaData);
+ }
}
}
@@ -324,15 +341,15 @@
private <T> T createProxy(Class<T> seiClass, EndpointMetaData epMetaData) throws WebServiceException
{
try
- {
+ {
ExecutorService executor = (ExecutorService)getExecutor();
ClientProxy handler = new ClientProxy(executor, new ClientImpl(epMetaData, handlerResolver));
ClassLoader cl = epMetaData.getClassLoader();
T proxy = (T)Proxy.newProxyInstance(cl, new Class[] { seiClass, BindingProvider.class, StubExt.class }, handler);
-
+
// Configure the stub
configureStub((StubExt)proxy);
-
+
return proxy;
}
catch (WebServiceException ex)
@@ -344,16 +361,17 @@
throw new WebServiceException("Cannot create proxy", ex);
}
}
-
+
private void configureStub(StubExt stub)
{
EndpointMetaData epMetaData = stub.getEndpointMetaData();
String seiName = epMetaData.getServiceEndpointInterfaceName();
QName portName = epMetaData.getPortName();
- if(usRef == null || usRef.getPortComponentRefs().size() == 0)
+ if (usRef == null || usRef.getPortComponentRefs().size() == 0)
{
- if(log.isDebugEnabled()) log.debug("No port configuration for: " + portName);
+ if (log.isDebugEnabled())
+ log.debug("No port configuration for: " + portName);
return;
}
@@ -370,8 +388,7 @@
{
if (piSEI != null && piPort != null)
match = seiName.equals(piSEI) && portName.equals(piPort);
- else
- match = seiName.equals(piSEI) || portName.equals(piPort);
+ else match = seiName.equals(piSEI) || portName.equals(piPort);
}
if (match == true)
{
@@ -392,9 +409,11 @@
}
if (match == false)
- if(log.isDebugEnabled()) log.debug("No matching port configuration for: [portName=" + portName + ",seiName=" + seiName + "]");
+ if (log.isDebugEnabled())
+ log.debug("No matching port configuration for: [portName=" + portName + ",seiName=" + seiName + "]");
- if(log.isDebugEnabled()) log.debug("Configure Stub: [configName=" + configName + ",configFile=" + configFile + "]");
+ if (log.isDebugEnabled())
+ log.debug("Configure Stub: [configName=" + configName + ",configFile=" + configFile + "]");
if (configName != null || configFile != null)
stub.setConfigName(configName, configFile);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -228,7 +228,7 @@
Set<String> portNames = uhmd.getPortNames();
if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
{
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(epMetaData, HandlerType.ENDPOINT));
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(HandlerType.ENDPOINT));
}
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -227,7 +227,7 @@
Set<String> portNames = uhmd.getPortNames();
if (portNames.size() == 0 || portNames.contains(portName.getLocalPart()))
{
- sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(sepMetaData, HandlerType.ENDPOINT));
+ sepMetaData.addHandler(uhmd.getHandlerMetaDataJAXRPC(HandlerType.ENDPOINT));
}
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -113,7 +113,8 @@
{
if (wsClass.isAnnotationPresent(BindingType.class))
{
- if(log.isDebugEnabled()) log.debug("processBindingType on: " + wsClass.getName());
+ if (log.isDebugEnabled())
+ log.debug("processBindingType on: " + wsClass.getName());
BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
epMetaData.setBindingId(anBindingType.value());
}
@@ -123,7 +124,8 @@
{
if (wsClass.isAnnotationPresent(SOAPBinding.class))
{
- if(log.isDebugEnabled()) log.debug("processSOAPBinding on: " + wsClass.getName());
+ if (log.isDebugEnabled())
+ log.debug("processSOAPBinding on: " + wsClass.getName());
SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
SOAPBinding.Style attrStyle = anSoapBinding.style();
@@ -157,17 +159,25 @@
if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
throw new WSException("Cannot combine @HandlerChain with @SOAPMessageHandlers");
- // The explicit handler chain on the service has priority
- String filename = epMetaData.getServiceMetaData().getHandlerChain();
+ if (wsClass.isAnnotationPresent(HandlerChain.class))
+ {
+ HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
+ String filename = anHandlerChain.file();
- HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
- if (filename == null && anHandlerChain != null)
- filename = anHandlerChain.file();
+ // Setup the endpoint handlers
+ UnifiedHandlerChainsMetaData handlerChainsMetaData = getHandlerChainsMetaData(wsClass, filename);
+ for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData : handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : UnifiedHandlerChainMetaData.getHandlers())
+ {
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(HandlerType.ENDPOINT));
+ }
+ }
+ }
+ }
- // Nothing to do
- if (filename == null)
- return;
-
+ public static UnifiedHandlerChainsMetaData getHandlerChainsMetaData(Class<?> wsClass, String filename)
+ {
URL fileURL = null;
log.debug("processHandlerChain [" + filename + "] on: " + wsClass.getName());
@@ -199,7 +209,7 @@
// Try the filename as Resource
if (fileURL == null)
{
- fileURL = epMetaData.getClassLoader().getResource(filename);
+ fileURL = wsClass.getClassLoader().getResource(filename);
}
// Try the filename relative to class
@@ -214,15 +224,15 @@
filepath = filepath.substring(3);
resourcePath = packagePath + "/" + filepath;
}
- fileURL = epMetaData.getClassLoader().getResource(resourcePath);
+ fileURL = wsClass.getClassLoader().getResource(resourcePath);
}
if (fileURL == null)
throw new WSException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
+ UnifiedHandlerChainsMetaData handlerChainsMetaData = null;
try
{
- UnifiedHandlerChainsMetaData UnifiedHandlerChainsMetaData = null;
InputStream is = fileURL.openStream();
try
{
@@ -231,21 +241,13 @@
unmarshaller.setSchemaValidation(true);
unmarshaller.setEntityResolver(new JBossWSEntityResolver());
ObjectModelFactory factory = new HandlerChainsObjectFactory();
- UnifiedHandlerChainsMetaData = (UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
+ handlerChainsMetaData = (UnifiedHandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
}
finally
{
is.close();
}
- // Setup the endpoint handlers
- for (UnifiedHandlerChainMetaData UnifiedHandlerChainMetaData : UnifiedHandlerChainsMetaData.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : UnifiedHandlerChainMetaData.getHandlers())
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData, HandlerType.ENDPOINT));
- }
- }
}
catch (RuntimeException rte)
{
@@ -255,13 +257,15 @@
{
throw new WSException("Cannot process handler chain: " + filename, ex);
}
+
+ return handlerChainsMetaData;
}
private void addFault(OperationMetaData omd, Class<?> exception)
{
if (omd.isOneWay())
throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
- + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
+ + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
WebFault annotation = exception.getAnnotation(WebFault.class);
@@ -467,7 +471,7 @@
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
- // RPC body parts must have no namespace
+ // RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
@@ -502,7 +506,7 @@
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
- // RPC body parts must have no namespace
+ // RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
@@ -522,12 +526,13 @@
AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
Action anAction = method.getAnnotation(Action.class);
- if(anAction!=null)
+ if (anAction != null)
{
addrExt.setInboundAction(anAction.input());
addrExt.setOutboundAction(anAction.output());
}
- else // default action values
+ else
+ // default action values
{
// TODO: figure out a way to assign message name instead of IN and OUT
String tns = epMetaData.getPortName().getNamespaceURI();
@@ -774,29 +779,29 @@
{
// process SWA metadata
WSDLDefinitions wsdlDef = epMetaData.getServiceMetaData().getWsdlDefinitions();
- if(wsdlDef!=null)
+ if (wsdlDef != null)
{
- for(WSDLBinding binding : wsdlDef.getBindings())
+ for (WSDLBinding binding : wsdlDef.getBindings())
{
- for(WSDLBindingOperation bindingOp : binding.getOperations())
+ for (WSDLBindingOperation bindingOp : binding.getOperations())
{
// it might an input or output parameter
- WSDLBindingMessageReference[] inOrOutPut =
- (paramMetaData.getMode().equals(ParameterMode.IN) || paramMetaData.getMode().equals(ParameterMode.INOUT)) ?
- ( WSDLBindingMessageReference[])bindingOp.getInputs() : ( WSDLBindingMessageReference[])bindingOp.getOutputs();
+ WSDLBindingMessageReference[] inOrOutPut = (paramMetaData.getMode().equals(ParameterMode.IN) || paramMetaData.getMode().equals(ParameterMode.INOUT)) ? (WSDLBindingMessageReference[])bindingOp
+ .getInputs()
+ : (WSDLBindingMessageReference[])bindingOp.getOutputs();
- if(inOrOutPut.length > 0)
+ if (inOrOutPut.length > 0)
{
// find matching operation
- if(bindingOp.getRef().equals( opMetaData.getQName()))
+ if (bindingOp.getRef().equals(opMetaData.getQName()))
{
WSDLBindingMessageReference bindingInput = inOrOutPut[0];
for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
{
String partName = mimePart.getPartName();
- if(paramMetaData.getPartName().equals(partName))
+ if (paramMetaData.getPartName().equals(partName))
{
- log.debug("Identified 'mime:content' binding: " + partName + ", mimeTypes=" +mimePart.getMimeTypes());
+ log.debug("Identified 'mime:content' binding: " + partName + ", mimeTypes=" + mimePart.getMimeTypes());
paramMetaData.setSwA(true);
paramMetaData.setMimeTypes(mimePart.getMimeTypes());
break;
@@ -851,8 +856,7 @@
// Use the dynamic generator by default. Otherwise reset the last
if (wrapperGenerator == null)
wrapperGenerator = new DynamicWrapperGenerator(loader);
- else
- wrapperGenerator.reset(loader);
+ else wrapperGenerator.reset(loader);
}
protected void resetMetaDataBuilder(ClassLoader loader)
@@ -868,7 +872,8 @@
try
{
String targetNS = epMetaData.getPortTypeName().getNamespaceURI().intern();
- if(log.isDebugEnabled()) log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
+ if (log.isDebugEnabled())
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
}
catch (JAXBException ex)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -230,7 +230,7 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- HandlerMetaDataJAXWS handlerMetaDataJAXWS = uhmd.getHandlerMetaDataJAXWS(sepMetaData, HandlerMetaData.HandlerType.ENDPOINT);
+ HandlerMetaDataJAXWS handlerMetaDataJAXWS = uhmd.getHandlerMetaDataJAXWS(HandlerMetaData.HandlerType.ENDPOINT);
sepMetaData.addHandler(handlerMetaDataJAXWS);
log.debug("Contribute handler from webservices.xml: " + handlerMetaDataJAXWS.getHandlerName());
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxrpc/CommonConfigJAXRPC.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -82,7 +82,7 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- handlers.add(uhmd.getHandlerMetaDataJAXRPC(epMetaData, type));
+ handlers.add(uhmd.getHandlerMetaDataJAXRPC(type));
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/config/jaxws/CommonConfigJAXWS.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -29,6 +29,7 @@
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
+import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXWS;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
// $Id$
@@ -81,7 +82,9 @@
{
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- handlers.add(uhmd.getHandlerMetaDataJAXWS(epMetaData, type));
+ HandlerMetaDataJAXWS handler = uhmd.getHandlerMetaDataJAXWS(type);
+ handler.setEndpointMetaData(epMetaData);
+ handlers.add(handler);
}
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -128,9 +128,9 @@
portNames.add(value);
}
- public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXRPC getHandlerMetaDataJAXRPC (HandlerType type)
{
- HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(epMetaData, type);
+ HandlerMetaDataJAXRPC hmd = new HandlerMetaDataJAXRPC(type);
hmd.setHandlerName(getHandlerName());
hmd.setHandlerClassName(getHandlerClass());
hmd.seiInitParams(getInitParams());
@@ -140,9 +140,9 @@
return hmd;
}
- public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXWS getHandlerMetaDataJAXWS (HandlerType type)
{
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(epMetaData, type);
+ HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(type);
hmd.setHandlerName(getHandlerName());
hmd.setHandlerClassName(getHandlerClass());
hmd.seiInitParams(getInitParams());
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -446,6 +446,7 @@
public void addHandler(HandlerMetaData handler)
{
+ handler.setEndpointMetaData(this);
handlers.add(handler);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaData.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -66,9 +66,8 @@
// The cached handler class
private Class handlerClass;
- public HandlerMetaData(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaData(HandlerType type)
{
- this.epMetaData = epMetaData;
this.handlerType = type;
}
@@ -112,7 +111,7 @@
{
try
{
- ClassLoader loader = epMetaData.getClassLoader();
+ ClassLoader loader = getClassLoader();
localClass = loader.loadClass(handlerClassName);
}
catch (ClassNotFoundException ex)
@@ -123,6 +122,13 @@
return localClass;
}
+ private ClassLoader getClassLoader()
+ {
+ // The EndpointMetaData classloader is not availabel for a handler associaated with a JAXWS Service.handlerResolver
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return (epMetaData != null ? epMetaData.getClassLoader() : ctxLoader);
+ }
+
public HandlerType getHandlerType()
{
return handlerType;
@@ -156,7 +162,7 @@
securityHandlers.add(org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerServer.class.getName());
securityHandlers.add(org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient.class.getName());
- if (securityHandlers.contains(handlerClassName))
+ if (securityHandlers.contains(handlerClassName) && epMetaData != null)
{
if (epMetaData.getServiceMetaData().getSecurityConfiguration() == null)
log.warn("WS-Security requires security configuration");
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXRPC.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -42,9 +42,9 @@
// The optional <port-name> elements
private Set<String> portNames = new HashSet<String>();
- public HandlerMetaDataJAXRPC(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXRPC(HandlerType type)
{
- super(epMetaData, type);
+ super(type);
}
public void setSoapRoles(Set<String> soapRoles)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -43,9 +43,9 @@
// The JAXWS protocol bindings
private String protocolBindings;
- public HandlerMetaDataJAXWS(EndpointMetaData epMetaData, HandlerType type)
+ public HandlerMetaDataJAXWS(HandlerType type)
{
- super(epMetaData, type);
+ super(type);
}
public QName getPortNamePattern()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -27,6 +27,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -76,8 +77,10 @@
private URL wsdlLocation;
private String wsdlFile;
private URL mappingLocation;
- private String handlerChain;
private String wsdlPublishLocation;
+
+ // The optional service handlers
+ private List<HandlerMetaDataJAXWS> handlers = new ArrayList<HandlerMetaDataJAXWS>();
// The type mapping that is maintained by this service
private TypesMetaData types;
@@ -158,16 +161,6 @@
this.wsdlLocation = wsdlLocation;
}
- public String getHandlerChain()
- {
- return handlerChain;
- }
-
- public void setHandlerChain(String handlerChain)
- {
- this.handlerChain = handlerChain;
- }
-
public String getWsdlPublishLocation()
{
return wsdlPublishLocation;
@@ -193,6 +186,16 @@
return types;
}
+ public void addHandler(HandlerMetaDataJAXWS handler)
+ {
+ handlers.add(handler);
+ }
+
+ public List<HandlerMetaDataJAXWS> getHandlerMetaData()
+ {
+ return Collections.unmodifiableList(handlers);
+ }
+
public List<EndpointMetaData> getEndpoints()
{
return new ArrayList<EndpointMetaData>(endpoints.values());
@@ -440,7 +443,6 @@
buffer.append("\n wsdlFile=" + wsdlFile);
buffer.append("\n wsdlLocation=" + wsdlLocation);
buffer.append("\n jaxrpcMapping=" + mappingLocation);
- buffer.append("\n handlerChain=" + handlerChain);
buffer.append("\n publishLocation=" + wsdlPublishLocation);
buffer.append("\n securityConfig=" + (securityConfig != null ? "found" : null));
buffer.append("\n properties=" + properties);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java 2007-03-30 16:46:50 UTC (rev 2731)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClient.java 2007-03-30 17:33:56 UTC (rev 2732)
@@ -24,11 +24,16 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.jws.HandlerChain;
+import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.handler.PortInfo;
import org.jboss.logging.Logger;
@@ -36,9 +41,9 @@
{
// provide logging
private static final Logger log = Logger.getLogger(HandlerChainClient.class);
-
+
@WebServiceRef(name = "Service1")
- @HandlerChain(file = "jaxws-handlers-client.xml")
+ @HandlerChain(file = "jaxws-handlers-client.xml")
static Service service1;
// Service2 should have no client side handler chain
@@ -54,7 +59,7 @@
{
String testName = args[0];
String reqStr = args[1];
-
+
HandlerChainClient client = new HandlerChainClient();
Method method = HandlerChainClient.class.getMethod(testName, new Class[] { String.class });
try
@@ -76,6 +81,29 @@
public String testService1(String reqStr) throws Exception
{
+ PortInfo info = new PortInfo()
+ {
+ public String getBindingID()
+ {
+ return "http://schemas.xmlsoap.org/wsdl/soap/http";
+ }
+
+ public QName getPortName()
+ {
+ return null;
+ }
+
+ public QName getServiceName()
+ {
+ return null;
+ }
+ };
+
+ HandlerResolver resolver = service1.getHandlerResolver();
+ List<Handler> handlerChain = resolver.getHandlerChain(info);
+ if("[LogHandler, AuthorizationHandler, RoutingHandler, MimeHandler]".equals(handlerChain.toString()) == false)
+ throw new IllegalStateException("Unexpected resolver handlers: " + handlerChain);
+
Endpoint port = service1.getPort(Endpoint.class);
return port.echo(reqStr);
}
17 years, 9 months