You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jbo...@li...> - 2006-07-05 12:48:26
|
Author: kev...@jb... Date: 2006-07-05 08:48:22 -0400 (Wed, 05 Jul 2006) New Revision: 4913 Added: labs/jbosstm/branches/JBOSSTS_4_2_GA_MP1/ Log: Branch of 4.2GA Copied: labs/jbosstm/branches/JBOSSTS_4_2_GA_MP1 (from rev 4912, labs/jbosstm/tags/JBOSSTS_4_2_GA) |
From: <jbo...@li...> - 2006-07-05 12:18:14
|
Author: hei...@jb... Date: 2006-07-05 08:17:59 -0400 (Wed, 05 Jul 2006) New Revision: 565 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/FilterType.java branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/jaxrpc-mapping.xml branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/wsdl/eventing.xsd branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/jaxrpc-mapping.xml branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/wsdl/jbwse.xsd Log: Fix JBWS-991 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/DeliveryType.java 2006-07-05 12:17:59 UTC (rev 565) @@ -56,6 +56,7 @@ { private URI mode; private SOAPElement[] _any; + public String _value; private EndpointReference notifyTo; public URI getMode() @@ -87,4 +88,14 @@ { this.notifyTo = notifyTo; } + + public String get_value() + { + return _value; + } + + public void set_value(String _value) + { + this._value = _value; + } } Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/FilterType.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/FilterType.java 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/FilterType.java 2006-07-05 12:17:59 UTC (rev 565) @@ -45,7 +45,7 @@ { private URI dialect; private SOAPElement[] _any; - private String _value; + public String _value; public URI getDialect() { Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/StatusRequest.java 2006-07-05 12:17:59 UTC (rev 565) @@ -21,6 +21,8 @@ */ package org.jboss.ws.eventing.element; +import javax.xml.soap.SOAPElement; + // $Id$ /** @@ -29,5 +31,13 @@ */ public class StatusRequest { + private SOAPElement _any; + public SOAPElement get_any() { + return _any; + } + + public void set_any(SOAPElement _any) { + this._any = _any; + } } Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/eventing/element/UnsubscribeRequest.java 2006-07-05 12:17:59 UTC (rev 565) @@ -23,6 +23,7 @@ // $Id$ +import javax.xml.soap.SOAPElement; import java.net.URI; /** @@ -33,6 +34,8 @@ { private URI identifier; + private SOAPElement _any; + public UnsubscribeRequest() { } @@ -48,4 +51,12 @@ { this.identifier = identifier; } + + public SOAPElement get_any() { + return _any; + } + + public void set_any(SOAPElement _any) { + this._any = _any; + } } Modified: branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/jaxrpc-mapping.xml =================================================================== --- branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/jaxrpc-mapping.xml 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/jaxrpc-mapping.xml 2006-07-05 12:17:59 UTC (rev 565) @@ -2,367 +2,375 @@ <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"> - <package-mapping> - <package-type>org.jboss.ws.eventing</package-type> - <namespaceURI>http://schemas.xmlsoap.org/ws/2004/08/eventing</namespaceURI> - </package-mapping> + <package-mapping> + <package-type>org.jboss.ws.eventing</package-type> + <namespaceURI>http://schemas.xmlsoap.org/ws/2004/08/eventing</namespaceURI> + </package-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:Subscribe</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:Subscribe</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>Subscribe</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>delivery</java-variable-name> - <xml-element-name>Delivery</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>endTo</java-variable-name> - <xml-element-name>EndTo</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>expires</java-variable-name> - <xml-element-name>Expires</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>filter</java-variable-name> - <xml-element-name>Filter</xml-element-name> - </variable-mapping> - <!--variable-mapping> - <java-variable-name>_any</java-variable-name> - <xml-wildcard/> - </variable-mapping--> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscribeRequest</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>Subscribe</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>delivery</java-variable-name> + <xml-element-name>Delivery</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>endTo</java-variable-name> + <xml-element-name>EndTo</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>expires</java-variable-name> + <xml-element-name>Expires</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>filter</java-variable-name> + <xml-element-name>Filter</xml-element-name> + </variable-mapping> + <!--variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping--> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.FilterType</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:FilterType</root-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>dialect</java-variable-name> - <xml-attribute-name>Dialect</xml-attribute-name> - </variable-mapping> - <!--variable-mapping> - <java-variable-name>_any</java-variable-name> - <xml-wildcard/> - </variable-mapping--> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.FilterType</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:FilterType</root-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>dialect</java-variable-name> + <xml-attribute-name>Dialect</xml-attribute-name> + </variable-mapping> + <!--variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping--> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.DeliveryType</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:DeliveryType</root-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>mode</java-variable-name> - <xml-attribute-name>Mode</xml-attribute-name> - </variable-mapping> - <!--variable-mapping> - <java-variable-name>notifyTo</java-variable-name> - <xml-attribute-name>NotifyTo</xml-attribute-name> - </variable-mapping--> - <!--variable-mapping> - <java-variable-name>_any</java-variable-name> - <xml-wildcard/> - </variable-mapping--> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.DeliveryType</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:DeliveryType</root-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>mode</java-variable-name> + <xml-attribute-name>Mode</xml-attribute-name> + </variable-mapping> + <!--variable-mapping> + <java-variable-name>notifyTo</java-variable-name> + <xml-attribute-name>NotifyTo</xml-attribute-name> + </variable-mapping--> + <!--variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping--> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:SubscriptionEnd</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:SubscriptionEnd</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>SubscriptionEnd</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>subscriptionManager</java-variable-name> - <xml-element-name>SubscriptionManager</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>code</java-variable-name> - <xml-element-name>Code</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>reason</java-variable-name> - <xml-element-name>Reason</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscriptionEndRequest</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>SubscriptionEnd</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>subscriptionManager</java-variable-name> + <xml-element-name>SubscriptionManager</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>code</java-variable-name> + <xml-element-name>Code</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>reason</java-variable-name> + <xml-element-name>Reason</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:SubscribeResponse</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:SubscribeResponse</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>SubscribeResponse</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>expires</java-variable-name> - <xml-element-name>Expires</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>subscriptionManager</java-variable-name> - <xml-element-name>SubscriptionManager</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.SubscribeResponse</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>SubscribeResponse</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>expires</java-variable-name> + <xml-element-name>Expires</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>subscriptionManager</java-variable-name> + <xml-element-name>SubscriptionManager</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type> - <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:EndpointReference</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type> + <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:EndpointReference</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type> - <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing"> - typeNS:EndpointReferenceType</root-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>address</java-variable-name> - <xml-element-name>Address</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>referenceParams</java-variable-name> - <xml-element-name>ReferenceParameters</xml-element-name> - </variable-mapping> - <variable-mapping> - <java-variable-name>metadata</java-variable-name> - <xml-element-name>Metadata</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.EndpointReference</java-type> + <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing"> + typeNS:EndpointReferenceType</root-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>address</java-variable-name> + <xml-element-name>Address</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>referenceParams</java-variable-name> + <xml-element-name>ReferenceParameters</xml-element-name> + </variable-mapping> + <variable-mapping> + <java-variable-name>metadata</java-variable-name> + <xml-element-name>Metadata</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.MetaData</java-type> - <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:Metadata</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.MetaData</java-type> + <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:Metadata</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <!--java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.MetaData</java-type> - <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:MetadataType</root-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>_any</java-variable-name> - <xml-wildcard/> - </variable-mapping> - </java-xml-type-mapping--> + <!--java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.MetaData</java-type> + <root-type-qname xmlns:typeNS="http://www.w3.org/2005/08/addressing">typeNS:MetadataType</root-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping> + </java-xml-type-mapping--> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">typeNS:Renew</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing">typeNS:Renew</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>Renew</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>expires</java-variable-name> - <xml-element-name>Expires</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.RenewRequest</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>Renew</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>expires</java-variable-name> + <xml-element-name>Expires</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:RenewResponse</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:RenewResponse</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>RenewResponse</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>expires</java-variable-name> - <xml-element-name>Expires</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.RenewResponse</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>RenewResponse</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>expires</java-variable-name> + <xml-element-name>Expires</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:GetStatus</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:GetStatus</root-type-qname> + <qname-scope>element</qname-scope> + <variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>GetStatus</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.StatusRequest</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>GetStatus</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:GetStatusResponse</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:GetStatusResponse</root-type-qname> + <qname-scope>element</qname-scope> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>GetStatusResponse</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>expires</java-variable-name> - <xml-element-name>Expires</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.StatusResponse</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>GetStatusResponse</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + <variable-mapping> + <java-variable-name>expires</java-variable-name> + <xml-element-name>Expires</xml-element-name> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type> - <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:Unsubscribe</root-type-qname> - <qname-scope>element</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type> + <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:Unsubscribe</root-type-qname> + <qname-scope>element</qname-scope> + <variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping> + </java-xml-type-mapping> - <java-xml-type-mapping> - <java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type> - <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - typeNS:>Unsubscribe</anonymous-type-qname> - <qname-scope>complexType</qname-scope> - </java-xml-type-mapping> + <java-xml-type-mapping> + <java-type>org.jboss.ws.eventing.element.UnsubscribeRequest</java-type> + <anonymous-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + typeNS:>Unsubscribe</anonymous-type-qname> + <qname-scope>complexType</qname-scope> + </java-xml-type-mapping> - <service-interface-mapping> - <service-interface>org.jboss.ws.eventing.EventingService</service-interface> - <wsdl-service-name xmlns:serviceNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - serviceNS:EventingService</wsdl-service-name> - <port-mapping> - <port-name>EventSourcePortTypePort</port-name> - <java-port-name>EventSourcePortTypePort</java-port-name> - </port-mapping> - <port-mapping> - <port-name>SubscriptionManagerPortTypePort</port-name> - <java-port-name>SubscriptionManagerPortTypePort</java-port-name> - </port-mapping> - </service-interface-mapping> + <service-interface-mapping> + <service-interface>org.jboss.ws.eventing.EventingService</service-interface> + <wsdl-service-name xmlns:serviceNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + serviceNS:EventingService</wsdl-service-name> + <port-mapping> + <port-name>EventSourcePortTypePort</port-name> + <java-port-name>EventSourcePortTypePort</java-port-name> + </port-mapping> + <port-mapping> + <port-name>SubscriptionManagerPortTypePort</port-name> + <java-port-name>SubscriptionManagerPortTypePort</java-port-name> + </port-mapping> + </service-interface-mapping> - <service-endpoint-interface-mapping> - <service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface> - <wsdl-port-type xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - portTypeNS:EventSource</wsdl-port-type> - <wsdl-binding xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - bindingNS:EventSourcePortTypeBinding</wsdl-binding> - <service-endpoint-method-mapping> - <java-method-name>subscribe</java-method-name> - <wsdl-operation>SubscribeOp</wsdl-operation> - <method-param-parts-mapping> - <param-position>0</param-position> - <param-type>org.jboss.ws.eventing.element.SubscribeRequest</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:SubscribeMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - <wsdl-return-value-mapping> - <method-return-value>org.jboss.ws.eventing.element.SubscribeResponse</method-return-value> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:SubscribeResponseMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - </wsdl-return-value-mapping> - </service-endpoint-method-mapping> + <service-endpoint-interface-mapping> + <service-endpoint-interface>org.jboss.ws.eventing.EventSourceEndpoint</service-endpoint-interface> + <wsdl-port-type xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + portTypeNS:EventSource</wsdl-port-type> + <wsdl-binding xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + bindingNS:EventSourcePortTypeBinding</wsdl-binding> + <service-endpoint-method-mapping> + <java-method-name>subscribe</java-method-name> + <wsdl-operation>SubscribeOp</wsdl-operation> + <method-param-parts-mapping> + <param-position>0</param-position> + <param-type>org.jboss.ws.eventing.element.SubscribeRequest</param-type> + <wsdl-message-mapping> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:SubscribeMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + <parameter-mode>IN</parameter-mode> + </wsdl-message-mapping> + </method-param-parts-mapping> + <wsdl-return-value-mapping> + <method-return-value>org.jboss.ws.eventing.element.SubscribeResponse</method-return-value> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:SubscribeResponseMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + </wsdl-return-value-mapping> + </service-endpoint-method-mapping> - <service-endpoint-method-mapping> - <java-method-name>subscriptionEnd</java-method-name> - <wsdl-operation>SubscriptionEnd</wsdl-operation> - <wsdl-return-value-mapping> - <method-return-value>org.jboss.ws.eventing.element.SubscriptionEndRequest</method-return-value> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:SubscriptionEnd</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - </wsdl-return-value-mapping> - </service-endpoint-method-mapping> + <service-endpoint-method-mapping> + <java-method-name>subscriptionEnd</java-method-name> + <wsdl-operation>SubscriptionEnd</wsdl-operation> + <wsdl-return-value-mapping> + <method-return-value>org.jboss.ws.eventing.element.SubscriptionEndRequest</method-return-value> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:SubscriptionEnd</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + </wsdl-return-value-mapping> + </service-endpoint-method-mapping> - </service-endpoint-interface-mapping> + </service-endpoint-interface-mapping> - <service-endpoint-interface-mapping> - <service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface> + <service-endpoint-interface-mapping> + <service-endpoint-interface>org.jboss.ws.eventing.SubscriptionManagerEndpoint</service-endpoint-interface> - <wsdl-port-type xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - portTypeNS:SubscriptionManager</wsdl-port-type> - <wsdl-binding xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - bindingNS:SubscriptionManagerPortTypeBinding</wsdl-binding> + <wsdl-port-type xmlns:portTypeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + portTypeNS:SubscriptionManager</wsdl-port-type> + <wsdl-binding xmlns:bindingNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + bindingNS:SubscriptionManagerPortTypeBinding</wsdl-binding> - <service-endpoint-method-mapping> - <java-method-name>getStatus</java-method-name> - <wsdl-operation>GetStatusOp</wsdl-operation> - <method-param-parts-mapping> - <param-position>0</param-position> - <param-type>org.jboss.ws.eventing.element.StatusRequest</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:GetStatusMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - <wsdl-return-value-mapping> - <method-return-value>org.jboss.ws.eventing.element.StatusResponse</method-return-value> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:GetStatusResponseMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - </wsdl-return-value-mapping> - </service-endpoint-method-mapping> + <service-endpoint-method-mapping> + <java-method-name>getStatus</java-method-name> + <wsdl-operation>GetStatusOp</wsdl-operation> + <method-param-parts-mapping> + <param-position>0</param-position> + <param-type>org.jboss.ws.eventing.element.StatusRequest</param-type> + <wsdl-message-mapping> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:GetStatusMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + <parameter-mode>IN</parameter-mode> + </wsdl-message-mapping> + </method-param-parts-mapping> + <wsdl-return-value-mapping> + <method-return-value>org.jboss.ws.eventing.element.StatusResponse</method-return-value> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:GetStatusResponseMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + </wsdl-return-value-mapping> + </service-endpoint-method-mapping> - <service-endpoint-method-mapping> - <java-method-name>renew</java-method-name> - <wsdl-operation>RenewOp</wsdl-operation> - <method-param-parts-mapping> - <param-position>0</param-position> - <param-type>org.jboss.ws.eventing.element.RenewRequest</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:RenewMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - <wsdl-return-value-mapping> - <method-return-value>org.jboss.ws.eventing.element.RenewResponse</method-return-value> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:RenewResponseMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - </wsdl-return-value-mapping> - </service-endpoint-method-mapping> + <service-endpoint-method-mapping> + <java-method-name>renew</java-method-name> + <wsdl-operation>RenewOp</wsdl-operation> + <method-param-parts-mapping> + <param-position>0</param-position> + <param-type>org.jboss.ws.eventing.element.RenewRequest</param-type> + <wsdl-message-mapping> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:RenewMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + <parameter-mode>IN</parameter-mode> + </wsdl-message-mapping> + </method-param-parts-mapping> + <wsdl-return-value-mapping> + <method-return-value>org.jboss.ws.eventing.element.RenewResponse</method-return-value> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:RenewResponseMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + </wsdl-return-value-mapping> + </service-endpoint-method-mapping> - <service-endpoint-method-mapping> - <java-method-name>unsubscribe</java-method-name> - <wsdl-operation>UnsubscribeOp</wsdl-operation> - <method-param-parts-mapping> - <param-position>0</param-position> - <param-type>org.jboss.ws.eventing.element.UnsubscribeRequest</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> - wsdlMsgNS:UnsubscribeMsg</wsdl-message> - <wsdl-message-part-name>body</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - </service-endpoint-method-mapping> + <service-endpoint-method-mapping> + <java-method-name>unsubscribe</java-method-name> + <wsdl-operation>UnsubscribeOp</wsdl-operation> + <method-param-parts-mapping> + <param-position>0</param-position> + <param-type>org.jboss.ws.eventing.element.UnsubscribeRequest</param-type> + <wsdl-message-mapping> + <wsdl-message xmlns:wsdlMsgNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> + wsdlMsgNS:UnsubscribeMsg</wsdl-message> + <wsdl-message-part-name>body</wsdl-message-part-name> + <parameter-mode>IN</parameter-mode> + </wsdl-message-mapping> + </method-param-parts-mapping> + </service-endpoint-method-mapping> - </service-endpoint-interface-mapping> + </service-endpoint-interface-mapping> </java-wsdl-mapping> Modified: branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/wsdl/eventing.xsd =================================================================== --- branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/wsdl/eventing.xsd 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/test/resources/eventing/WEB-INF/wsdl/eventing.xsd 2006-07-05 12:17:59 UTC (rev 565) @@ -128,8 +128,8 @@ <xs:element name="GetStatus"> <xs:complexType> <xs:sequence> - <!--xs:any namespace="##other" processContents="lax" - minOccurs="0" maxOccurs="unbounded" /--> + <xs:any namespace="##other" processContents="lax" + minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <!--xs:anyAttribute namespace="##other" processContents="lax" /--> </xs:complexType> @@ -151,8 +151,8 @@ <xs:element name="Unsubscribe"> <xs:complexType> <xs:sequence> - <!--xs:any namespace="##other" processContents="lax" - minOccurs="0" maxOccurs="unbounded" /--> + <xs:any namespace="##other" processContents="lax" + minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <!--xs:anyAttribute namespace="##other" processContents="lax" /--> </xs:complexType> Modified: branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/jaxrpc-mapping.xml =================================================================== --- branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/jaxrpc-mapping.xml 2006-07-05 12:17:59 UTC (rev 565) @@ -204,6 +204,10 @@ <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> typeNS:GetStatus</root-type-qname> <qname-scope>element</qname-scope> + <variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping> </java-xml-type-mapping> <java-xml-type-mapping> @@ -236,6 +240,10 @@ <root-type-qname xmlns:typeNS="http://schemas.xmlsoap.org/ws/2004/08/eventing"> typeNS:Unsubscribe</root-type-qname> <qname-scope>element</qname-scope> + <variable-mapping> + <java-variable-name>_any</java-variable-name> + <xml-wildcard/> + </variable-mapping> </java-xml-type-mapping> <java-xml-type-mapping> Modified: branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/wsdl/jbwse.xsd =================================================================== --- branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/wsdl/jbwse.xsd 2006-07-05 12:17:07 UTC (rev 564) +++ branches/jbossws-1.0/src/test/resources/samples/wseventing/WEB-INF/wsdl/jbwse.xsd 2006-07-05 12:17:59 UTC (rev 565) @@ -128,8 +128,8 @@ <xs:element name="GetStatus"> <xs:complexType> <xs:sequence> - <!--xs:any namespace="##other" processContents="lax" - minOccurs="0" maxOccurs="unbounded" /--> + <xs:any namespace="##other" processContents="lax" + minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <!--xs:anyAttribute namespace="##other" processContents="lax" /--> </xs:complexType> @@ -151,8 +151,8 @@ <xs:element name="Unsubscribe"> <xs:complexType> <xs:sequence> - <!--xs:any namespace="##other" processContents="lax" - minOccurs="0" maxOccurs="unbounded" /--> + <xs:any namespace="##other" processContents="lax" + minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <!--xs:anyAttribute namespace="##other" processContents="lax" /--> </xs:complexType> |
From: <jbo...@li...> - 2006-07-05 12:17:12
|
Author: hei...@jb... Date: 2006-07-05 08:17:07 -0400 (Wed, 05 Jul 2006) New Revision: 564 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java Log: cleanup Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java 2006-07-05 11:52:43 UTC (rev 563) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java 2006-07-05 12:17:07 UTC (rev 564) @@ -46,12 +46,12 @@ // provide logging private static final Logger log = Logger.getLogger(JAXBDeserializer.class); - private JAXBUnmarshaller jaxbUnmarshaller; + private JAXBUnmarshaller unmarshaller; public JAXBDeserializer() throws BindingException { // Get the JAXB marshaller for complex objects - jaxbUnmarshaller = new JBossXBUnmarshallerImpl(); + unmarshaller = new JBossXBUnmarshallerImpl(); } /** @@ -83,13 +83,13 @@ // Get the jaxrpc-mapping.xml meta data JavaWsdlMapping jaxrpcMapping = serContext.getJavaWsdlMapping(); - jaxbUnmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); - jaxbUnmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); - jaxbUnmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); - jaxbUnmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); + unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); + unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); + unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); + unmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); ByteArrayInputStream ins = new ByteArrayInputStream(val.getBytes("UTF-8")); - value = jaxbUnmarshaller.unmarshal(ins); + value = unmarshaller.unmarshal(ins); } catch (RuntimeException e) { Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java 2006-07-05 11:52:43 UTC (rev 563) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java 2006-07-05 12:17:07 UTC (rev 564) @@ -23,19 +23,18 @@ // $Id$ -import java.io.StringWriter; - -import javax.xml.namespace.QName; - import org.apache.xerces.xs.XSModel; import org.jboss.logging.Logger; import org.jboss.ws.binding.BindingException; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JBossXBMarshallerImpl; import org.jboss.ws.jaxb.JAXBMarshaller; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.w3c.dom.NamedNodeMap; +import javax.xml.namespace.QName; +import java.io.StringWriter; + /** * A Serializer that can handle complex types by delegating to JAXB. * @@ -47,12 +46,12 @@ // provide logging private static final Logger log = Logger.getLogger(JAXBSerializer.class); - private JAXBMarshaller JAXBMarshaller; + private JAXBMarshaller marshaller; public JAXBSerializer() throws BindingException { // Get the JAXB marshaller for complex objects - JAXBMarshaller = new JBossXBMarshallerImpl(); + marshaller = new JBossXBMarshallerImpl(); } /** @@ -79,22 +78,22 @@ String xmlFragment = null; - // Get the parsed model - XSModel model = serContext.getXsModel(); + // Get the parsed model + XSModel model = serContext.getXsModel(); - // Get the jaxrpc-mapping.xml object graph - JavaWsdlMapping jaxrpcMapping = serContext.getJavaWsdlMapping(); + // Get the jaxrpc-mapping.xml object graph + JavaWsdlMapping jaxrpcMapping = serContext.getJavaWsdlMapping(); - JAXBMarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); - JAXBMarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); - JAXBMarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); - JAXBMarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); + marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); + marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); + marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); + marshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); - StringWriter strwr = new StringWriter(); - JAXBMarshaller.marshal(value, strwr); - xmlFragment = strwr.toString(); + StringWriter strwr = new StringWriter(); + marshaller.marshal(value, strwr); + xmlFragment = strwr.toString(); - log.debug("serialized: " + xmlFragment); + log.debug("serialized: " + xmlFragment); return xmlFragment; } |
From: <jbo...@li...> - 2006-07-05 11:53:01
|
Author: tho...@jb... Date: 2006-07-05 07:52:43 -0400 (Wed, 05 Jul 2006) New Revision: 563 Removed: trunk/.settings/org.eclipse.core.resources.prefs trunk/src/test/resources/jbws871/META-INF/application-client.xml trunk/src/test/resources/jbws871/META-INF/jaxrpc-mapping.xml trunk/src/test/resources/jbws871/META-INF/jboss-client.xml trunk/src/test/resources/jbws871/wstools-config.xml Modified: trunk/src/main/java/org/jboss/ws/client/CommonClient.java trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java trunk/src/test/ant/build-jars.xml trunk/src/test/java/org/jboss/test/ws/jbws871/JBWS871TestCase.java Log: SOAPConnectionImpl.callOneWay Use jaxws for jbws-871 Deleted: trunk/.settings/org.eclipse.core.resources.prefs =================================================================== --- trunk/.settings/org.eclipse.core.resources.prefs 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/.settings/org.eclipse.core.resources.prefs 2006-07-05 11:52:43 UTC (rev 563) @@ -1,8 +0,0 @@ -#Tue Jul 04 11:35:41 CEST 2006 -eclipse.preferences.version=1 -encoding//src/test/resources/addressing/action/Doc-META-INF/wsdl/ActionDocService.wsdl=UTF-8 -encoding//src/test/resources/addressing/replyto/FaultTo-META-INF/wsdl/FaultToService.wsdl=UTF-8 -encoding//src/test/resources/addressing/replyto/Initial-META-INF/wsdl/InitialService.wsdl=UTF-8 -encoding//src/test/resources/addressing/replyto/ReplyTo-META-INF/wsdl/ReplyToService.wsdl=UTF-8 -encoding//src/test/resources/benchmark/rpclit/META-INF/wsdl/BenchmarkWebService.wsdl=UTF-8 -encoding//src/test/resources/jbws434/WEB-INF/wsdl/TestService.wsdl=UTF-8 Modified: trunk/src/main/java/org/jboss/ws/client/CommonClient.java =================================================================== --- trunk/src/main/java/org/jboss/ws/client/CommonClient.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/client/CommonClient.java 2006-07-05 11:52:43 UTC (rev 563) @@ -280,7 +280,16 @@ syncMessageProperties(callProps, msgContext); EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, callProps); - SOAPMessage resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo, oneway); + + SOAPMessage resMessage; + if (oneway) + { + resMessage = new SOAPConnectionImpl().callOneWay(reqMessage, epInfo); + } + else + { + resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo); + } // Associate current message with message context msgContext.setMessage(resMessage); Modified: trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-05 11:52:43 UTC (rev 563) @@ -205,9 +205,6 @@ QName xmlType = opInput.getXMLType(); String javaTypeName = typeMapping.getJavaTypeName(xmlType); - if (javaTypeName == null) - throw new WSException("Cannot obtain java type mapping for: " + xmlType); - ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); opMetaData.addParameter(inMetaData); @@ -233,9 +230,6 @@ boolean inHeader = opOutput.getProperty(Constants.WSDL_PROPERTY_APPLICATION_DATA) != null; boolean hasReturnMapping = (inHeader == false); - if (javaTypeName == null) - throw new WSException("Cannot obtain java type mapping for: " + xmlType); - if (hasReturnMapping) { outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); Modified: trunk/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java =================================================================== --- trunk/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/eventing/mgmt/Subscription.java 2006-07-05 11:52:43 UTC (rev 563) @@ -77,7 +77,6 @@ { String eventXML = DOMWriter.printNode(event, false); MessageFactory msgFactory = MessageFactory.newInstance(); - SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection(); // notification elements need to declare their namespace locally StringBuilder sb = new StringBuilder(); @@ -96,7 +95,7 @@ SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(sb.toString().getBytes())); URL epURL = notifyTo.getAddress().toURL(); - ((SOAPConnectionImpl)con).call(reqMsg, epURL, true); + new SOAPConnectionImpl().callOneWay(reqMsg, epURL); } catch (Exception e) { @@ -165,10 +164,9 @@ try { MessageFactory msgFactory = MessageFactory.newInstance(); - SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection(); SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(sb.toString().getBytes())); URL epURL = endTo.getAddress().toURL(); - ((SOAPConnectionImpl)con).call(reqMsg, epURL, true); + new SOAPConnectionImpl().callOneWay(reqMsg, epURL); } catch (Exception e) { Modified: trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-07-05 11:52:43 UTC (rev 563) @@ -167,7 +167,7 @@ public String toString() { StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:"); - buffer.append("\n name=" + getQName()); + buffer.append("\n qname=" + getQName()); buffer.append("\n address=" + getEndpointAddress()); buffer.append("\n seiName=" + getServiceEndpointInterfaceName()); buffer.append("\n configFile=" + getConfigFile()); Modified: trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-07-05 11:52:43 UTC (rev 563) @@ -240,26 +240,27 @@ return isMessageEndpoint; } - private boolean compareMethodParams(Class[] methodTypes, boolean matchByTypeName) + private boolean compareMethodParams(Class[] methodParams, boolean matchByTypeName) { log.trace("Compare method params by type name: " + matchByTypeName); - boolean pass = (parameters.size() == methodTypes.length); + boolean pass = (parameters.size() == methodParams.length); if (pass == false) - log.trace("Unmatched parameter count: " + parameters.size() + "!=" + methodTypes.length); + log.trace("Unmatched parameter count: " + parameters.size() + "!=" + methodParams.length); TypeMappingImpl typeMapping = epMetaData.getServiceMetaData().getTypeMapping(); - for (int i = 0; pass && i < methodTypes.length; i++) + for (int i = 0; pass && i < methodParams.length; i++) { ParameterMetaData paramMetaData = parameters.get(i); QName xmlType = paramMetaData.getXmlType(); - Class methodType = methodTypes[i]; + String javaType = paramMetaData.getJavaTypeName(); + Class methodParam = methodParams[i]; if (paramMetaData.getMode() != ParameterMode.IN) { - if (HolderUtils.isHolderType(methodType)) + if (HolderUtils.isHolderType(methodParam)) { - methodType = HolderUtils.getValueType(methodType); + methodParam = HolderUtils.getValueType(methodParam); } else { @@ -267,28 +268,35 @@ break; } } + + // In case the parameter java type has not been initialized + // This happens when the UMDM is build from WSDL only (i.e. JAXWS Service) + if (javaType == null) + { + javaType = methodParam.getName(); + paramMetaData.setJavaTypeName(javaType); + log.debug("Set parameter java type from method param: " + javaType); + } if (matchByTypeName) { - String javaTypeName = methodType.getName(); - String paramTypeName = paramMetaData.getJavaTypeName(); - pass = javaTypeName.equals(paramTypeName); + pass = methodParam.getName().equals(javaType); } else { - String javaTypeName = methodType.getName(); + String paramTypeName = methodParam.getName(); Class paramType = paramMetaData.getJavaType(); - pass = JavaUtils.isAssignableFrom(methodType, paramType); - if (pass == false && typeMapping.isRegistered(methodType, xmlType)) + pass = JavaUtils.isAssignableFrom(methodParam, paramType); + if (pass == false && typeMapping.isRegistered(methodParam, xmlType)) { - log.debug("Adjust parameter type from " + paramType.getName() + " to " + javaTypeName); - paramMetaData.setJavaTypeName(javaTypeName); + log.debug("Adjust parameter type from " + paramType.getName() + " to " + paramTypeName); + paramMetaData.setJavaTypeName(paramTypeName); pass = true; } } String name = (matchByTypeName) ? paramMetaData.getJavaTypeName() : paramMetaData.getJavaType().getName(); - log.trace((pass ? "Matched" : "Unmatched") + " parameter: " + name + " == " + methodType.getName()); + log.trace((pass ? "Matched" : "Unmatched") + " parameter: " + name + " == " + methodParam.getName()); } return pass; } @@ -493,7 +501,7 @@ public String toString() { StringBuilder buffer = new StringBuilder("\nOperationMetaData:"); - buffer.append("\n xmlName=" + qname); + buffer.append("\n qname=" + qname); buffer.append("\n javaName=" + javaName); buffer.append("\n style=" + getStyle() + "/" + getUse() + (getStyle() == Style.DOCUMENT ? "/" + getParameterStyle() : "")); buffer.append("\n oneWay=" + oneWayOperation); Modified: trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-07-05 11:52:43 UTC (rev 563) @@ -259,7 +259,7 @@ public String toString() { StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:"); - buffer.append("\n name=" + getQName()); + buffer.append("\n qname=" + getQName()); buffer.append("\n id=" + getServiceEndpointID().getCanonicalName()); buffer.append("\n address=" + getEndpointAddress()); buffer.append("\n linkName=" + getLinkName()); Modified: trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-07-05 11:52:43 UTC (rev 563) @@ -382,7 +382,7 @@ public String toString() { StringBuilder buffer = new StringBuilder("\nServiceMetaData:"); - buffer.append("\n name=" + qname); + buffer.append("\n qname=" + qname); buffer.append("\n wsdName=" + wsdName); buffer.append("\n wsdlFile=" + wsdlFile); buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile); Modified: trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java =================================================================== --- trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-07-05 11:52:43 UTC (rev 563) @@ -401,8 +401,7 @@ if (wsaTo != null) { log.debug("Sending response to addressing destination: " + wsaTo); - SOAPConnectionImpl con = new SOAPConnectionImpl(); - con.call(soapMessage, wsaTo, true); + new SOAPConnectionImpl().callOneWay(soapMessage, wsaTo); } else { Modified: trunk/src/test/ant/build-jars.xml =================================================================== --- trunk/src/test/ant/build-jars.xml 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/ant/build-jars.xml 2006-07-05 11:52:43 UTC (rev 563) @@ -585,19 +585,6 @@ <include name="org/jboss/test/ws/jbws871/RpcArrayEndpointImpl.class"/> </classes> </war> - <jar destfile="${build.test.dir}/libs/jbossws-jbws871-rpc-client.jar"> - <fileset dir="${build.test.dir}/classes"> - <include name="org/jboss/test/ws/jbws871/IntegerArray.class"/> - <include name="org/jboss/test/ws/jbws871/RpcArrayEndpoint.class"/> - <include name="org/jboss/test/ws/jbws871/RpcArrayEndpointService.class"/> - </fileset> - <metainf dir="${build.test.dir}/resources/jbws871/META-INF"> - <include name="application-client.xml"/> - <include name="jboss-client.xml"/> - <include name="jaxrpc-mapping.xml"/> - <include name="wsdl/**"/> - </metainf> - </jar> <!-- jbossws-jbws944 --> <jar jarfile="${build.test.dir}/libs/jbossws-jbws944.ejb3"> Modified: trunk/src/test/java/org/jboss/test/ws/jbws871/JBWS871TestCase.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jbws871/JBWS871TestCase.java 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/java/org/jboss/test/ws/jbws871/JBWS871TestCase.java 2006-07-05 11:52:43 UTC (rev 563) @@ -21,8 +21,12 @@ */ package org.jboss.test.ws.jbws871; -import javax.naming.InitialContext; +import java.io.File; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + import junit.framework.Test; import org.jboss.test.ws.JBossWSTest; @@ -42,7 +46,7 @@ public static Test suite() { - return JBossWSTestSetup.newTestSetup(JBWS871TestCase.class, "jbossws-jbws871-rpc.war, jbossws-jbws871-rpc-client.jar"); + return JBossWSTestSetup.newTestSetup(JBWS871TestCase.class, "jbossws-jbws871-rpc.war"); } protected void setUp() throws Exception @@ -51,9 +55,10 @@ if (endpoint == null) { - InitialContext iniCtx = getInitialContext(); - RpcArrayEndpointService service = (RpcArrayEndpointService)iniCtx.lookup("java:comp/env/service/RpcArrayEndpointService"); - endpoint = service.getRpcArrayEndpointPort(); + URL wsdlURL = new File("resources/jbws871/META-INF/wsdl/TestEndpoint.wsdl").toURL(); + QName serviceName = new QName("http://jbws871.ws.test.jboss.org/jaws", "RpcArrayEndpointService"); + Service service = Service.create(wsdlURL, serviceName); + endpoint = (RpcArrayEndpoint)service.getPort(RpcArrayEndpoint.class); } } Deleted: trunk/src/test/resources/jbws871/META-INF/application-client.xml =================================================================== --- trunk/src/test/resources/jbws871/META-INF/application-client.xml 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/resources/jbws871/META-INF/application-client.xml 2006-07-05 11:52:43 UTC (rev 563) @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<application-client 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/application-client_1_4.xsd" - version="1.4"> - - <display-name>JSR-181 Annotation test</display-name> - - <service-ref> - <service-ref-name>service/RpcArrayEndpointService</service-ref-name> - <service-interface>org.jboss.test.ws.jbws871.RpcArrayEndpointService</service-interface> - <wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file> - <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file> - <port-component-ref> - <service-endpoint-interface>org.jboss.test.ws.jbws871.RpcArrayEndpoint</service-endpoint-interface> - </port-component-ref> - </service-ref> - -</application-client> - Deleted: trunk/src/test/resources/jbws871/META-INF/jaxrpc-mapping.xml =================================================================== --- trunk/src/test/resources/jbws871/META-INF/jaxrpc-mapping.xml 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/resources/jbws871/META-INF/jaxrpc-mapping.xml 2006-07-05 11:52:43 UTC (rev 563) @@ -1,46 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'> - <package-mapping> - <package-type>org.jboss.test.ws.jbws871</package-type> - <namespaceURI>http://jbws871.ws.test.jboss.org/jaws</namespaceURI> - </package-mapping> - <service-interface-mapping> - <service-interface>org.jboss.test.ws.jbws871.RpcArrayEndpointService</service-interface> - <wsdl-service-name xmlns:serviceNS='http://jbws871.ws.test.jboss.org/jaws'>serviceNS:RpcArrayEndpointService</wsdl-service-name> - <port-mapping> - <port-name>RpcArrayEndpointPort</port-name> - <java-port-name>RpcArrayEndpointPort</java-port-name> - </port-mapping> - </service-interface-mapping> - <service-endpoint-interface-mapping> - <service-endpoint-interface>org.jboss.test.ws.jbws871.RpcArrayEndpoint</service-endpoint-interface> - <wsdl-port-type xmlns:portTypeNS='http://jbws871.ws.test.jboss.org/jaws'>portTypeNS:RpcArrayEndpoint</wsdl-port-type> - <wsdl-binding xmlns:bindingNS='http://jbws871.ws.test.jboss.org/jaws'>bindingNS:RpcArrayEndpointBinding</wsdl-binding> - <service-endpoint-method-mapping> - <java-method-name>intArr</java-method-name> - <wsdl-operation>intArr</wsdl-operation> - <method-param-parts-mapping> - <param-position>0</param-position> - <param-type>java.lang.String</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS='http://jbws871.ws.test.jboss.org/jaws'>wsdlMsgNS:RpcArrayEndpoint_intArr</wsdl-message> - <wsdl-message-part-name>String_1</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - <method-param-parts-mapping> - <param-position>1</param-position> - <param-type>java.lang.Integer[]</param-type> - <wsdl-message-mapping> - <wsdl-message xmlns:wsdlMsgNS='http://jbws871.ws.test.jboss.org/jaws'>wsdlMsgNS:RpcArrayEndpoint_intArr</wsdl-message> - <wsdl-message-part-name>Integer_1</wsdl-message-part-name> - <parameter-mode>IN</parameter-mode> - </wsdl-message-mapping> - </method-param-parts-mapping> - <wsdl-return-value-mapping> - <method-return-value>java.lang.Integer[]</method-return-value> - <wsdl-message xmlns:wsdlMsgNS='http://jbws871.ws.test.jboss.org/jaws'>wsdlMsgNS:RpcArrayEndpoint_intArrResponse</wsdl-message> - <wsdl-message-part-name>result</wsdl-message-part-name> - </wsdl-return-value-mapping> - </service-endpoint-method-mapping> - </service-endpoint-interface-mapping> -</java-wsdl-mapping> \ No newline at end of file Deleted: trunk/src/test/resources/jbws871/META-INF/jboss-client.xml =================================================================== --- trunk/src/test/resources/jbws871/META-INF/jboss-client.xml 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/resources/jbws871/META-INF/jboss-client.xml 2006-07-05 11:52:43 UTC (rev 563) @@ -1,9 +0,0 @@ -<?xml version='1.0' encoding='UTF-8' ?> - -<!DOCTYPE jboss-client PUBLIC - "-//JBoss//DTD Application Client 4.0//EN" - "http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd"> - -<jboss-client> - <jndi-name>jbossws-client</jndi-name> -</jboss-client> Deleted: trunk/src/test/resources/jbws871/wstools-config.xml =================================================================== --- trunk/src/test/resources/jbws871/wstools-config.xml 2006-07-05 10:55:12 UTC (rev 562) +++ trunk/src/test/resources/jbws871/wstools-config.xml 2006-07-05 11:52:43 UTC (rev 563) @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - wstools -dest ./META-INF -config wstools-config.xml ---> - -<configuration xmlns="http://www.jboss.org/jbossws-tools" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd"> - - <global> - <package-namespace package="org.jboss.test.ws.jbws871" namespace="http://jbws871.ws.test.jboss.org/jaws"/> - </global> - <wsdl-java file="META-INF/wsdl/TestEndpoint.wsdl"> - <mapping file="jaxrpc-mapping.xml"/> - </wsdl-java> - -</configuration> - -<!-- - org.jboss.test.ws.jbws871.Integer.Array -> org.jboss.test.ws.jbws871.IntegerArray - - <java-xml-type-mapping> - <java-type>org.jboss.test.ws.jbws871.IntegerArray</java-type> - <root-type-qname xmlns:typeNS='http://jbws871.ws.test.jboss.org/jaws'>typeNS:Integer.Array</root-type-qname> - <qname-scope>complexType</qname-scope> - <variable-mapping> - <java-variable-name>value</java-variable-name> - <xml-element-name>value</xml-element-name> - </variable-mapping> - </java-xml-type-mapping> - --> \ No newline at end of file |
Author: tho...@jb... Date: 2006-07-05 06:55:12 -0400 (Wed, 05 Jul 2006) New Revision: 562 Added: trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareServiceImpl.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocWrappedServiceImpl.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/ExampleSEI.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/ExampleServiceImpl.java Removed: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocWrappedService.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/ExampleService.java trunk/src/test/resources/jsr181/soapbinding/bare-config.xml trunk/src/test/resources/jsr181/soapbinding/bare-mapping.xml trunk/src/test/resources/jsr181/soapbinding/jaxrpc-mapping.xml trunk/src/test/resources/jsr181/soapbinding/wrapped-config.xml trunk/src/test/resources/jsr181/soapbinding/wrapped-mapping.xml Modified: trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPServerHandler.java trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java trunk/src/main/java/org/jboss/ws/binding/soap/JAXRPCBindingProvider.java trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java trunk/src/main/java/org/jboss/ws/deployment/AbstractAnnotationsMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR109ClientMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java trunk/src/main/java/org/jboss/ws/jaxws/client/PortProxy.java trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java trunk/src/test/ant/build-jars.xml trunk/src/test/java/org/jboss/test/ws/jbws860/JBWS860TestCase.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/SubmitBareRequest.java trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/SubmitBareResponse.java trunk/src/test/java/org/jboss/test/ws/jsr181/webmethod/JSR181WebMethodTestCase.java trunk/src/test/java/org/jboss/test/ws/xop/XOPElementRPCTestCase.java trunk/src/test/resources/jsr181/soapbinding/WEB-INF/web.xml Log: JBWS-1025: Implement javax.xml.ws.Dispatch Modified: trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPServerHandler.java =================================================================== --- trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPServerHandler.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/addressing/soap/SOAPServerHandler.java 2006-07-05 10:55:12 UTC (rev 562) @@ -154,7 +154,7 @@ outProps.setAction(ADDR_BUILDER.newURI(addrExt.getOutboundAction())); } else { - log.warn("Unable to resolve replyAction for "+opMetaData.getXmlName()); + log.warn("Unable to resolve replyAction for "+opMetaData.getQName()); } } Modified: trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java =================================================================== --- trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/binding/EndpointInvocation.java 2006-07-05 10:55:12 UTC (rev 562) @@ -166,7 +166,7 @@ { ParameterMetaData retMetaData = opMetaData.getReturnParameter(); if (value != null && retMetaData == null) - throw new WSException("Operation does not have a return value: " + opMetaData.getXmlName()); + throw new WSException("Operation does not have a return value: " + opMetaData.getQName()); log.debug("setReturnValue: " + getTypeName(value)); this.returnValue = value; Modified: trunk/src/main/java/org/jboss/ws/binding/soap/JAXRPCBindingProvider.java =================================================================== --- trunk/src/main/java/org/jboss/ws/binding/soap/JAXRPCBindingProvider.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/binding/soap/JAXRPCBindingProvider.java 2006-07-05 10:55:12 UTC (rev 562) @@ -75,7 +75,7 @@ /** On the client side, generate the payload from IN parameters. */ public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException { - log.debug("bindRequestMessage: " + opMetaData.getXmlName()); + log.debug("bindRequestMessage: " + opMetaData.getQName()); try { @@ -97,7 +97,7 @@ Style style = opMetaData.getStyle(); if (style == Style.RPC) { - QName opQName = opMetaData.getXmlName(); + QName opQName = opMetaData.getQName(); Name opName = new NameImpl(namespaceRegistry.registerQName(opQName)); log.debug("Create RPC body element: " + opName); @@ -186,7 +186,7 @@ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, SOAPMessage reqMessage) throws BindingException { - log.debug("unbindRequestMessage: " + opMetaData.getXmlName()); + log.debug("unbindRequestMessage: " + opMetaData.getQName()); try { @@ -306,7 +306,7 @@ /** On the server side, generate the payload from OUT parameters. */ public SOAPMessage bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException { - log.debug("bindResponseMessage: " + opMetaData.getXmlName()); + log.debug("bindResponseMessage: " + opMetaData.getQName()); try { @@ -439,7 +439,7 @@ public void unbindResponseMessage(OperationMetaData opMetaData, SOAPMessage resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException { - log.debug("unbindResponseMessage: " + opMetaData.getXmlName()); + log.debug("unbindResponseMessage: " + opMetaData.getQName()); try { Modified: trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java =================================================================== --- trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderMessage.java 2006-07-05 10:55:12 UTC (rev 562) @@ -59,7 +59,7 @@ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, SOAPMessage reqMessage) throws BindingException { - log.debug("unbindRequestMessage: " + opMetaData.getXmlName()); + log.debug("unbindRequestMessage: " + opMetaData.getQName()); try { @@ -86,7 +86,7 @@ /** On the server side, generate the payload from OUT parameters. */ public SOAPMessage bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException { - log.debug("bindResponseMessage: " + opMetaData.getXmlName()); + log.debug("bindResponseMessage: " + opMetaData.getQName()); try { Modified: trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java =================================================================== --- trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/binding/soap/JAXWSBindingProviderPayload.java 2006-07-05 10:55:12 UTC (rev 562) @@ -64,7 +64,7 @@ /** On the server side, extract the IN parameters from the payload and populate an Invocation object */ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, SOAPMessage reqMessage) throws BindingException { - log.debug("unbindRequestMessage: " + opMetaData.getXmlName()); + log.debug("unbindRequestMessage: " + opMetaData.getQName()); try { @@ -94,7 +94,7 @@ /** On the server side, generate the payload from OUT parameters. */ public SOAPMessage bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException { - log.debug("bindResponseMessage: " + opMetaData.getXmlName()); + log.debug("bindResponseMessage: " + opMetaData.getQName()); try { Modified: trunk/src/main/java/org/jboss/ws/deployment/AbstractAnnotationsMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/AbstractAnnotationsMetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/AbstractAnnotationsMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -71,7 +71,7 @@ { UnifiedMetaData wsMetaData = serviceMetaData.getUnifiedMetaData(); Thread.currentThread().setContextClassLoader(wsMetaData.getClassLoader()); - String serviceName = serviceMetaData.getName().getLocalPart(); + String serviceName = serviceMetaData.getQName().getLocalPart(); JavaToWSDL javaToWSDL = new JavaToWSDL(Constants.NS_WSDL11); javaToWSDL.setUnifiedMetaData(wsMetaData); Modified: trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -104,7 +104,7 @@ private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions) throws IOException { - QName serviceQName = serviceMetaData.getName(); + QName serviceQName = serviceMetaData.getQName(); // Get the WSDL service WSDLService wsdlService = null; @@ -114,7 +114,7 @@ throw new IllegalArgumentException("Expected a single service element"); wsdlService = wsdlDefinitions.getServices()[0]; - serviceMetaData.setName(wsdlService.getQName()); + serviceMetaData.setQName(wsdlService.getQName()); } else { @@ -195,7 +195,7 @@ private void buildParameterMetaDataRpc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, TypeMappingImpl typeMapping) { - log.trace("buildParameterMetaDataRpc: " + opMetaData.getXmlName()); + log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName()); TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData(); @@ -255,7 +255,7 @@ private void buildParameterMetaDataDoc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, TypeMappingImpl typeMapping) { - log.trace("buildParameterMetaDataDoc: " + opMetaData.getXmlName()); + log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName()); EndpointMetaData epMetaData = opMetaData.getEndpointMetaData(); ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData(); @@ -271,9 +271,6 @@ if (typeMetaData != null) javaTypeName = typeMetaData.getJavaTypeName(); - if (javaTypeName == null) - throw new WSException("Cannot obtain java type mapping for: " + xmlType); - // Check if we need to wrap the parameters boolean isWrapParameters = false; @@ -310,9 +307,6 @@ if (typesMetaData.getTypeMappingByXMLType(xmlType) != null) javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName(); - if (javaTypeName == null) - throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType); - if (hasReturnMapping) { ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR109ClientMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR109ClientMetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR109ClientMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -144,7 +144,7 @@ private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions, JavaWsdlMapping javaWsdlMapping, UnifiedServiceRefMetaData serviceRefMetaData) throws IOException { - QName serviceQName = serviceMetaData.getName(); + QName serviceQName = serviceMetaData.getQName(); // Get the WSDL service WSDLService wsdlService = null; @@ -154,7 +154,7 @@ throw new IllegalArgumentException("Expected a single service element"); wsdlService = wsdlDefinitions.getServices()[0]; - serviceMetaData.setName(wsdlService.getQName()); + serviceMetaData.setQName(wsdlService.getQName()); } else { Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -200,7 +200,7 @@ private void buildParameterMetaDataRpc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping) { - log.trace("buildParameterMetaDataRpc: " + opMetaData.getXmlName()); + log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName()); TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData(); @@ -416,7 +416,7 @@ private void buildParameterMetaDataDoc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping) { - log.trace("buildParameterMetaDataDoc: " + opMetaData.getXmlName()); + log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName()); EndpointMetaData epMetaData = opMetaData.getEndpointMetaData(); ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData(); Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -124,7 +124,7 @@ throw new WSException("Cannot find port in wsdl: " + portName); // set service name - serviceMetaData.setName(wsdlEndpoint.getWsdlService().getQName()); + serviceMetaData.setQName(wsdlEndpoint.getWsdlService().getQName()); ServerEndpointMetaData sepMetaData = new ServerEndpointMetaData(serviceMetaData, portName); sepMetaData.setPortComponentName(pcMetaData.getPortComponentName()); Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -289,8 +289,8 @@ if (opMetaData.isDocumentWrapped()) { - xmlName = opMetaData.getXmlName(); - xmlType = opMetaData.getXmlName(); + xmlName = opMetaData.getQName(); + xmlType = opMetaData.getQName(); String requestWrapperType = null; if (method.isAnnotationPresent(RequestWrapper.class)) @@ -551,7 +551,7 @@ private QName getWebParamName(OperationMetaData opMetaData, Map<String, Integer> typeIndexes, Class javaType, WebParam webParam) { QName xmlName = null; - String namespaceURI = opMetaData.getXmlName().getNamespaceURI(); + String namespaceURI = opMetaData.getQName().getNamespaceURI(); if (webParam != null) { if (webParam.targetNamespace().length() > 0) @@ -566,7 +566,7 @@ } if (xmlName == null && opMetaData.isDocumentBare()) - xmlName = new QName(namespaceURI, opMetaData.getXmlName().getLocalPart()); + xmlName = new QName(namespaceURI, opMetaData.getQName().getLocalPart()); if (xmlName == null) { @@ -586,14 +586,14 @@ private QName getWebParamType(OperationMetaData opMetaData, Class javaType) { - String namespaceURI = opMetaData.getXmlName().getNamespaceURI(); + String namespaceURI = opMetaData.getQName().getNamespaceURI(); return ToolsUtils.getXMLType(javaType, namespaceURI); } private QName getWebResultName(OperationMetaData opMetaData, Class javaType, WebResult anWebResult) { QName xmlName = null; - String namespaceURI = opMetaData.getXmlName().getNamespaceURI(); + String namespaceURI = opMetaData.getQName().getNamespaceURI(); if (anWebResult != null) { @@ -625,7 +625,7 @@ + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters."); String name = WSDLUtils.getInstance().getJustClassName(exception); - QName xmlName = new QName(omd.getXmlName().getNamespaceURI(), name); + QName xmlName = new QName(omd.getQName().getNamespaceURI(), name); FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlName, exception.getName()); omd.addFault(fmd); Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxrpc/CallProxy.java 2006-07-05 10:55:12 UTC (rev 562) @@ -134,7 +134,7 @@ if (opMetaData == null) throw new WSException("Cannot obtain operation meta data for: " + methodName); - call.setOperationName(opMetaData.getXmlName()); + call.setOperationName(opMetaData.getQName()); try { Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxrpc/ParameterWrapping.java 2006-07-05 10:55:12 UTC (rev 562) @@ -283,7 +283,7 @@ if (wrappedTypes == null) throw new WSException("Cannot generate a type when their is no type information"); - String serviceName = serviceMetaData.getName().getLocalPart(); + String serviceName = serviceMetaData.getQName().getLocalPart(); String parameterName = pmd.getXmlName().getLocalPart(); String endpointName = endpointMetaData.getQName().getLocalPart(); String packageName = endpointMetaData.getServiceEndpointInterface().getPackage().getName(); Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceImpl.java 2006-07-05 10:55:12 UTC (rev 562) @@ -135,7 +135,7 @@ */ public QName getServiceName() { - return serviceMetaData.getName(); + return serviceMetaData.getQName(); } /** @@ -232,7 +232,7 @@ List<Call> calls = new ArrayList<Call>(); for (OperationMetaData opMetaData : epMetaData.getOperations()) { - Call call = createCall(portName, opMetaData.getXmlName()); + Call call = createCall(portName, opMetaData.getQName()); calls.add(call); } Added: trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java 2006-07-05 10:55:12 UTC (rev 562) @@ -0,0 +1,276 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.jaxws.client; + +// $Id$ + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.StringReader; +import java.util.Map; +import java.util.concurrent.Future; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; +import javax.xml.soap.MessageFactory; +import javax.xml.soap.SOAPElement; +import javax.xml.soap.SOAPEnvelope; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPMessage; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import javax.xml.ws.AsyncHandler; +import javax.xml.ws.Binding; +import javax.xml.ws.BindingProvider; +import javax.xml.ws.Dispatch; +import javax.xml.ws.Response; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.Service.Mode; + +import org.jboss.logging.Logger; +import org.jboss.util.NotImplementedException; +import org.jboss.util.xml.DOMWriter; +import org.jboss.ws.metadata.EndpointMetaData; +import org.jboss.ws.metadata.ServiceMetaData; +import org.jboss.ws.soap.SOAPBodyImpl; +import org.jboss.ws.soap.SOAPConnectionImpl; + +/** + * The Dispatch interface provides support for the dynamic invocation of a service endpoint operations. + * The javax.xml.ws.Service interface acts as a factory for the creation of Dispatch instances. + * + * @author Tho...@jb... + * @since 04-Jul-2006 + */ +public class DispatchImpl<T> implements Dispatch<T> +{ + // provide logging + private final Logger log = Logger.getLogger(DispatchImpl.class); + + private BindingProvider bindingProvider = new BindingProviderImpl(); + private EndpointMetaData epMetaData; + private JAXBContext jaxbContext; + private Class<T> type; + private Mode mode; + + public DispatchImpl(ServiceMetaData serviceMetaData, QName portName, Class<T> type, Mode mode) + { + this.type = type; + this.mode = mode; + initDispatch(serviceMetaData, portName); + } + + public DispatchImpl(ServiceMetaData serviceMetaData, QName portName, JAXBContext jbc, Mode mode) + { + this.jaxbContext = jbc; + this.mode = mode; + initDispatch(serviceMetaData, portName); + } + + public Object invoke(Object obj) + { + SOAPMessage reqMsg = getRequestMessage(obj); + try + { + String targetAddress = epMetaData.getEndpointAddress(); + SOAPMessage resMsg = new SOAPConnectionImpl().call(reqMsg, targetAddress); + Object retObj = getReturnObject(resMsg); + return retObj; + } + catch (SOAPException ex) + { + throw new WebServiceException("Cannot dispatch request message"); + } + } + + public Response invokeAsync(Object obj) + { + throw new NotImplementedException(); + } + + public Future invokeAsync(Object obj, AsyncHandler asynchandler) + { + throw new NotImplementedException(); + } + + public void invokeOneWay(Object obj) + { + SOAPMessage reqMsg = getRequestMessage(obj); + try + { + String targetAddress = epMetaData.getEndpointAddress(); + new SOAPConnectionImpl().callOneWay(reqMsg, targetAddress); + } + catch (SOAPException ex) + { + throw new WebServiceException("Cannot dispatch request message"); + } + } + + public Map<String, Object> getRequestContext() + { + return bindingProvider.getRequestContext(); + } + + public Map<String, Object> getResponseContext() + { + return bindingProvider.getResponseContext(); + } + + public Binding getBinding() + { + return bindingProvider.getBinding(); + } + + private void initDispatch(ServiceMetaData serviceMetaData, QName portName) + { + epMetaData = serviceMetaData.getEndpoint(portName); + if (epMetaData == null && serviceMetaData.getEndpoints().size() == 1) + { + log.warn("Cannot find port meta data for: " + portName); + epMetaData = serviceMetaData.getEndpoints().get(0); + } + if (epMetaData == null) + throw new WebServiceException("Cannot find port meta data for: " + portName); + + if (type == SOAPMessage.class && mode == Mode.MESSAGE) + { + // accepted + } + else if (type == Source.class) + { + // accepted + } + else if (jaxbContext != null && mode == Mode.PAYLOAD) + { + // accepted + } + else + { + throw new WebServiceException("Unsupported type/mode: " + (type != null ? type.getName() : null) + "/" + mode); + } + } + + private SOAPMessage getRequestMessage(Object obj) + { + SOAPMessage reqMsg = null; + try + { + MessageFactory factory = MessageFactory.newInstance(); + if (type == SOAPMessage.class) + { + reqMsg = (SOAPMessage)obj; + } + else if (type == Source.class) + { + Source source = (Source)obj; + if (mode == Mode.PAYLOAD) + { + reqMsg = factory.createMessage(); + SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody(); + soapBody.setPayload(source); + } + if (mode == Mode.MESSAGE) + { + TransformerFactory tf = TransformerFactory.newInstance(); + ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); + tf.newTransformer().transform(source, new StreamResult(baos)); + reqMsg = factory.createMessage(null, new ByteArrayInputStream(baos.toByteArray())); + } + } + else if (jaxbContext != null) + { + Marshaller marshaller = jaxbContext.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); + ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); + marshaller.marshal(obj, baos); + + reqMsg = factory.createMessage(); + SOAPBodyImpl soapBody = (SOAPBodyImpl)reqMsg.getSOAPBody(); + StreamSource source = new StreamSource(new ByteArrayInputStream(baos.toByteArray())); + soapBody.setPayload(source); + } + } + catch (RuntimeException rte) + { + throw rte; + } + catch (Exception ex) + { + throw new WebServiceException("Cannot create request message", ex); + } + + if (reqMsg == null) + throw new WebServiceException("Cannot create request message for: " + obj); + + return reqMsg; + } + + private Object getReturnObject(SOAPMessage resMsg) + { + Object retObj = null; + try + { + if (type == SOAPMessage.class) + { + retObj = resMsg; + } + else if (type == Source.class) + { + if (mode == Mode.PAYLOAD) + { + SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody(); + SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next(); + String xmlPayload = DOMWriter.printNode(soapElement, false); + retObj = new StreamSource(new StringReader(xmlPayload)); + } + if (mode == Mode.MESSAGE) + { + SOAPEnvelope soapEnvelope = resMsg.getSOAPPart().getEnvelope(); + String xmlMessage = DOMWriter.printNode(soapEnvelope, false); + retObj = new StreamSource(new StringReader(xmlMessage)); + } + } + else if (jaxbContext != null) + { + SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody(); + SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next(); + + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + retObj = unmarshaller.unmarshal(soapElement); + } + } + catch (RuntimeException rte) + { + throw rte; + } + catch (Exception ex) + { + throw new WebServiceException("Cannot create request message", ex); + } + return retObj; + } +} Property changes on: trunk/src/main/java/org/jboss/ws/jaxws/client/DispatchImpl.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: trunk/src/main/java/org/jboss/ws/jaxws/client/PortProxy.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxws/client/PortProxy.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxws/client/PortProxy.java 2006-07-05 10:55:12 UTC (rev 562) @@ -103,7 +103,7 @@ if (opMetaData == null) throw new WSException("Cannot obtain operation meta data for: " + methodName); - QName opName = opMetaData.getXmlName(); + QName opName = opMetaData.getQName(); try { Modified: trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java 2006-07-05 10:55:12 UTC (rev 562) @@ -27,6 +27,7 @@ import java.net.URL; import java.net.URLClassLoader; import java.rmi.Remote; +import java.util.ArrayList; import java.util.Iterator; import java.util.concurrent.Executor; @@ -42,6 +43,7 @@ import org.jboss.util.NotImplementedException; import org.jboss.ws.deployment.JAXWSClientMetaDataBuilder; import org.jboss.ws.jaxrpc.MetaDataSynchronization; +import org.jboss.ws.jaxws.client.DispatchImpl; import org.jboss.ws.jaxws.client.JAXWSClient; import org.jboss.ws.jaxws.client.PortProxy; import org.jboss.ws.metadata.EndpointMetaData; @@ -106,6 +108,10 @@ } @Override + /** + * The getPort method returns a stub. A service client uses this stub to invoke operations on the target service endpoint. + * The serviceEndpointInterface specifies the service endpoint interface that is supported by the created dynamic proxy or stub instance. + */ public <T> T getPort(Class<T> seiClass) { return getPort(null, seiClass); @@ -120,31 +126,40 @@ @Override public <T> Dispatch<T> createDispatch(QName qname, Class<T> type, Mode mode) { - throw new NotImplementedException(); + DispatchImpl dispatch = new DispatchImpl(serviceMetaData, qname, type, mode); + return dispatch; } @Override - public Dispatch<Object> createDispatch(QName qname, JAXBContext jaxbcontext, Mode mode) + public Dispatch<Object> createDispatch(QName qname, JAXBContext jbc, Mode mode) { - throw new NotImplementedException(); + DispatchImpl dispatch = new DispatchImpl(serviceMetaData, qname, jbc, mode); + return dispatch; } + /** Gets the name of this service. */ @Override public QName getServiceName() { - throw new NotImplementedException(); + return serviceMetaData.getQName(); } + /** Returns an Iterator for the list of QNames of service endpoints grouped by this service */ @Override - public Iterator getPorts() + public Iterator<QName> getPorts() { - throw new NotImplementedException(); + ArrayList<QName> portNames = new ArrayList<QName>(); + for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints()) + { + portNames.add(epMetaData.getQName()); + } + return portNames.iterator(); } @Override public URL getWSDLDocumentLocation() { - throw new NotImplementedException(); + return serviceMetaData.getWsdlLocation(); } @Override Modified: trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-07-05 10:55:12 UTC (rev 562) @@ -299,7 +299,7 @@ OperationMetaData opMetaData = null; for (OperationMetaData auxOperation : operations) { - QName opQName = auxOperation.getXmlName(); + QName opQName = auxOperation.getQName(); if (opQName.equals(xmlName)) { if (opMetaData == null) Modified: trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/metadata/OperationMetaData.java 2006-07-05 10:55:12 UTC (rev 562) @@ -56,7 +56,7 @@ // The parent interface private EndpointMetaData epMetaData; - private QName xmlName; + private QName qname; private QName responseName; private String javaName; private Method javaMethod; @@ -66,33 +66,33 @@ private List<FaultMetaData> faults = new ArrayList<FaultMetaData>(); private ParameterMetaData returnParam; - public OperationMetaData(QName xmlName, String javaName) + public OperationMetaData(QName qname, String javaName) { UnifiedMetaData umd = new UnifiedMetaData(); ServiceMetaData smd = new ServiceMetaData(umd, new QName("mock-service")); ServerEndpointMetaData epmd = new ServerEndpointMetaData(smd, new QName("mock-endpoint")); - initOperationMetaData(epmd, xmlName, javaName); + initOperationMetaData(epmd, qname, javaName); } - public OperationMetaData(EndpointMetaData epMetaData, QName xmlName, String javaName) + public OperationMetaData(EndpointMetaData epMetaData, QName qname, String javaName) { - log.trace("new OperationMetaData: [xmlName=" + xmlName + ",javaName=" + javaName + "]"); - initOperationMetaData(epMetaData, xmlName, javaName); + log.trace("new OperationMetaData: [xmlName=" + qname + ",javaName=" + javaName + "]"); + initOperationMetaData(epMetaData, qname, javaName); } - private void initOperationMetaData(EndpointMetaData epMetaData, QName xmlName, String javaName) + private void initOperationMetaData(EndpointMetaData epMetaData, QName qname, String javaName) { this.epMetaData = epMetaData; - this.xmlName = xmlName; + this.qname = qname; this.javaName = javaName; - if (xmlName == null) - throw new IllegalArgumentException("Invalid null xmlName argument"); + if (qname == null) + throw new IllegalArgumentException("Invalid null qname argument"); if (javaName == null) - throw new IllegalArgumentException("Invalid null javaName argument, for: " + xmlName); + throw new IllegalArgumentException("Invalid null javaName argument, for: " + qname); - String nsURI = xmlName.getNamespaceURI(); - String localPart = xmlName.getLocalPart(); + String nsURI = qname.getNamespaceURI(); + String localPart = qname.getLocalPart(); this.responseName = new QName(nsURI, localPart + "Response"); } @@ -101,9 +101,9 @@ return epMetaData; } - public QName getXmlName() + public QName getQName() { - return xmlName; + return qname; } public QName getResponseName() @@ -493,7 +493,7 @@ public String toString() { StringBuilder buffer = new StringBuilder("\nOperationMetaData:"); - buffer.append("\n xmlName=" + xmlName); + buffer.append("\n xmlName=" + qname); buffer.append("\n javaName=" + javaName); buffer.append("\n style=" + getStyle() + "/" + getUse() + (getStyle() == Style.DOCUMENT ? "/" + getParameterStyle() : "")); buffer.append("\n oneWay=" + oneWayOperation); Modified: trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java =================================================================== --- trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/metadata/ServiceMetaData.java 2006-07-05 10:55:12 UTC (rev 562) @@ -72,7 +72,7 @@ // The service endpoints private Map<QName, EndpointMetaData> endpoints = new LinkedHashMap<QName, EndpointMetaData>(); - private QName name; + private QName qname; private String wsdName; private String wsdlFile; private String jaxrpcMappingFile; @@ -95,7 +95,7 @@ public ServiceMetaData(UnifiedMetaData wsMetaData, QName name) { this.wsMetaData = wsMetaData; - this.name = name; + this.qname = name; this.types = new TypesMetaData(this); } @@ -104,14 +104,14 @@ return wsMetaData; } - public void setName(QName name) + public void setQName(QName name) { - this.name = name; + this.qname = name; } - public QName getName() + public QName getQName() { - return name; + return qname; } public String getWebserviceDescriptionName() @@ -253,7 +253,22 @@ WSDLDefinitions wsdlDefinitions = (WSDLDefinitions)wsMetaData.getWSDLDefinition(wsdlFile); if (wsdlDefinitions == null && wsdlFile != null) { - URL wsdlLocation = null; + URL wsdlLocation = getWsdlLocation(); + if (wsdlLocation == null) + throw new IllegalArgumentException("Cannot find wsdl in deployment: " + wsdlFile); + + WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance(); + wsdlDefinitions = factory.parse(wsdlLocation); + wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions); + } + return wsdlDefinitions; + } + + public URL getWsdlLocation() + { + URL wsdlLocation = null; + if (wsdlFile != null) + { try { wsdlLocation = new URL(wsdlFile); @@ -266,14 +281,8 @@ { wsdlLocation = wsMetaData.getResourceLoader().getResource(wsdlFile); } - if (wsdlLocation == null) - throw new IllegalArgumentException("Cannot find wsdl in deployment: " + wsdlFile); - - WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance(); - wsdlDefinitions = factory.parse(wsdlLocation); - wsMetaData.addWSDLDefinition(wsdlFile, wsdlDefinitions); - } - return wsdlDefinitions; + } + return wsdlLocation; } public TypeMappingImpl getTypeMapping() @@ -366,14 +375,14 @@ /** Assert that the given namespace is the WSDL's target namespace */ public void assertTargetNamespace(String targetNS) { - if (getName().getNamespaceURI().equals(targetNS) == false) + if (getQName().getNamespaceURI().equals(targetNS) == false) throw new WSException("Requested namespace is not WSDL target namespace: " + targetNS); } public String toString() { StringBuilder buffer = new StringBuilder("\nServiceMetaData:"); - buffer.append("\n name=" + name); + buffer.append("\n name=" + qname); buffer.append("\n wsdName=" + wsdName); buffer.append("\n wsdlFile=" + wsdlFile); buffer.append("\n jaxrpcFile=" + jaxrpcMappingFile); Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java 2006-07-05 10:55:12 UTC (rev 562) @@ -98,14 +98,21 @@ */ public SOAPMessage call(SOAPMessage reqMessage, Object endpoint) throws SOAPException { - return call(reqMessage, endpoint, false); + return callInternal(reqMessage, endpoint, false); } /** - * Sends the given message to the specified endpoint. + * Sends the given message to the specified endpoint. This method is logically + * non blocking. */ - public SOAPMessage call(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws SOAPException + public SOAPMessage callOneWay(SOAPMessage reqMessage, Object endpoint) throws SOAPException { + return callInternal(reqMessage, endpoint, true); + } + + /** Sends the given message to the specified endpoint. */ + private SOAPMessage callInternal(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws SOAPException + { if (reqMessage == null) throw new IllegalArgumentException("Given SOAPMessage cannot be null"); if (endpoint == null) Modified: trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java =================================================================== --- trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/soap/SOAPMessageDispatcher.java 2006-07-05 10:55:12 UTC (rev 562) @@ -111,7 +111,7 @@ } } - log.debug("getDispatchDestination: " + (opMetaData != null ? opMetaData.getXmlName() : null)); + log.debug("getDispatchDestination: " + (opMetaData != null ? opMetaData.getQName() : null)); return opMetaData; } } \ No newline at end of file Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java =================================================================== --- trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2006-07-05 10:55:12 UTC (rev 562) @@ -192,7 +192,7 @@ wsdl.addInterface(wsdlInterface); } - QName xmlName = op.getXmlName(); + QName xmlName = op.getQName(); String opname = xmlName.getLocalPart(); if(opname == null || opname.length() == 0) throw new WSException("opname is null or blank"); @@ -267,7 +267,7 @@ wsdl.addBinding(wsdlBinding); } - String opname = op.getXmlName().getLocalPart(); + String opname = op.getQName().getLocalPart(); //Operation Level WSDLBindingOperation wsdlBindingOperation = new WSDLBindingOperation(wsdlBinding); wsdlBindingOperation.setRef(new QName(wsdl.getTargetNamespace(), opname)); @@ -326,7 +326,7 @@ { if(endpoint == null) throw new WSException("Illegal Null Argument: endpt"); - String serviceName = endpoint.getServiceMetaData().getName().getLocalPart(); + String serviceName = endpoint.getServiceMetaData().getQName().getLocalPart(); //Create a WSDLService WSDLService wsdlService = new WSDLService(wsdl); @@ -361,7 +361,7 @@ */ private void buildServiceMapping(EndpointMetaData endpoint, String interfaceName) { - QName origQName = endpoint.getServiceMetaData().getName(); + QName origQName = endpoint.getServiceMetaData().getQName(); String serviceInterfaceName = endpoint.getServiceEndpointInterface().getPackage().getName() + "." + origQName.getLocalPart(); QName serviceQName = new QName(origQName.getNamespaceURI(), origQName.getLocalPart(), "serviceNS"); @@ -385,7 +385,7 @@ { ServiceEndpointMethodMapping methodMapping = new ServiceEndpointMethodMapping(seiMapping); methodMapping.setJavaMethodName(operation.getJavaName()); - methodMapping.setWsdlOperation(operation.getXmlName().getLocalPart()); + methodMapping.setWsdlOperation(operation.getQName().getLocalPart()); boolean isWrapped = operation.isDocumentWrapped(); methodMapping.setWrappedElement(isWrapped); int i = 0; @@ -477,7 +477,7 @@ WsdlMessageMapping messageMapping = new WsdlMessageMapping(paramMapping); messageMapping.setWsdlMessagePartName(name); - String messageName = interfaceName + "_" + operation.getXmlName().getLocalPart(); + String messageName = interfaceName + "_" + operation.getQName().getLocalPart(); if ("OUT".equals(mode)) messageName += "Response"; QName messageQName = new QName(wsdl.getTargetNamespace(), messageName, "wsdlMsgNS"); @@ -494,7 +494,7 @@ WsdlReturnValueMapping returnMapping = new WsdlReturnValueMapping(methodMapping); returnMapping.setMethodReturnValue(type); returnMapping.setWsdlMessagePartName(name); - String messageName = interfaceName + "_" + operation.getXmlName().getLocalPart() + "Response";; + String messageName = interfaceName + "_" + operation.getQName().getLocalPart() + "Response";; QName messageQName = new QName(wsdl.getTargetNamespace(), messageName, "wsdlMsgNS"); returnMapping.setWsdlMessage(messageQName); methodMapping.setWsdlReturnValueMapping(returnMapping); Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java =================================================================== --- trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-07-05 10:55:12 UTC (rev 562) @@ -218,14 +218,14 @@ { for (ParameterMetaData parameter : operation.getParameters()) { - String name = endpointClass.getSimpleName() + "_" + operation.getXmlName().getLocalPart() + "_RequestStruct"; + String name = endpointClass.getSimpleName() + "_" + operation.getQName().getLocalPart() + "_RequestStruct"; createWrapperType(parameter, name, packageName, index, classLoader, outDir); } ParameterMetaData returnParameter = operation.getReturnParameter(); if (returnParameter != null) { - String name = endpointClass.getSimpleName() + "_" + operation.getXmlName().getLocalPart() + "_ResponseStruct"; + String name = endpointClass.getSimpleName() + "_" + operation.getQName().getLocalPart() + "_ResponseStruct"; createWrapperType(returnParameter, name, packageName, index, classLoader, outDir); } } Modified: trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2006-07-05 10:55:12 UTC (rev 562) @@ -154,7 +154,7 @@ if (om.isDocumentWrapped()) { - QName xmlName = new QName(tmd.typeNamespace, om.getXmlName().getLocalPart()); + QName xmlName = new QName(tmd.typeNamespace, om.getQName().getLocalPart()); QName xmlType = xmlName; wrappedParameter = new ParameterMetaData(om, xmlName, xmlType, null); @@ -276,7 +276,7 @@ private ParameterMetaData getParameterMetaData(Class type, OperationMetaData om, OperationConfig config, int index) { QName xmlType = ToolsUtils.getXMLType(type, tmd.typeNamespace); - QName xmlName = getXmlName(type, config, index, om.isDocumentBare() ? om.getXmlName().getLocalPart() : null); + QName xmlName = getXmlName(type, config, index, om.isDocumentBare() ? om.getQName().getLocalPart() : null); ParameterMetaData pm = new ParameterMetaData(om, xmlName, xmlType, type.getName()); pm.setInHeader(isHeaderParameter(config, index)); Modified: trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java =================================================================== --- trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/main/java/org/jboss/ws/wsse/WSSecurityDispatcher.java 2006-07-05 10:55:12 UTC (rev 562) @@ -127,7 +127,7 @@ opMetaData = soapMessage.getOperationMetaData(epMetaData); } - String operation = opMetaData.getXmlName().toString(); + String operation = opMetaData.getQName().toString(); String port = opMetaData.getEndpointMetaData().getQName().getLocalPart(); if (hasRequirements(config, operation, port)) @@ -154,7 +154,7 @@ opMetaData = soapMessage.getOperationMetaData(epMetaData); } - String operation = opMetaData.getXmlName().toString(); + String operation = opMetaData.getQName().toString(); String port = opMetaData.getEndpointMetaData().getQName().getLocalPart(); List<OperationDescription<RequireOperation>> operations = buildRequireOperations(config, operation, port); @@ -227,7 +227,7 @@ SOAPMessageImpl soapMessage = (SOAPMessageImpl)ctx.getMessage(); OperationMetaData opMetaData = ctx.getOperationMetaData(); - String operation = opMetaData.getXmlName().toString(); + String operation = opMetaData.getQName().toString(); String port = opMetaData.getEndpointMetaData().getQName().getLocalPart(); Config operationConfig = getConfig(config, port, operation); Modified: trunk/src/test/ant/build-jars.xml =================================================================== --- trunk/src/test/ant/build-jars.xml 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/test/ant/build-jars.xml 2006-07-05 10:55:12 UTC (rev 562) @@ -676,9 +676,9 @@ <!-- jbossws-jsr181-soapbinding --> <war warfile="${build.test.dir}/libs/jbossws-jsr181-soapbinding.war" webxml="${build.test.dir}/resources/jsr181/soapbinding/WEB-INF/web.xml"> <classes dir="${build.test.dir}/classes"> - <include name="org/jboss/test/ws/jsr181/soapbinding/DocBareService.class"/> - <include name="org/jboss/test/ws/jsr181/soapbinding/DocWrappedService.class"/> - <include name="org/jboss/test/ws/jsr181/soapbinding/ExampleService.class"/> + <include name="org/jboss/test/ws/jsr181/soapbinding/DocBareServiceImpl.class"/> + <include name="org/jboss/test/ws/jsr181/soapbinding/DocWrappedServiceImpl.class"/> + <include name="org/jboss/test/ws/jsr181/soapbinding/ExampleServiceImpl.class"/> <include name="org/jboss/test/ws/jsr181/soapbinding/SubmitBareRequest.class"/> <include name="org/jboss/test/ws/jsr181/soapbinding/SubmitBareResponse.class"/> <include name="org/jboss/test/ws/jsr181/soapbinding/PurchaseOrder.class"/> Modified: trunk/src/test/java/org/jboss/test/ws/jbws860/JBWS860TestCase.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jbws860/JBWS860TestCase.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/test/java/org/jboss/test/ws/jbws860/JBWS860TestCase.java 2006-07-05 10:55:12 UTC (rev 562) @@ -57,7 +57,7 @@ assertNotNull(wsdlDef); } - public void testHervletAccess() throws Exception + public void testServletAccess() throws Exception { HttpURLConnection con = (HttpURLConnection)new URL("http://" + getServerHost() + ":8080/test/TestServlet").openConnection(); BufferedReader isr = new BufferedReader(new InputStreamReader(con.getInputStream())); Deleted: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java 2006-07-05 10:55:12 UTC (rev 562) @@ -1,62 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.jboss.test.ws.jsr181.soapbinding; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebResult; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; - -import org.jboss.logging.Logger; - -/** - * Test the JSR-181 annotation: javax.jws.SOAPBinding - * - * @author Tho...@jb... - * @author <a href="mailto:jas...@jb...">Jason T. Greene</a> - * @since 16-Oct-2005 - */ -@WebService -@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) -public class DocBareService -{ - // Provide logging - private static Logger log = Logger.getLogger(ExampleService.class); - - @WebMethod(operationName = "SubmitPO") - public SubmitBareResponse submitPO(SubmitBareRequest poRequest) - { - log.info("submitPO: " + poRequest); - SubmitBareResponse poResponse = new SubmitBareResponse(poRequest.getProduct()); - return poResponse; - } - - @WebMethod(operationName = "SubmitNamespacedPO") - @WebResult(targetNamespace = "http://namespace/result", name="SubmitBareResponse") - public SubmitBareResponse submitNamespacedPO(@WebParam(targetNamespace = "http://namespace/request") SubmitBareRequest poRequest) - { - log.info("submitNamespacedPO: " + poRequest); - SubmitBareResponse poResponse = new SubmitBareResponse(poRequest.getProduct()); - return poResponse; - } -} Copied: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareServiceImpl.java (from rev 545, trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java) =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareService.java 2006-07-03 17:31:58 UTC (rev 545) +++ trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocBareServiceImpl.java 2006-07-05 10:55:12 UTC (rev 562) @@ -0,0 +1,62 @@ +/* + * 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.jsr181.soapbinding; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.jws.soap.SOAPBinding; + +import org.jboss.logging.Logger; + +/** + * Test the JSR-181 annotation: javax.jws.SOAPBinding + * + * @author Tho...@jb... + * @author <a href="mailto:jas...@jb...">Jason T. Greene</a> + * @since 16-Oct-2005 + */ +@WebService(serviceName = "DocBareService", name = "DocBareServicePort") +@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) +public class DocBareServiceImpl +{ + // Provide logging + private static Logger log = Logger.getLogger(ExampleServiceImpl.class); + + @WebMethod(operationName = "SubmitPO") + public SubmitBareResponse submitPO(SubmitBareRequest poRequest) + { + log.info("submitPO: " + poRequest); + SubmitBareResponse poResponse = new SubmitBareResponse(poRequest.getProduct()); + return poResponse; + } + + @WebMethod(operationName = "SubmitNamespacedPO") + @WebResult(targetNamespace = "http://namespace/result", name = "SubmitBareResponse") + public SubmitBareResponse submitNamespacedPO(@WebParam(targetNamespace = "http://namespace/request") SubmitBareRequest poRequest) + { + log.info("submitNamespacedPO: " + poRequest); + SubmitBareResponse poResponse = new SubmitBareResponse(poRequest.getProduct()); + return poResponse; + } +} Deleted: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocWrappedService.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocWrappedService.java 2006-07-05 09:22:32 UTC (rev 561) +++ trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/DocWrappedService.java 2006-07-05 10:55:12 UTC (rev 562) @@ -1,68 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listin... [truncated message content] |
From: <jbo...@li...> - 2006-07-05 10:54:36
|
Author: estebanschifman Date: 2006-07-05 06:54:32 -0400 (Wed, 05 Jul 2006) New Revision: 4912 Modified: labs/jbossesb/trunk/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbAbstractSqlProcessor.java Log: Remove DB connection constants - Must use those in SimpleDataSource Modified: labs/jbossesb/trunk/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbAbstractSqlProcessor.java =================================================================== --- labs/jbossesb/trunk/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbAbstractSqlProcessor.java 2006-07-05 10:44:49 UTC (rev 4911) +++ labs/jbossesb/trunk/ESBCore/processors/src/org/jboss/soa/esb/processors/EsbAbstractSqlProcessor.java 2006-07-05 10:54:32 UTC (rev 4912) @@ -40,10 +40,6 @@ protected abstract boolean handleTblRow (Properties p_opRow) throws Exception; protected abstract void wrapUp (EsbAbstractProcessor p_oProc) throws Exception; - public static final String QPARM_CONN_URL = "connection-url"; - public static final String QPARM_DRIVER = "driver-class"; - public static final String QPARM_USER = "user-name"; - public static final String QPARM_PASSWORD = "password"; public static final String QPARM_TABLE = "table"; public static final String QPARM_CONDITION = "condition"; public static final String QPARM_ORDER_BY = "orderBy"; @@ -91,10 +87,10 @@ protected void connectToDB() throws Exception { DataSource oDS = EsbAbstractProcessor.getDataSource - (m_oParms.getAttr(QPARM_DRIVER) - ,m_oParms.getAttr(QPARM_CONN_URL) - ,m_oParms.getAttr(QPARM_USER) - ,m_oParms.getAttr(QPARM_PASSWORD) + (m_oParms.getAttr(SimpleDataSource.DRIVER) + ,m_oParms.getAttr(SimpleDataSource.URL) + ,m_oParms.getAttr(SimpleDataSource.USER) + ,m_oParms.getAttr(SimpleDataSource.PASSWORD) ); m_oConn = new JdbcCleanConn(oDS); } //__________________________________ |
From: <jbo...@li...> - 2006-07-05 10:44:52
|
Author: estebanschifman Date: 2006-07-05 06:44:49 -0400 (Wed, 05 Jul 2006) New Revision: 4911 Added: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/ZZDummyProcessor.java Log: Dummy processor class that serves the purpose of helping test listeners Added: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/ZZDummyProcessor.java =================================================================== --- labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/ZZDummyProcessor.java 2006-07-05 10:43:42 UTC (rev 4910) +++ labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/ZZDummyProcessor.java 2006-07-05 10:44:49 UTC (rev 4911) @@ -0,0 +1,25 @@ +package org.jboss.soa.esb.listeners; + +import org.jboss.soa.esb.helpers.*; +import org.jboss.soa.esb.processors.*; + +public class ZZDummyProcessor extends EsbAbstractProcessor +{ + public ZZDummyProcessor(DomElement p_oParms) throws Exception + { super(p_oParms); + } + + @Override + public void execute() throws Exception + { + System.out.println(getClass().getName()+" " + + m_oParms.toString() + ); + } + + @Override + protected void checkParms() throws Exception + { + } + +} //____________________________________________________________________________ |
From: <jbo...@li...> - 2006-07-05 10:43:47
|
Author: estebanschifman Date: 2006-07-05 06:43:42 -0400 (Wed, 05 Jul 2006) New Revision: 4910 Added: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java Log: Class that can be configured to poll an SQL table for specific content, and trigger an action Class if conditions are met Added: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java =================================================================== --- labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java 2006-07-05 10:40:41 UTC (rev 4909) +++ labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java 2006-07-05 10:43:42 UTC (rev 4910) @@ -0,0 +1,426 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2006, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + + +package org.jboss.soa.esb.listeners; + +import java.util.*; +import java.lang.reflect.*; +import java.sql.*; +import javax.sql.*; + +import org.jboss.soa.esb.util.*; +import org.jboss.soa.esb.helpers.*; +import org.jboss.soa.esb.helpers.persist.*; +import org.jboss.soa.esb.processors.*; + +public class SqlTablePoller extends AbstractPoller +{ + /** + * These are the mandatory attributes needed for any SqlTablePoller + * 1) Table name + * 2) Comma separated list of fields needed in the ResultSet + * 3) Comma separated list of fields that constitute a unique ID of the working row + * all fields in this list MUST also be in the "selectFields" list + * these fields will be used in the "where" clause of update statements + * 4) Name of table field used as indicator/semaphore to avoid concurrent update + * + */ + public static enum TABLE_ATT + { + tableName + ,selectFields + ,keyFields + ,inProcessField + }; + + /** + * Optional fields that can be included in your parameter tree as attributes in the + * upper Element + * 1) 4 character long String that indicate status of each row for this poller + * 1st: Character that indicates "Pending" state = available for processing + * 2nd: "Working" : some poller is working on the row (or ab-ended while working) + * 3rd: "Error" : some poller tried to process, and found an error during processing + * 4th: "Done" : this row has already been processed successfully + * 2) if you wish to further filter your ResultSet, you can add an optional list of + * conditions that will be included in the "scan" SQL statement (without "where") + * 3) Comma separated list of fields to order ResultSet (without "order by") + * + */ + public static enum OPTIONAL_ATT + { + inProcessVals + ,whereCondition + ,orderBy + }; + + /** + * First character of these values are the default states of a table row trigger + * the "inProcessVals" parameter can override these (if that were ever necessary) + * this is why the default value for that parameter is "PWED" (see below) + * The poller will only process rows that have the "inProcessField" first character + * equal to the first character of whatever the "Pending" state is (typically "P") + * + */ + public static enum ROW_STATE + {Pending + ,Working + ,Error + ,Done + }; + public static final String DEFAULT_STATES = "PWED"; + + protected Map<String,String> m_oVals = new HashMap<String,String>(); + + /** + * Main program for SqlTablePoller + * @param args - String[] First parameter must be path to configuration XML file + * @throws Exception + */ + public static void main(String[] args) throws Exception + { + new SqlTablePoller(args[0]); + } //________________________________ + + + public SqlTablePoller(String p_sParamsUid) throws Exception + { + super(p_sParamsUid); + m_iDfltReloadMillis = 180000; + m_iDfltPollMillis = 20000; + m_iMinPollMillis = 5000; +// See superclass - It provides ability to request end by subscribing to a Topic + runUntilEndRequested(); + } //__________________________________ + + @Override + protected GroupOfChilds newChildGroup(ThreadGroup pThG) throws Exception + { + return new SqlPollerChildGroup(pThG); + } //__________________________________ + + private class SqlPollerChildGroup extends AbstractPoller.GroupOfChilds + { + JdbcCleanConn m_oConn; + String[] m_saKeys; + + private SqlPollerChildGroup(ThreadGroup p_oThrGrp) throws Exception + { super(p_oThrGrp); + } //________________________________ + + protected void checkAtt(DomElement p_oP,String p_sAtt, String p_sDefault) + throws Exception + { m_oVals.put(p_sAtt,obtainAtt(p_oP,p_sAtt,p_sDefault)); + } //________________________________ + + protected void checkParms(DomElement p_oP) throws Exception + { + super.checkParms(p_oP); + + checkAtt(p_oP,SimpleDataSource.DRIVER ,null); + checkAtt(p_oP,SimpleDataSource.URL ,null); + checkAtt(p_oP,SimpleDataSource.USER ,""); + checkAtt(p_oP,SimpleDataSource.PASSWORD ,""); + + for (TABLE_ATT oCurr : TABLE_ATT.values()) + checkAtt(p_oP,oCurr.toString(),null); + + checkAtt(p_oP,OPTIONAL_ATT.whereCondition.toString(),""); + checkAtt(p_oP,OPTIONAL_ATT.orderBy.toString(),""); + + String sAtt = OPTIONAL_ATT.inProcessVals.toString(); + checkAtt(p_oP,sAtt,DEFAULT_STATES); + String sStates = m_oVals.get(sAtt); + if (sStates.length()<4) + throw new Exception(formatLogMsg + ("Parameter <"+sAtt+"> must be at least 4 characters long (PWED)" + )); + + checkAtt(p_oP,PARM_ACTION_CLASS,null); + m_oExecClass = super.checkActionClass(m_oVals.get(PARM_ACTION_CLASS)); + + StringTokenizer ST = new StringTokenizer + (m_oVals.get(TABLE_ATT.selectFields.toString()),","); + Set<String> oSelFlds = new HashSet<String>(); + while (ST.hasMoreElements()) + oSelFlds.add(ST.nextToken().trim()); + + ST = new StringTokenizer + (m_oVals.get(TABLE_ATT.keyFields.toString()),","); + m_saKeys = new String[ST.countTokens()]; + if (m_saKeys.length < 1) + throw new Exception(formatLogMsg("Empty list of keyFields")); + + for (int iCurr = 0; ST.hasMoreTokens(); iCurr++) + { String sKey = ST.nextToken().trim(); + if (! oSelFlds.contains(sKey)) + throw new Exception(formatLogMsg("Key field <"+ sKey + "> must also be in select list")); + m_saKeys[iCurr] = sKey; + } + + } //________________________________ + + @Override + protected void doYourJob(DomElement p_oP) throws Exception + { + for (DomElement oCurr : getTriggers()) + { + if (m_iQthr >= m_iMaxThr) + { + m_oLogger.info(m_sb.append("Waiting for available threads").toString()); + Thread.sleep(5000); + break; + } + + new Thread(m_oThrGrp, + new SqlChildProcess(this, oCurr)).start(); + // Wait a little bit, so thread count will be updated + // at some point in the past, this sleep was indispensable + // new thread control classes in Java 5 should be explored + Thread.sleep(500); + } + + } //________________________________ + + protected List<DomElement> getTriggers() throws Exception + { + JdbcCleanConn oConn = newDbConn(); + String sScan = scanStatement(); + + PreparedStatement PS = oConn.prepareStatement(sScan); + ResultSet RS = oConn.execQueryWait(PS,1); + + ResultSetMetaData oMeta = RS.getMetaData(); + String[] saColName = new String[oMeta.getColumnCount()]; + for (int i1=0; i1<saColName.length; i1++) + saColName[i1] = oMeta.getColumnName(1+i1); + + List<DomElement> oResults = new ArrayList<DomElement>(); + while (RS.next()) + { DomElement oNew = new DomElement(EsbAbstractProcessor.PARMS_THIS_INSTANCE); + for (String sCurrCol : saColName) + oNew.setAttr(sCurrCol,RS.getString(sCurrCol)); + oResults.add(oNew); + } + oConn.release(); + + return oResults; + } //________________________________ + + /** + * Obtain a new database connection with parameter info + * @return A new connection + * @throws Exception - if problems are encountered + */ + protected JdbcCleanConn newDbConn() throws Exception + { DataSource oDS = new SimpleDataSource + (m_oVals.get(SimpleDataSource.DRIVER) + ,m_oVals.get(SimpleDataSource.URL) + ,m_oVals.get(SimpleDataSource.USER) + ,m_oVals.get(SimpleDataSource.PASSWORD) + ); + return new JdbcCleanConn(oDS); + } //________________________________ + + /** + * Assemble the SQL statement to scan (poll) the table + * @return - The resulting SQL statement + */ + protected String scanStatement() + { + StringBuilder sb = new StringBuilder () + .append("select ").append(m_oVals.get(TABLE_ATT.selectFields.toString())) + .append(" from ") .append(m_oVals.get(TABLE_ATT.tableName.toString())); + + String sAux = m_oVals.get(OPTIONAL_ATT.whereCondition.toString()); + boolean bWhere = ! EsbUtil.isNullString(sAux); + if (bWhere) + sb.append(" where ").append(sAux); + sb.append((bWhere) ? " and " : " where "); + + String sLike = m_oVals.get(OPTIONAL_ATT.inProcessVals.toString()) + .substring(0,1).toUpperCase(); + sb.append(" upper(").append(m_oVals.get(TABLE_ATT.inProcessField.toString())) + .append(") like '").append(sLike).append("%'"); + + + sAux = m_oVals.get(OPTIONAL_ATT.orderBy); + if (! EsbUtil.isNullString(sAux)) + sb.append(" order by ").append(sAux); + return sb.toString(); + } //________________________________ + + /** + * Assemble the SQL statement to update the field + * in the "inProcessField" parameter + * + * in the table row uniquely identified by the list of fields + * in the "keyFields" parameter + * + * @return - The resulting SQL statement + */ + protected String updateStatement() + { + StringBuilder sb = new StringBuilder () + .append("update ").append(m_oVals.get(TABLE_ATT.tableName.toString())) + .append(" set ") .append(m_oVals.get(TABLE_ATT.inProcessField.toString())) + .append(" = ? where ") + ; + int iCurr = 0; + for(String sCurr : m_saKeys) + { if (iCurr++ > 0) + sb.append(" and "); + sb.append(sCurr).append(" = ?"); + } + return sb.toString(); + } //________________________________ + + /** + * Assemble the SQL "select for update" statement + * for the "inProcessField" parameter + * + * in the table row uniquely identified by the list of fields + * in the "keyFields" parameter + * + * @return - The resulting SQL statement + */ + protected String selectForUpdStatement() + { + StringBuilder sb = new StringBuilder () + .append("select ").append(m_oVals.get(TABLE_ATT.inProcessField.toString())) + .append(" from ") .append(m_oVals.get(TABLE_ATT.tableName.toString())) + .append(" where ") + ; + int iCurr = 0; + for(String sCurr : m_saKeys) + { if (iCurr++ > 0) + sb.append(" and "); + sb.append(sCurr).append(" = ?"); + } + return sb.append(" for update").toString(); + } //________________________________ + + } //______________________________________________________ + + /** + * The child process group will try to start a new thread for each + * element in the ResultSet returned by the scanStatement() + * The controlling SqlPollerChildGroup will not start a thread if + * "maxThreads" is exceeded + * The idea is to obtain a new instance of the "actionClass" for each + * row of the resultSet + * Contents of the table field indicated by the "inProcessField" parameter are used + * to control concurrency (see enum ROW_STATE for details) + * + * @author Esteban + * + */ + protected class SqlChildProcess extends Observable implements Runnable + { + protected SqlPollerChildGroup m_oParent; // you can always go there for common stuff + protected DomElement m_oInstP; // values for this instance + protected JdbcCleanConn m_oConn; // each child has it's own DB connection + protected PreparedStatement m_PSsel4U ,m_PSupd; + protected String m_sUpdStates; + protected String getStatus(ROW_STATE p_oState) + { int iPos = p_oState.ordinal(); + return m_sUpdStates.substring(iPos,++iPos); + } //________________________________ + + public SqlChildProcess(SqlPollerChildGroup p_oGrp, DomElement p_oP) + throws Exception + { + m_oParent = p_oGrp; + this.addObserver(m_oParent); + setChanged(); + notifyObservers(new Integer(1)); + + m_oInstP = p_oP; + m_oConn = p_oGrp.newDbConn(); + m_sUpdStates = m_oVals.get(OPTIONAL_ATT.inProcessVals.toString()); + } //__________________________________ + + public void run() + { + try + { m_PSsel4U = m_oConn.prepareStatement(m_oParent.selectForUpdStatement()); + m_PSupd = m_oConn.prepareStatement(m_oParent.updateStatement()); + + int iParm=1; + for (String sCurr : m_oParent.m_saKeys) + { String sVal = m_oInstP.getAttr(sCurr); + m_PSsel4U.setString (iParm ,sVal); + // parameters are +1 in update statement + // autoincrement leaves things ready for next SQL parameter + m_PSupd.setString (++iParm,sVal); + } + if (! changeStatus(ROW_STATE.Pending,ROW_STATE.Working)) + return; + } + catch (Exception e) + { m_oLogger.error("Problems with update statements",e); + return; + } + + try + { + Constructor oCnst = m_oParent.m_oExecClass + .getConstructor (new Class[] {DomElement.class}); + DomElement oParms = m_oParent.m_oChParms.cloneObj(); + oParms.addElemChild(m_oInstP); + Object oInst = oCnst.newInstance (new Object[] {oParms}); + ((EsbAbstractProcessor)oInst).execute(); + } + catch (Exception e) + { m_oLogger.error("run() FAILED",e); + } + + finally + { if (null!=m_oConn) + m_oConn.release(); + } + + setChanged(); + notifyObservers(new Integer(-1)); + } //______________________________ + + private boolean changeStatus (ROW_STATE pFrom, ROW_STATE pTo) throws Exception + { ResultSet RS = m_oConn.execQueryWait(m_PSsel4U,5); + if (! RS.next()) + return false; + if (null!=pFrom) + { String sOldStatus = RS.getString(1).substring(0,1); + if (!sOldStatus.equalsIgnoreCase(getStatus(pFrom))) + { m_oConn.rollback(); + return false; + } + } + m_PSupd.setString(1,getStatus(pTo)); + m_oConn.execUpdWait(m_PSupd,5); + m_oConn.commit(); + + return true; + } //______________________________ + + } //______________________________________________________ + +} //____________________________________________________________________________ |
From: <jbo...@li...> - 2006-07-05 10:40:45
|
Author: estebanschifman Date: 2006-07-05 06:40:41 -0400 (Wed, 05 Jul 2006) New Revision: 4909 Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/AbstractPoller.java Log: Update with changes made while the SVN repository was restructured Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/AbstractPoller.java =================================================================== --- labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/AbstractPoller.java 2006-07-05 10:40:08 UTC (rev 4908) +++ labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/AbstractPoller.java 2006-07-05 10:40:41 UTC (rev 4909) @@ -23,7 +23,6 @@ package org.jboss.soa.esb.listeners; -import java.lang.reflect.Constructor; import java.util.*; import org.apache.log4j.*; @@ -35,7 +34,7 @@ import org.jboss.soa.esb.common.*; import org.jboss.soa.esb.helpers.*; import org.jboss.soa.esb.parameters.*; -import org.jboss.soa.esb.processors.EsbFileProcessor; +import org.jboss.soa.esb.processors.EsbAbstractProcessor; public abstract class AbstractPoller { @@ -151,7 +150,7 @@ protected String formatLogMsg(String p_s) { return new StringBuilder("Processor '") .append(EsbUtil.classSuffix(this.getClass())).append("' <") - .append(p_s).append("") + .append(p_s).append(">") .toString(); } //__________________________________ @@ -265,6 +264,18 @@ } } //_________________________________________ + protected String obtainAtt(DomElement p_oP, String p_sAtt, String p_sDefault) + throws Exception + { + String sVal = p_oP.getAttr(p_sAtt); + if (null==sVal) + sVal = p_sDefault; + if (EsbUtil.isNullString(sVal) && (null==p_sDefault)) + throw new Exception(formatLogMsg("Missing or invalid <"+p_sAtt+"> attribute")); + + return sVal; + } //________________________________ + protected abstract class GroupOfChilds implements Observer { protected abstract void doYourJob(DomElement p_oP) throws Exception; @@ -325,6 +336,22 @@ } //________________________________ + protected Class checkActionClass(String p_sName) throws Exception + { + Class oCls; + try { oCls = Class.forName(p_sName); } + catch (ClassNotFoundException e) + { throw new Exception(formatLogMsg("Class "+p_sName + +" not found in classpath")); + } + try { oCls.getConstructor(new Class[] {DomElement.class}); } + catch (NoSuchMethodException eN) + { throw new Exception(formatLogMsg("No appropriate constructor " + +p_sName+"(DomElement) found for class ")); + } + return oCls; + } //_________________________________________ + // Very basic checkParms method // Remember to call super.checkParms(p_oP) in derived checkParms() methods // so your parameters will be cloned @@ -333,35 +360,10 @@ { m_sb.setLength(m_iSbIni); m_oChParms = p_oP.cloneObj(); + m_oChParms.rmvChildsByName(EsbAbstractProcessor.PARMS_THIS_INSTANCE); setMaxThreads(p_oP,10); } //________________________________ } //______________________________________________________ - protected static class ChildProcess extends Observable implements Runnable - { private Class m_oExecClass; - private DomElement m_oParms; - private Logger m_oLogger; - public ChildProcess(Class p_oExec, Observer p_oObs, DomElement p_oP) - { m_oLogger = EsbUtil.getDefaultLogger(this.getClass()); - m_oExecClass = p_oExec; - this.addObserver(p_oObs); - m_oParms = p_oP; - setChanged(); - notifyObservers(new Integer(1)); - } //__________________________________ - - public void run() - { try - { Constructor oCnst = m_oExecClass.getConstructor(new Class[] {DomElement.class}); - Object oProc = oCnst.newInstance(new Object[] {m_oParms}); - ((EsbFileProcessor)oProc).execute(); - } - catch (Exception e) { m_oLogger.error("run() FAILED",e); } - - setChanged(); - notifyObservers(new Integer(-1)); - } //__________________________________ - } //______________________________________________________ - } //____________________________________________________________________________ |
From: <jbo...@li...> - 2006-07-05 10:40:13
|
Author: estebanschifman Date: 2006-07-05 06:40:08 -0400 (Wed, 05 Jul 2006) New Revision: 4908 Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/BetterDirListener.java Log: Update with changes made while the SVN repository was restructured Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/BetterDirListener.java =================================================================== --- labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/BetterDirListener.java 2006-07-05 10:16:58 UTC (rev 4907) +++ labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/BetterDirListener.java 2006-07-05 10:40:08 UTC (rev 4908) @@ -24,7 +24,12 @@ package org.jboss.soa.esb.listeners; import java.io.*; +import java.lang.reflect.Constructor; import java.net.*; +import java.util.Observable; +import java.util.Observer; + +import org.apache.log4j.Logger; import org.jboss.soa.esb.util.*; import org.jboss.soa.esb.helpers.*; import org.jboss.soa.esb.processors.*; @@ -83,7 +88,7 @@ m_oChParms.addElemChild(oThisProc); new Thread(m_oThrGrp, - new ChildProcess(m_oExecClass, this, m_oChParms)).start(); + new FileChildProcess(m_oExecClass, this, m_oChParms)).start(); Thread.sleep(500); } } //________________________________ @@ -120,35 +125,15 @@ m_oFFilt = new FileEndsWith(sAtt); - do - { - sAtt = p_oP.getAttr(PARM_FILE_PROCESSOR_CLASS); - m_oExecClass = null; - if (null == sAtt) - { throw new Exception(formatLogMsg( - m_sb.append("Missing fileProcessorClass attribute"). - toString())); - } - try - { - m_oExecClass = Class.forName(sAtt); - } - catch (ClassNotFoundException e) - { throw new Exception(formatLogMsg( - m_sb.append("Class ").append(sAtt) - .append(" not found in classpath").toString())); - } - try - { - m_oExecClass.getConstructor(new Class[] {DomElement.class}); - } - catch (NoSuchMethodException eN) - { throw new Exception(formatLogMsg( - m_sb.append("No appropriate constructor") - .append(" (DomElement) found for class").toString())); - } + sAtt = p_oP.getAttr(PARM_FILE_PROCESSOR_CLASS); + m_oExecClass = null; + if (null == sAtt) + { throw new Exception(formatLogMsg( + m_sb.append("Missing fileProcessorClass attribute"). + toString())); } - while (false); + m_oExecClass = super.checkActionClass(sAtt); + } //________________________________ @@ -170,4 +155,30 @@ } //___________________________________________________ } //______________________________________________________ + protected static class FileChildProcess extends Observable implements Runnable + { private Class m_oExecClass; + private DomElement m_oParms; + private Logger m_oLogger; + public FileChildProcess(Class p_oExec, Observer p_oObs, DomElement p_oP) + { m_oLogger = EsbUtil.getDefaultLogger(this.getClass()); + m_oExecClass = p_oExec; + this.addObserver(p_oObs); + m_oParms = p_oP; + setChanged(); + notifyObservers(new Integer(1)); + } //__________________________________ + + public void run() + { try + { Constructor oCnst = m_oExecClass.getConstructor(new Class[] {DomElement.class}); + Object oProc = oCnst.newInstance(new Object[] {m_oParms}); + ((EsbFileProcessor)oProc).execute(); + } + catch (Exception e) { m_oLogger.error("run() FAILED",e); } + + setChanged(); + notifyObservers(new Integer(-1)); + } //__________________________________ + } //______________________________________________________ + } //____________________________________________________________________________ |
From: <jbo...@li...> - 2006-07-05 10:17:01
|
Author: mar...@jb... Date: 2006-07-05 06:16:58 -0400 (Wed, 05 Jul 2006) New Revision: 4907 Added: labs/jbossesb/trunk/ESBCore/Tests/realbuild.xml Log: Added: labs/jbossesb/trunk/ESBCore/Tests/realbuild.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/Tests/realbuild.xml 2006-07-05 10:03:27 UTC (rev 4906) +++ labs/jbossesb/trunk/ESBCore/Tests/realbuild.xml 2006-07-05 10:16:58 UTC (rev 4907) @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<project name="BuildEsbTests" default="org.jboss.esb.tests.compile" basedir="."> + + <property name="org.jboss.esb.tests.bin.dir" value="${org.jboss.esb.internal.dest}/tests"/> + <property name="org.jboss.esb.core.bin.dir" value="${org.jboss.esb.internal.dest}/classes"/> + <property name="org.jboss.esb.tests.src.dir" value="${basedir}/src"/> + <property name="org.jboss.esb.root.dir" value="../.."/> + <property environment="env"/> + + <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <path id="org.jboss.esb.tests.base.classpath"> + <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> + <pathelement location="${org.jboss.esb.core.bin.dir}"/> + </path> + + <target name="org.jboss.esb.tests.init"> + <tstamp> + <format property="TODAY" pattern="d-MM-yy"/> + </tstamp> + + <mkdir dir="${org.jboss.esb.tests.bin.dir}"/> + </target> + + <target name="clean"/> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.tests.bin.dir}"/> + </target> + + <target name="org.jboss.esb.tests.compile" if="org.jboss.esb.buildtests" depends="org.jboss.esb.tests.init"> + + <javac + destdir="${org.jboss.esb.tests.bin.dir}" + classpathref="org.jboss.esb.tests.base.classpath" + debug="${org.jboss.esb.debug}" + optimize="${org.jboss.esb.optimize}" + > + <src path="${org.jboss.esb.tests.src.dir}"/> + </javac> + + </target> + +</project> Property changes on: labs/jbossesb/trunk/ESBCore/Tests/realbuild.xml ___________________________________________________________________ Name: svn:executable + * |
From: <jbo...@li...> - 2006-07-05 10:04:35
|
Author: mar...@jb... Date: 2006-07-05 06:03:27 -0400 (Wed, 05 Jul 2006) New Revision: 4906 Added: labs/jbossesb/trunk/Build.txt labs/jbossesb/trunk/ESBCore/common/ labs/jbossesb/trunk/ESBCore/common/ant.bat labs/jbossesb/trunk/ESBCore/common/build.xml labs/jbossesb/trunk/ESBCore/common/src/ labs/jbossesb/trunk/ESBCore/listeners/ labs/jbossesb/trunk/ESBCore/listeners/ant.bat labs/jbossesb/trunk/ESBCore/listeners/build.xml labs/jbossesb/trunk/ESBCore/listeners/src/ labs/jbossesb/trunk/ESBCore/processors/ labs/jbossesb/trunk/ESBCore/processors/ant.bat labs/jbossesb/trunk/ESBCore/processors/build.xml labs/jbossesb/trunk/ESBCore/processors/src/ labs/jbossesb/trunk/ESBCore/services/ labs/jbossesb/trunk/ESBCore/services/ant.bat labs/jbossesb/trunk/ESBCore/services/build.xml labs/jbossesb/trunk/ESBCore/services/src/ labs/jbossesb/trunk/build.xml labs/jbossesb/trunk/docs/ labs/jbossesb/trunk/docs/Install/ labs/jbossesb/trunk/docs/JBossESB Getting Started Guide.doc labs/jbossesb/trunk/docs/samples/ labs/jbossesb/trunk/lib/ext/Licenses.txt labs/jbossesb/trunk/lib/ext/README.txt labs/jbossesb/trunk/lib/ext/activation.jar labs/jbossesb/trunk/lib/ext/commons-collections-2.0.jar labs/jbossesb/trunk/lib/ext/commons-logging.jar labs/jbossesb/trunk/lib/ext/jboss-jmx.jar labs/jbossesb/trunk/lib/ext/jbossall-client.jar labs/jbossesb/trunk/lib/ext/log4j.jar labs/jbossesb/trunk/lib/ext/mail.jar labs/jbossesb/trunk/lib/ext/xdoclet-1.2.3.jar labs/jbossesb/trunk/lib/ext/xdoclet-ejb-module-1.2.3.jar labs/jbossesb/trunk/lib/ext/xdoclet-jboss-module-1.2.3.jar labs/jbossesb/trunk/lib/ext/xdoclet-jmx-module-1.2.3.jar labs/jbossesb/trunk/lib/ext/xdoclet-web-module-1.2.3.jar labs/jbossesb/trunk/lib/ext/xjavadoc-1.1.jar labs/jbossesb/trunk/product.properties Removed: labs/jbossesb/trunk/ESBCore/EsbCommon/ labs/jbossesb/trunk/ESBCore/EsbListeners/ labs/jbossesb/trunk/ESBCore/EsbProcessors/ labs/jbossesb/trunk/ESBCore/EsbServices/ labs/jbossesb/trunk/ESBCore/common/ant.bat labs/jbossesb/trunk/ESBCore/common/build.xml labs/jbossesb/trunk/ESBCore/common/src/ labs/jbossesb/trunk/ESBCore/docs/ labs/jbossesb/trunk/ESBCore/listeners/ant.bat labs/jbossesb/trunk/ESBCore/listeners/build.xml labs/jbossesb/trunk/ESBCore/listeners/src/ labs/jbossesb/trunk/ESBCore/processors/ant.bat labs/jbossesb/trunk/ESBCore/processors/build.xml labs/jbossesb/trunk/ESBCore/processors/src/ labs/jbossesb/trunk/ESBCore/services/ant.bat labs/jbossesb/trunk/ESBCore/services/build.xml labs/jbossesb/trunk/ESBCore/services/buildOne.xml labs/jbossesb/trunk/ESBCore/services/src/ labs/jbossesb/trunk/build.xml.root labs/jbossesb/trunk/docs/Install/ labs/jbossesb/trunk/docs/JBossESB Getting Started Guide.doc labs/jbossesb/trunk/docs/samples/ Modified: labs/jbossesb/trunk/ESBCore/build.xml labs/jbossesb/trunk/ESBCore/services/src/META-INF/application.xml labs/jbossesb/trunk/ESBCore/services/src/META-INF/manifest.server labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandler.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerHome.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocal.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocalHome.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandler.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerHome.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocal.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocalHome.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandler.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerHome.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocal.java labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocalHome.java labs/jbossesb/trunk/Readme.txt labs/jbossesb/trunk/docs/Install/README.TXT labs/jbossesb/trunk/docs/samples/testJBossESB.bat Log: JBESB-51 changes. Added: labs/jbossesb/trunk/Build.txt =================================================================== --- labs/jbossesb/trunk/Build.txt 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/Build.txt 2006-07-05 10:03:27 UTC (rev 4906) @@ -0,0 +1,5 @@ +Use the root build.xml in conjuntion with product.properties, where various properties used +in the build can be set for convenience. The lib/ext directory contains the most recently tested +libs needed to build the system. You are free to use these, or your own versions of the jars +from a JBossAS 4.0.3SP1 installation. If the latter, then set org.jboss.esb.frominstall to true +and org.jboss.esb.jboss.home to the root of your JBossAS installation. \ No newline at end of file Modified: labs/jbossesb/trunk/ESBCore/build.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/build.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -4,15 +4,15 @@ <!-- build.xml - Builds all subprojects in child directories --> <!-- =================================================================== --> -<project name="JbossEsb" default="compile" basedir="."> +<project name="JbossEsb" default="org.jboss.esb.core.compile" basedir="."> - <property name="name.jar" value="name.jar-NOT_SET.jar"/> + <property name="org.jboss.esb.core.name.jar" value="name.jar-NOT_SET.jar"/> <property environment="env"/> <!-- =================================================================== --> <!-- Initialize --> <!-- =================================================================== --> - <target name="init"> + <target name="org.jboss.esb.core.init"> <tstamp> <format property="TODAY" pattern="d-MM-yy"/> </tstamp> @@ -21,44 +21,41 @@ <!-- =================================================================== --> <!-- Prepares the directory structure --> <!-- =================================================================== --> - <target name="prepare" depends="init"> - <mkdir dir="dist"/> - <mkdir dir="lib"/> + <target name="org.jboss.esb.core.prepare" depends="org.jboss.esb.core.init"> + <mkdir dir="${org.jboss.esb.internal.dest}/dist"/> + <mkdir dir="${org.jboss.esb.internal.dest}/lib"/> </target> <!-- =================================================================== --> <!-- Compiles all the classes --> <!-- =================================================================== --> - <target name="compile" depends="prepare" description="Compile subprojects"> - <subant target="compile"> - <property name="name.jar" value="${name.jar}"/> - <fileset file="EsbCommon/build.xml"/> - <fileset file="EsbServices/build.xml"/> - <fileset file="EsbProcessors/build.xml"/> - <fileset file="EsbListeners/build.xml"/> - </subant> + <target name="org.jboss.esb.core.compile" depends="org.jboss.esb.core.prepare" description="Compile subprojects"> + <echo message="Compiling submodules"/> + <ant dir="common"/> + <ant dir="services"/> + <ant dir="processors"/> + <ant dir="listeners"/> + <ant dir="tests"/> </target> <!-- =================================================================== --> <!-- Assemble jars --> <!-- =================================================================== --> - <target name="jar" depends="compile" description="arma los jars"> - <subant target="jar"> - <!-- Always services as last jar --> - <fileset dir="." includes="*/build.xml" - excludes="EsbServices/*" - /> - <fileset file="EsbServices/build.xml"/> - </subant> + <target name="jar" depends="org.jboss.esb.core.compile" description="arma los jars"> + <echo message="Building jar"/> + <ant dir="common" target="jar"/> + <ant dir="listeners" target="jar"/> + <ant dir="processors" target="jar"/> + <ant dir="services" target="jar"/> <antcall target="-ear"/> </target> <target name="-ear"> - <ear destfile="dist/JbossEsbAppl.ear" - appxml="EsbServices/src/META-INF/application.xml" + <ear destfile="${org.jboss.esb.internal.dest}/dist/jbossesb-appl.ear" + appxml="services/src/META-INF/application.xml" > - <fileset dir="dist" + <fileset dir="${org.jboss.esb.internal.dest}/dist" includes="*.jar" /> </ear> @@ -68,17 +65,28 @@ <!-- =================================================================== --> <!-- Clean all --> <!-- =================================================================== --> - <target name="clean" description="Clean dist directory, and cleans subprojects"> - <subant target="clean"> - <fileset dir="." includes="*/build.xml" /> - </subant> - <delete dir="dist" /> + <target name="clean" description="Clean dist directory and cleans subprojects"> + <ant dir="common" target="clean"/> + <ant dir="listeners" target="clean"/> + <ant dir="processors" target="clean"/> + <ant dir="services" target="clean"/> + <ant dir="tests" target="clean"/> </target> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.internal.dest}/dist"/> + + <ant dir="common" target="purge"/> + <ant dir="listeners" target="purge"/> + <ant dir="processors" target="purge"/> + <ant dir="services" target="purge"/> + <ant dir="tests" target="purge"/> + </target> <!-- =================================================================== --> <!-- Rebuild everything from scratch --> <!-- =================================================================== --> <target name="all" depends="clean,jar" /> - <target name="recompile" depends="clean,compile" /> + <target name="recompile" depends="clean,org.jboss.esb.core.compile" /> </project> Copied: labs/jbossesb/trunk/ESBCore/common (from rev 4901, labs/jbossesb/trunk/ESBCore/EsbCommon) Deleted: labs/jbossesb/trunk/ESBCore/common/ant.bat =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbCommon/ant.bat 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/common/ant.bat 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,12 +0,0 @@ -@echo off -set ANT_CMD_LINE_ARGS=%1 -if ""%1""=="""" goto doneStart -shift -:setupArgs -if ""%1""=="""" goto doneStart -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs -:doneStart -%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS% - Copied: labs/jbossesb/trunk/ESBCore/common/ant.bat (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbCommon/ant.bat) Deleted: labs/jbossesb/trunk/ESBCore/common/build.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbCommon/build.xml 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/common/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,57 +0,0 @@ -<?xml version="1.0"?> -<project name="BuildJbossEsbCommon" default="compile" basedir="."> - - <property name="jar.name" value="jboss_esb_common"/> - <property name="distrib.dir" value="../dist"/> - <property name="bin.dir" value="${basedir}/bin"/> - <property name="src.dir" value="${basedir}/src"/> - <property environment="env"/> - - <path id="base.class.path"> - <fileset dir="${env.JBOSS_HOME}/client" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> - </path> - - <target name="init"> - <tstamp> - <format property="TODAY" pattern="d-MM-yy"/> - </tstamp> - </target> - - <target name="prepare" depends="init"> - <mkdir dir="${bin.dir}"/> - <mkdir dir="${distrib.dir}"/> - </target> - - <target name="clean" description="Remove bin directory"> - <delete dir="${bin.dir}"/> - </target> - - <target name="compile" depends="prepare" - description="Compile all classes"> - - <javac - destdir="${bin.dir}" - classpathref="base.class.path" - debug="on" - optimize="off" - > - <src path="${src.dir}"/> - </javac> - - </target> - - <target name="recompile" depends="clean,compile" - description="Clean and compile"/> - - <target name="jar" depends="compile" description="Assemble jar files"> - <delete file="${distrib.dir}/${jar.name}.jar" /> - <jar destfile="${distrib.dir}/${jar.name}.jar" - basedir="${bin.dir}" - includes="**/*.class" - excludes="test/**" - /> - </target> - - <target name="all" depends="recompile,jar" /> - -</project> Copied: labs/jbossesb/trunk/ESBCore/common/build.xml (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbCommon/build.xml) =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbCommon/build.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/common/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -0,0 +1,66 @@ +<?xml version="1.0"?> +<project name="BuildJbossEsbCommon" default="org.jboss.esb.common.compile" basedir="."> + + <property name="org.jboss.esb.common.jar.name" value="jbossesb-common"/> + <property name="org.jboss.esb.common.distrib.dir" value="${org.jboss.esb.internal.dest}/dist"/> + <property name="org.jboss.esb.common.bin.dir" value="${org.jboss.esb.internal.dest}/classes"/> + <property name="org.jboss.esb.common.src.dir" value="${basedir}/src"/> + <property name="org.jboss.esb.root.dir" value="../.."/> + <property environment="env"/> + + <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <path id="org.jboss.esb.common.base.classpath"> + <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> + </path> + + <target name="org.jboss.esb.common.init"> + <tstamp> + <format property="TODAY" pattern="d-MM-yy"/> + </tstamp> + </target> + + <target name="org.jboss.esb.common.prepare" depends="org.jboss.esb.common.init"> + <mkdir dir="${org.jboss.esb.common.bin.dir}"/> + <mkdir dir="${org.jboss.esb.common.distrib.dir}"/> + </target> + + <target name="clean" description="Remove bin directory"> + </target> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.common.bin.dir}"/> + </target> + + <target name="org.jboss.esb.common.compile" depends="org.jboss.esb.common.prepare" + description="Compile all classes"> + + <javac + destdir="${org.jboss.esb.common.bin.dir}" + classpathref="org.jboss.esb.common.base.classpath" + debug="${org.jboss.esb.debug}" + optimize="${org.jboss.esb.optimize}" + > + <src path="${org.jboss.esb.common.src.dir}"/> + </javac> + + </target> + + <target name="recompile" depends="clean,org.jboss.esb.common.compile" + description="Clean and compile"/> + + <target name="jar" depends="org.jboss.esb.common.compile" description="Assemble jar files"> + <delete file="${org.jboss.esb.common.distrib.dir}/${org.jboss.esb.common.jar.name}.jar" /> + <jar destfile="${org.jboss.esb.common.distrib.dir}/${org.jboss.esb.common.jar.name}.jar" + basedir="${org.jboss.esb.common.bin.dir}" + includes="**/*.class" + excludes="test/**" + /> + </target> + + <target name="all" depends="recompile,jar" /> + +</project> Copied: labs/jbossesb/trunk/ESBCore/common/src (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbCommon/src) Copied: labs/jbossesb/trunk/ESBCore/listeners (from rev 4901, labs/jbossesb/trunk/ESBCore/EsbListeners) Deleted: labs/jbossesb/trunk/ESBCore/listeners/ant.bat =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbListeners/ant.bat 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/listeners/ant.bat 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,12 +0,0 @@ -@echo off -set ANT_CMD_LINE_ARGS=%1 -if ""%1""=="""" goto doneStart -shift -:setupArgs -if ""%1""=="""" goto doneStart -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs -:doneStart -%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS% - Copied: labs/jbossesb/trunk/ESBCore/listeners/ant.bat (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbListeners/ant.bat) Deleted: labs/jbossesb/trunk/ESBCore/listeners/build.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbListeners/build.xml 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/listeners/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,64 +0,0 @@ -<?xml version="1.0"?> -<project name="BuildJbossEsbListeners" default="compile" basedir="."> - - <property name="jar.name" value="jboss_esb_listeners"/> - <property name="distrib.dir" value="../dist"/> - <property name="bin.dir" value="${basedir}/bin"/> - <property name="src.dir" value="${basedir}/src"/> - <property environment="env"/> - - <path id="base.class.path"> - <fileset dir="${env.JBOSS_HOME}/client" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> - </path> - - <path id="default.class.path"> - <path refid="base.class.path"/> - <pathelement location="../EsbCommon/bin"/> - <pathelement location="../EsbServices/bin"/> - <pathelement location="../EsbProcessors/bin"/> - </path> - - <target name="init"> - <tstamp> - <format property="TODAY" pattern="d-MM-yy"/> - </tstamp> - </target> - - <target name="prepare" depends="init"> - <mkdir dir="${bin.dir}"/> - <mkdir dir="${distrib.dir}"/> - </target> - - <target name="clean" description="Remove bin directory"> - <delete dir="${bin.dir}"/> - </target> - - <target name="compile" depends="prepare" - description="Compile all classes"> - - <javac - destdir="${bin.dir}" - classpathref="default.class.path" - debug="on" - optimize="off" - > - <src path="${src.dir}"/> - </javac> - - </target> - - <target name="recompile" depends="clean,compile" - description="Clean and compile"/> - - <target name="jar" depends="compile" description="Assemble jar files"> - <delete file="${distrib.dir}/${jar.name}.jar" /> - <jar destfile="${distrib.dir}/${jar.name}.jar" - basedir="${bin.dir}" - includes="**/*.class" - excludes="test/**" - /> - </target> - - <target name="all" depends="recompile,jar" /> - -</project> Copied: labs/jbossesb/trunk/ESBCore/listeners/build.xml (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbListeners/build.xml) =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbListeners/build.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/listeners/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<project name="BuildJbossEsbListeners" default="org.jboss.esb.listeners.compile" basedir="."> + + <property name="org.jboss.esb.listeners.jar.name" value="jbossesb-listeners"/> + <property name="org.jboss.esb.listeners.distrib.dir" value="${org.jboss.esb.internal.dest}/dist"/> + <property name="org.jboss.esb.listeners.bin.dir" value="${org.jboss.esb.internal.dest}/classes"/> + <property name="org.jboss.esb.listeners.src.dir" value="${basedir}/src"/> + <property name="org.jboss.esb.root.dir" value="../.."/> + <property environment="env"/> + + <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <path id="org.jboss.esb.listeners.base.classpath"> + <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> + </path> + + <path id="org.jboss.esb.listeners.default.classpath"> + <path refid="org.jboss.esb.listeners.base.classpath"/> + <pathelement location="${org.jboss.esb.internal.dest}/classes"/> + </path> + + <target name="org.jboss.esb.listeners.init"> + <tstamp> + <format property="TODAY" pattern="d-MM-yy"/> + </tstamp> + </target> + + <target name="org.jboss.esb.listeners.prepare" depends="org.jboss.esb.listeners.init"> + <mkdir dir="${org.jboss.esb.listeners.bin.dir}"/> + <mkdir dir="${org.jboss.esb.listeners.distrib.dir}"/> + </target> + + <target name="clean" description="Remove bin directory"> + </target> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.listeners.bin.dir}"/> + </target> + + <target name="org.jboss.esb.listeners.compile" depends="org.jboss.esb.listeners.prepare" + description="Compile all classes"> + + <javac + destdir="${org.jboss.esb.listeners.bin.dir}" + classpathref="org.jboss.esb.listeners.default.classpath" + debug="${org.jboss.esb.debug}" + optimize="${org.jboss.esb.optimize}" + > + <src path="${org.jboss.esb.listeners.src.dir}"/> + </javac> + + </target> + + <target name="recompile" depends="clean,org.jboss.esb.listeners.compile" + description="Clean and compile"/> + + <target name="jar" depends="org.jboss.esb.listeners.compile" description="Assemble jar files"> + <delete file="${org.jboss.esb.listeners.distrib.dir}/${org.jboss.esb.listeners.jar.name}.jar" /> + <jar destfile="${org.jboss.esb.listeners.distrib.dir}/${org.jboss.esb.listeners.jar.name}.jar" + basedir="${org.jboss.esb.listeners.bin.dir}" + includes="**/*.class" + excludes="test/**" + /> + </target> + + <target name="all" depends="recompile,jar" /> + +</project> Copied: labs/jbossesb/trunk/ESBCore/listeners/src (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbListeners/src) Copied: labs/jbossesb/trunk/ESBCore/processors (from rev 4901, labs/jbossesb/trunk/ESBCore/EsbProcessors) Deleted: labs/jbossesb/trunk/ESBCore/processors/ant.bat =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbProcessors/ant.bat 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/processors/ant.bat 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,12 +0,0 @@ -@echo off -set ANT_CMD_LINE_ARGS=%1 -if ""%1""=="""" goto doneStart -shift -:setupArgs -if ""%1""=="""" goto doneStart -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs -:doneStart -%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS% - Copied: labs/jbossesb/trunk/ESBCore/processors/ant.bat (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbProcessors/ant.bat) Deleted: labs/jbossesb/trunk/ESBCore/processors/build.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbProcessors/build.xml 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/processors/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,63 +0,0 @@ -<?xml version="1.0"?> -<project name="BuildJbossEsbProcessors" default="compile" basedir="."> - - <property name="jar.name" value="jboss_esb_processors"/> - <property name="distrib.dir" value="../dist"/> - <property name="bin.dir" value="${basedir}/bin"/> - <property name="src.dir" value="${basedir}/src"/> - <property environment="env"/> - - <path id="base.class.path"> - <fileset dir="${env.JBOSS_HOME}/client" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> - </path> - - <path id="default.class.path"> - <path refid="base.class.path"/> - <pathelement location="../EsbCommon/bin"/> - <pathelement location="../EsbServices/bin"/> - </path> - - <target name="init"> - <tstamp> - <format property="TODAY" pattern="d-MM-yy"/> - </tstamp> - </target> - - <target name="prepare" depends="init"> - <mkdir dir="${bin.dir}"/> - <mkdir dir="${distrib.dir}"/> - </target> - - <target name="clean" description="Remove bin directory"> - <delete dir="${bin.dir}"/> - </target> - - <target name="compile" depends="prepare" - description="Compile all classes"> - - <javac - destdir="${bin.dir}" - classpathref="default.class.path" - debug="on" - optimize="off" - > - <src path="${src.dir}"/> - </javac> - - </target> - - <target name="recompile" depends="clean,compile" - description="Clean and compile"/> - - <target name="jar" depends="compile" description="Assemble jar files"> - <delete file="${distrib.dir}/${jar.name}.jar" /> - <jar destfile="${distrib.dir}/${jar.name}.jar" - basedir="${bin.dir}" - includes="**/*.class" - excludes="test/**" - /> - </target> - - <target name="all" depends="recompile,jar" /> - -</project> Copied: labs/jbossesb/trunk/ESBCore/processors/build.xml (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbProcessors/build.xml) =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbProcessors/build.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/processors/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -0,0 +1,71 @@ +<?xml version="1.0"?> +<project name="BuildJbossEsbProcessors" default="org.jboss.esb.processors.compile" basedir="."> + + <property name="org.jboss.esb.processors.jar.name" value="jbossesb-processors"/> + <property name="org.jboss.esb.processors.distrib.dir" value="${org.jboss.esb.internal.dest}/dist"/> + <property name="org.jboss.esb.processors.bin.dir" value="${org.jboss.esb.internal.dest}/classes"/> + <property name="org.jboss.esb.processors.src.dir" value="${basedir}/src"/> + <property name="org.jboss.esb.root.dir" value="../.."/> + <property environment="env"/> + + <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <path id="org.jboss.esb.processors.base.classpath"> + <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="activation.jar jbossall-client.jar log4j.jar mail.jar"/> + </path> + + <path id="org.jboss.esb.processors.default.classpath"> + <path refid="org.jboss.esb.processors.base.classpath"/> + <pathelement location="${org.jboss.esb.internal.dest}/classes"/> + </path> + + <target name="org.jboss.esb.processors.init"> + <tstamp> + <format property="TODAY" pattern="d-MM-yy"/> + </tstamp> + </target> + + <target name="org.jboss.esb.processors.prepare" depends="org.jboss.esb.processors.init"> + <mkdir dir="${org.jboss.esb.processors.bin.dir}"/> + <mkdir dir="${org.jboss.esb.processors.distrib.dir}"/> + </target> + + <target name="clean" description="Remove bin directory"> + </target> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.processors.bin.dir}"/> + </target> + + <target name="org.jboss.esb.processors.compile" depends="org.jboss.esb.processors.prepare" + description="Compile all classes"> + + <javac + destdir="${org.jboss.esb.processors.bin.dir}" + classpathref="org.jboss.esb.processors.default.classpath" + debug="${org.jboss.esb.debug}" + optimize="${org.jboss.esb.optimize}" + > + <src path="${org.jboss.esb.processors.src.dir}"/> + </javac> + + </target> + + <target name="recompile" depends="clean,org.jboss.esb.processors.compile" + description="Clean and compile"/> + + <target name="jar" depends="org.jboss.esb.processors.compile" description="Assemble jar files"> + <delete file="${org.jboss.esb.processors.distrib.dir}/${org.jboss.esb.processors.jar.name}.jar" /> + <jar destfile="${org.jboss.esb.processors.distrib.dir}/${org.jboss.esb.processors.jar.name}.jar" + basedir="${org.jboss.esb.processors.bin.dir}" + includes="**/*.class" + excludes="test/**" + /> + </target> + + <target name="all" depends="recompile,jar" /> + +</project> Copied: labs/jbossesb/trunk/ESBCore/processors/src (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbProcessors/src) Copied: labs/jbossesb/trunk/ESBCore/services (from rev 4901, labs/jbossesb/trunk/ESBCore/EsbServices) Deleted: labs/jbossesb/trunk/ESBCore/services/ant.bat =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/ant.bat 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/services/ant.bat 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,12 +0,0 @@ -@echo off -set ANT_CMD_LINE_ARGS=%1 -if ""%1""=="""" goto doneStart -shift -:setupArgs -if ""%1""=="""" goto doneStart -set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 -shift -goto setupArgs -:doneStart -%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS% - Copied: labs/jbossesb/trunk/ESBCore/services/ant.bat (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbServices/ant.bat) Deleted: labs/jbossesb/trunk/ESBCore/services/build.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/build.xml 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/services/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,121 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> - -<project name="JbossEsbServices" default="compile" basedir="."> - - <property name="name.jar" value="${ant.project.name}.jar"/> - <property name="appl.dir" value=".."/> - <property name="metainf.dir" value="src/META-INF"/> - - <import file="buildOne.xml"/> - - <path id="default.class.path"> - <path refid="base.class.path"/> - <pathelement location="../EsbCommon/bin"/> - </path> - - <path id="xdoclet.class.path"> - <fileset dir="${env.XDOCLET_HOME}/lib"> - <include name="*.jar"/> - </fileset> - <path refid="default.class.path"/> - </path> - - <!-- =================================================================== --> - <!-- Initialise xdoclet tasks --> - <!-- =================================================================== --> - <target name="initXdoclet"> - <taskdef - name="ejbdoclet" - classname="xdoclet.modules.ejb.EjbDocletTask" - classpathref="xdoclet.class.path" - /> - </target> - - - <!-- =================================================================== --> - <!-- Initialise --> - <!-- =================================================================== --> - <target name="ejbdoclet" depends="initXdoclet"> - - <echo>+---------------------------------------------------+</echo> - <echo>| |</echo> - <echo>| R U N N I N G E J B D O C L E T |</echo> - <echo>| |</echo> - <echo>+---------------------------------------------------+</echo> - - <ejbdoclet - destdir="src" - mergedir="parent-fake-to-debug" - ejbspec="2.0" - excludedTags="@version,@author,@todo" - force="false" - verbose="false" - addedTags="@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version}" - > - - <remoteinterface/> - <localinterface/> - <homeinterface/> - <localhomeinterface/> - - <fileset dir="src"> - <include name="**/*Bean.java"/> - </fileset> - - <deploymentdescriptor - destdir="${metainf.dir}" - validatexml="true" - mergedir="fake-to-debug" - description="Jboss ESB" - > - </deploymentdescriptor> - - <jboss - version="3.2" - xmlencoding="iso-8859-1" - destdir="${metainf.dir}" - validatexml="true" - /> - - </ejbdoclet> - </target> - - <!-- =================================================================== --> - <!-- Jar --> - <!-- =================================================================== --> - <target name="jar" description="Assemble jar files" - depends="ejbdoclet,compile" - > - <jar destfile="../dist/JbossEsbServicesClient.jar" - basedir="bin" - includes="**/*.class" - excludes="**/EJBs/*Bean*" - /> - <jar destfile="../dist/JbossEsbServices.jar" - basedir="bin" - includes="**/EJBs/*.class,**/dbtables/*.class,**/crypto/*.class" - manifest="${metainf.dir}/manifest.server" - > - <metainf dir="${metainf.dir}" includes="*.xml" - excludes="application.xml" - /> - </jar> - - <antcall target="-ear"/> - </target> - - <target name="-ear"> - - <ear destfile="../dist/JbossEsbAppl.ear" - appxml="${metainf.dir}/application.xml" - > - <fileset dir="../dist" - includes="jboss_esb_common.jar - ,CQ3ServicesClient.jar - ,CQ3Services.jar - "/> - </ear> - - </target> - -</project> Copied: labs/jbossesb/trunk/ESBCore/services/build.xml (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbServices/build.xml) =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/build.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/build.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -0,0 +1,206 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<project name="JbossEsbServices" default="org.jboss.esb.services.compile" basedir="."> + + <property name="org.jboss.esb.services.name.jar" value="${ant.project.name}.jar"/> + <property name="org.jboss.esb.services.appl.dir" value="../.."/> + <property name="org.jboss.esb.services.metainf.dir" value="src/META-INF"/> + + <property name="org.jboss.esb.services.classes.dir" value="${org.jboss.esb.internal.dest}/classes"/> + <property name="org.jboss.esb.services.src.dir" value="${basedir}/src"/> + <property name="org.jboss.esb.root.dir" value="../.."/> + <property environment="env"/> + + <property name="org.jboss.esb.ext.serverlib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.serverlib.dir" value="{org.jboss.esb.jboss.home}/server/all/lib"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <property name="org.jboss.esb.services.xdoclet.lib" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.serverlib.dir" value="${env.XDOCLET_HOME}/lib"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/> + <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/lib"> + <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/> + </condition> + + <!-- =================================================================== --> + <!-- Define the class path --> + <!-- =================================================================== --> + <path id="org.jboss.esb.services.base.classpath"> + <fileset dir="${org.jboss.esb.services.appl.dir}/lib" includes="*.jar,*.zip"/> + <fileset dir="${org.jboss.esb.ext.serverlib.dir}" + includes="*.jar,*.zip" + /> + <fileset dir="${org.jboss.esb.ext.lib.dir}" + includes="jboss-jmx.jar" + /> + </path> + + <!-- =================================================================== --> + <!-- Initialize --> + <!-- =================================================================== --> + <target name="org.jboss.esb.services.init"> + <tstamp> + <format property="TODAY" pattern="d-MM-yy"/> + </tstamp> + </target> + + <!-- =================================================================== --> + <!-- Prepares the directory structure --> + <!-- =================================================================== --> + <target name="org.jboss.esb.services.prepare" depends="org.jboss.esb.services.init"> + <mkdir dir="${org.jboss.esb.services.classes.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Compiles all the classes --> + <!-- =================================================================== --> + + <target name="org.jboss.esb.services.compile" depends="org.jboss.esb.services.prepare" + description="Compile all classes"> + + <javac + destdir="${org.jboss.esb.services.classes.dir}" + classpathref="org.jboss.esb.services.default.classpath" + debug="${org.jboss.esb.debug}" + optimize="${org.jboss.esb.optimize}" + > + <src path="${org.jboss.esb.services.src.dir}"/> + </javac> + + </target> + + <!-- =================================================================== --> + <!-- Recompiles all the classes --> + <!-- =================================================================== --> + + <target name="recompile" depends="clean,org.jboss.esb.services.compile" + description="Clean and compile"/> + + <!-- =================================================================== --> + <!-- Clean --> + <!-- =================================================================== --> + <target name="clean" description="Remove clases directory"> + </target> + + <target name="purge" depends="clean"> + <delete dir="${org.jboss.esb.services.classes.dir}"/> + </target> + + <!-- =================================================================== --> + <!-- Rebuild everything from scratch --> + <!-- =================================================================== --> + <target name="all" depends="recompile,jar" /> + + <path id="org.jboss.esb.services.default.classpath"> + <path refid="org.jboss.esb.services.base.classpath"/> + <pathelement location="${org.jboss.esb.internal.dest}/classes"/> + </path> + + <path id="xdoclet.class.path"> + <fileset dir="${org.jboss.esb.services.xdoclet.lib}"> + <include name="*.jar"/> + </fileset> + <path refid="org.jboss.esb.services.default.classpath"/> + </path> + + <!-- =================================================================== --> + <!-- Initialise xdoclet tasks --> + <!-- =================================================================== --> + <target name="org.jboss.esb.services.initXdoclet"> + <taskdef + name="ejbdoclet" + classname="xdoclet.modules.ejb.EjbDocletTask" + classpathref="xdoclet.class.path" + /> + </target> + + + <!-- =================================================================== --> + <!-- Initialise --> + <!-- =================================================================== --> + <target name="ejbdoclet" depends="org.jboss.esb.services.initXdoclet"> + + <echo>+---------------------------------------------------+</echo> + <echo>| |</echo> + <echo>| R U N N I N G E J B D O C L E T |</echo> + <echo>| |</echo> + <echo>+---------------------------------------------------+</echo> + + <ejbdoclet + destdir="src" + mergedir="parent-fake-to-debug" + ejbspec="2.0" + excludedTags="@version,@author,@todo" + force="false" + verbose="false" + addedTags="@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version}" + > + + <remoteinterface/> + <localinterface/> + <homeinterface/> + <localhomeinterface/> + + <fileset dir="src"> + <include name="**/*Bean.java"/> + </fileset> + + <deploymentdescriptor + destdir="${org.jboss.esb.services.metainf.dir}" + validatexml="true" + mergedir="fake-to-debug" + description="Jboss ESB" + > + </deploymentdescriptor> + + <jboss + version="3.2" + xmlencoding="iso-8859-1" + destdir="${org.jboss.esb.services.metainf.dir}" + validatexml="true" + /> + + </ejbdoclet> + </target> + + <!-- =================================================================== --> + <!-- Jar --> + <!-- =================================================================== --> + <target name="jar" description="Assemble jar files" + depends="org.jboss.esb.services.compile,ejbdoclet" + > + <jar destfile="${org.jboss.esb.internal.dest}/dist/jbossesb-services-client.jar" + basedir="${org.jboss.esb.internal.dest}/classes" + includes="**/*.class" + excludes="**/EJBs/*Bean*" + /> + <jar destfile="${org.jboss.esb.internal.dest}/dist/jbossesb-services.jar" + basedir="${org.jboss.esb.internal.dest}/classes" + includes="**/EJBs/*.class,**/dbtables/*.class,**/crypto/*.class" + manifest="${org.jboss.esb.services.metainf.dir}/manifest.server" + > + <metainf dir="${org.jboss.esb.services.metainf.dir}" includes="*.xml" + excludes="application.xml" + /> + </jar> + + <antcall target="-ear"/> + </target> + + <target name="-ear"> + <ear destfile="${org.jboss.esb.internal.dest}/dist/jbossesb-appl.ear" + appxml="${org.jboss.esb.services.metainf.dir}/application.xml"> + <fileset dir="${org.jboss.esb.internal.dest}/dist" + includes="jbossesb-common.jar + ,CQ3ServicesClient.jar + ,CQ3Services.jar + "/> + </ear> + + </target> + +</project> Deleted: labs/jbossesb/trunk/ESBCore/services/buildOne.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/buildOne.xml 2006-07-03 14:29:57 UTC (rev 4901) +++ labs/jbossesb/trunk/ESBCore/services/buildOne.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -1 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> <!-- =================================================================== --> <!-- buildOne.xml - Invoked from child directories --> <!-- =================================================================== --> <project name="JbossEsb-module" default="compile" basedir="."> <property name="classes.dir" value="${basedir}/bin"/> <property name="src.dir" value="${basedir}/src"/> <property environment="env"/> <!-- =================================================================== --> <!-- Define the class path --> <!-- =================================================================== --> <path id="base.class.path"> <fileset dir="${appl.dir}/lib" includes="*.jar,*.zip"/> <fileset dir="${env.JBOSS_HOME}/server/all/lib" includes="*.jar,*.zip" /> <fileset dir="${env.JBOSS_HOME}/lib" includes="jboss-jmx.jar" /> </path> <!-- =================================================================== --> <!-- Initialize --> <!-- =================================================================== --> <target name="init"> <tstamp> <format property="TODAY" pattern="d-MM-yy"/> </tstamp> </target> <!-- =================================================================== --> <!-- Prepares the directory structure --> <!-- =================================================================== --> <target name="prepare" depends="init"> <mkdir dir="${classes.dir}"/> </target> <!-- =================================================================== --> <!-- Compiles all the classes --> <!-- =================================================================== --> <target name="compile" depends="prepare,ejbdoclet" description="Compile all classes"> <javac destdir="${classes.dir}" classpathref="default.class.path" debug="on" optimize="off" > <src path="${src.dir}"/> </javac> </target> <!-- =================================================================== --> <!-- Recompiles all the classes --> <!-- =================================================================== --> <target name="recompile" depends="clean,compile" description="Clean and compile"/> <!-- =================================================================== --> <!-- Jar --> <!-- =================================================================== --> <target name="jar" description="Assemble jar files"> <jar destfile="../dist/${name.jar}" basedir="bin" includes="**/*.class" /> </target> <!-- =================================================================== --> <!-- Clean --> <!-- =================================================================== --> <target name="clean" description="Remove clases directory"> <delete dir="${classes.dir}"/> </target> <!-- =================================================================== --> <!-- Rebuild everything from scratch --> <!-- =================================================================== --> <target name="all" depends="recompile,jar" /> </project> \ No newline at end of file Copied: labs/jbossesb/trunk/ESBCore/services/src (from rev 4905, labs/jbossesb/trunk/ESBCore/EsbServices/src) Modified: labs/jbossesb/trunk/ESBCore/services/src/META-INF/application.xml =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/META-INF/application.xml 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/META-INF/application.xml 2006-07-05 10:03:27 UTC (rev 4906) @@ -6,6 +6,6 @@ http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"> <display-name>JbossEsb AppServer basic services</display-name> <module> - <ejb>JbossEsbServices.jar</ejb> + <ejb>jbossesb-services.jar</ejb> </module> </application> Modified: labs/jbossesb/trunk/ESBCore/services/src/META-INF/manifest.server =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/META-INF/manifest.server 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/META-INF/manifest.server 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,3 +1,3 @@ Manifest-Version: 1.0 -Class-Path: jboss_esb_common.jar JbossEsbServicesClient.jar +Class-Path: jbossesb-common.jar jbossesb-services-client.jar Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandler.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandler.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandler.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Remote interface for JbossEsbBatchHandler. - * @xdoclet-generated at 25-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Home interface for JbossEsbBatchHandler. - * @xdoclet-generated at 25-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocal.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocal.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocal.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Local interface for JbossEsbBatchHandler. - * @xdoclet-generated at 25-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocalHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocalHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbBatchHandlerLocalHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Local home interface for JbossEsbBatchHandler. - * @xdoclet-generated at 25-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandler.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandler.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandler.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Remote interface for JbossEsbNotificationHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,34 +1,11 @@ /* -* JBoss, Home of Professional Open Source -* Copyright 2006, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - - -/* * Generated by XDoclet - Do not edit! */ package org.jboss.soa.esb.services.EJB; /** * Home interface for JbossEsbNotificationHandler. - * @xdoclet-generated at ${TODAY} + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocal.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocal.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocal.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,34 +1,11 @@ /* -* JBoss, Home of Professional Open Source -* Copyright 2006, JBoss Inc., and individual contributors as indicated -* by the @authors tag. See the copyright.txt in the distribution for a -* full listing of individual contributors. -* -* This is free software; you can redistribute it and/or modify it -* under the terms of the GNU Lesser General Public License as -* published by the Free Software Foundation; either version 2.1 of -* the License, or (at your option) any later version. -* -* This software is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this software; if not, write to the Free -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA, or see the FSF site: http://www.fsf.org. -*/ - - -/* * Generated by XDoclet - Do not edit! */ package org.jboss.soa.esb.services.EJB; /** * Local interface for JbossEsbNotificationHandler. - * @xdoclet-generated at 13-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocalHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocalHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbNotificationHandlerLocalHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Local home interface for JbossEsbNotificationHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandler.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandler.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandler.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Remote interface for JbossEsbPersistHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Home interface for JbossEsbPersistHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocal.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocal.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocal.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Local interface for JbossEsbPersistHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocalHome.java =================================================================== --- labs/jbossesb/trunk/ESBCore/EsbServices/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocalHome.java 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/ESBCore/services/src/org/jboss/soa/esb/services/EJB/JbossEsbPersistHandlerLocalHome.java 2006-07-05 10:03:27 UTC (rev 4906) @@ -5,7 +5,7 @@ /** * Local home interface for JbossEsbPersistHandler. - * @xdoclet-generated at 26-06-06 + * @xdoclet-generated at July 4 2006 * @copyright The XDoclet Team * @author XDoclet * @version ${version} Modified: labs/jbossesb/trunk/Readme.txt =================================================================== --- labs/jbossesb/trunk/Readme.txt 2006-07-04 23:09:51 UTC (rev 4905) +++ labs/jbossesb/trunk/Readme.txt 2006-07-05 10:03:27 UTC (rev 4906) @@ -1,2 +1,4 @@ This is the source code repository for JBossESB. This is a work in progress, so the structure may change. +For more information on JBossESB, visit http://labs.jboss.com/portal/jbossesb/?prjlist=false + Added: labs/jbossesb/trunk/build.xml ===================================================... [truncated message content] |
From: <jbo...@li...> - 2006-07-05 09:22:38
|
Author: hei...@jb... Date: 2006-07-05 05:22:32 -0400 (Wed, 05 Jul 2006) New Revision: 561 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java Log: cleanup XB API usage Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java 2006-07-05 08:27:29 UTC (rev 560) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java 2006-07-05 09:22:32 UTC (rev 561) @@ -26,23 +26,18 @@ import org.jboss.logging.Logger; import org.jboss.util.NotImplementedException; import org.jboss.ws.WSException; -import org.jboss.ws.xop.XOPMarshallerImpl; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping; import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping; import org.jboss.ws.utils.JavaUtils; +import org.jboss.ws.xop.XOPMarshallerImpl; import org.jboss.xb.binding.Constants; -import org.jboss.xb.binding.MappingObjectModelProvider; -import org.jboss.xb.binding.MarshallingContext; -import org.jboss.xb.binding.ObjectLocalMarshaller; import org.jboss.xb.binding.introspection.ClassInfos; import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; -import org.jboss.xb.util.Dom2Sax; -import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; + import javax.xml.namespace.QName; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -76,7 +71,6 @@ delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false"); delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE); delegate.setSupportNil(true); - //delegate.setSimpleContentProperty("_value"); } /** @@ -104,11 +98,8 @@ delegate.declareNamespace(prefix, nsURI); } - MappingObjectModelProvider provider = new MappingObjectModelProvider(); - provider.setIgnoreLowLine(false); - provider.setIgnoreNotFoundField(false); - - // todo complete wsdl mapping merge + // wildcards still need to be mapped + // todo: cleanup XB API JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JAXBConstants.JAXB_JAVA_MAPPING); if (wsdlMapping != null) { @@ -123,42 +114,14 @@ { String clsName = javaXmlMapping.getJavaType(); Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader()); - QName clsQName = javaXmlMapping.getRootTypeQName() != null ? javaXmlMapping.getRootTypeQName() : javaXmlMapping.getAnonymousTypeQName(); - if (clsQName != null) - { - if ("element".equals(javaXmlMapping.getQnameScope())) - { - delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); - } - else - { - delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); - delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart()); - } - } - for (int j = 0; j < variableMappings.length; ++j) { VariableMapping variableMapping = variableMappings[j]; - String javaName = variableMapping.getJavaVariableName(); - if (variableMapping.getXmlElementName() != null) + if (variableMapping.getXmlWildcard()) { - String xmlElementName = variableMapping.getXmlElementName(); - provider.mapFieldToElement(cls, javaName, "", xmlElementName, null); + delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller()); } - else if (variableMapping.getXmlAttributeName() != null) - { - log.trace("Unmapped attribute: " + javaName); - } - else if (variableMapping.getXmlWildcard()) - { - delegate.mapFieldToWildcard(cls, "_any", getWildcardMarshaller()); - } - else - { - log.warn("Unmapped variable: " + javaName); - } } } } @@ -168,7 +131,7 @@ // the actual marshalling SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties); schemaBinding.setXopMarshaller(new XOPMarshallerImpl()); - delegate.marshal(schemaBinding, provider, obj, writer); + delegate.marshal(schemaBinding, null, obj, writer); } catch (RuntimeException e) { @@ -180,53 +143,6 @@ } } - private ObjectLocalMarshaller getWildcardMarshaller() - { - ObjectLocalMarshaller wildcardMarshaller = new ObjectLocalMarshaller() { - public void marshal(MarshallingContext ctx, Object o) - { - if (o == null) - { - return; - } - - Element e = (Element)o; - ContentHandler ch = ctx.getContentHandler(); - try - { - Dom2Sax.dom2sax(e, ch); - } - catch (SAXException e1) - { - throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); - } - /* - DOMSource domSource = new DOMSource(e); - SAXResult streamResult = new SAXResult(ch); - // if i use the system default transformer then it works - // the one that is actually used does not declare namespaces - //System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"); - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer serializer = null; - try - { - serializer = tf.newTransformer(); - serializer.transform(domSource, streamResult); - } - catch(TransformerConfigurationException e1) - { - throw new JBossXBRuntimeException("Failed to create transformer", e1); - } - catch(TransformerException e1) - { - throw new JBossXBRuntimeException("Failed to marshal with transform", e1); - } - */ - } - }; - return wildcardMarshaller; - } - /** * Marshal the content tree rooted at obj into SAX2 events. */ Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java 2006-07-05 08:27:29 UTC (rev 560) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBSupport.java 2006-07-05 09:22:32 UTC (rev 561) @@ -1,6 +1,9 @@ package org.jboss.ws.jaxb; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; +import org.jboss.xb.binding.ObjectLocalMarshaller; +import org.jboss.xb.binding.MarshallingContext; +import org.jboss.xb.util.Dom2Sax; import org.jboss.ws.soap.SOAPMessageContextImpl; import org.jboss.ws.soap.MessageContextAssociation; import org.jboss.ws.metadata.OperationMetaData; @@ -8,6 +11,10 @@ import org.jboss.ws.metadata.ServiceMetaData; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel; +import org.jboss.ws.WSException; +import org.w3c.dom.Element; +import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; import javax.xml.namespace.QName; import java.util.Map; @@ -61,7 +68,39 @@ // by various operations with different xml types, we have to add the // element binding on every invocation. bindingBuilder.bindParameterToElement(schemaBinding, xmlName, xmlType); - + return schemaBinding; } + + /** + * Create a Marshaller that serializes + * <code>org.w3c.dom.Element</code>'s to a <code>org.xml.sax.ContentHandler</code> + * + * @return ObjectLocalMarshaller + * + * @see org.jboss.xb.binding.MarshallingContext#getContentHandler() + */ + public static ObjectLocalMarshaller getWildcardMarshaller() + { + return new ObjectLocalMarshaller() { + public void marshal(MarshallingContext ctx, Object o) + { + if (o == null) + { + return; + } + + Element e = (Element)o; + ContentHandler ch = ctx.getContentHandler(); + try + { + Dom2Sax.dom2sax(e, ch); + } + catch (SAXException e1) + { + throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); + } + } + }; + } } Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java 2006-07-05 08:27:29 UTC (rev 560) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java 2006-07-05 09:22:32 UTC (rev 561) @@ -23,13 +23,6 @@ // $Id$ -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.util.HashMap; - -import javax.xml.namespace.QName; - import org.apache.xerces.xs.XSModel; import org.jboss.logging.Logger; import org.jboss.util.NotImplementedException; @@ -40,15 +33,16 @@ import org.jboss.ws.utils.JavaUtils; import org.jboss.xb.binding.Constants; import org.jboss.xb.binding.MappingObjectModelProvider; -import org.jboss.xb.binding.MarshallingContext; -import org.jboss.xb.binding.ObjectLocalMarshaller; import org.jboss.xb.binding.XercesXsMarshaller; -import org.jboss.xb.util.Dom2Sax; -import org.w3c.dom.Element; import org.w3c.dom.Node; import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; +import javax.xml.namespace.QName; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.HashMap; + /** * An implementation of a JAXB Marshaller that user XercesXSMarshaller impl. * @@ -150,7 +144,7 @@ } else if (variableMapping.getXmlWildcard()) { - delegate.mapFieldToWildcard(cls, "_any", getWildcardMarshaller()); + delegate.mapFieldToWildcard(cls, "_any", JBossXBSupport.getWildcardMarshaller()); } else { @@ -178,31 +172,6 @@ } } - private ObjectLocalMarshaller getWildcardMarshaller() - { - ObjectLocalMarshaller wildcardMarshaller = new ObjectLocalMarshaller() { - public void marshal(MarshallingContext ctx, Object o) - { - if (o == null) - { - return; - } - - Element e = (Element)o; - ContentHandler ch = ctx.getContentHandler(); - try - { - Dom2Sax.dom2sax(e, ch); - } - catch (SAXException e1) - { - throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); - } - } - }; - return wildcardMarshaller; - } - /** * Marshal the content tree rooted at obj into SAX2 events. */ |
From: <jbo...@li...> - 2006-07-05 08:27:36
|
Author: hei...@jb... Date: 2006-07-05 04:27:29 -0400 (Wed, 05 Jul 2006) New Revision: 560 Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java Log: - pluggable Marshaller strategy - reinstate XercesXSMarshaller delegation Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java 2006-07-05 08:15:21 UTC (rev 559) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java 2006-07-05 08:27:29 UTC (rev 560) @@ -33,6 +33,7 @@ * @since Jul 5, 2006 */ public interface JAXBMarshaller { + void marshal(Object obj, Writer writer) throws MarshalException; void marshal(Object obj, ContentHandler handler); Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java 2006-07-05 08:27:29 UTC (rev 560) @@ -50,10 +50,11 @@ import java.util.HashMap; /** - * An implementation of a JAXB Marshaller. + * An implementation of a JAXB Marshaller that uses the JBossXB schema binding marshaller. * * @author Tho...@jb... - * @since 18-Oct-2004 + * @author Hei...@jb... + * @since 05-Jul-2006 */ public class JBossXBMarshallerImpl implements JAXBMarshaller { Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java 2006-07-05 08:27:29 UTC (rev 560) @@ -0,0 +1,281 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.jaxb; + +// $Id$ + +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.HashMap; + +import javax.xml.namespace.QName; + +import org.apache.xerces.xs.XSModel; +import org.jboss.logging.Logger; +import org.jboss.util.NotImplementedException; +import org.jboss.ws.WSException; +import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; +import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping; +import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping; +import org.jboss.ws.utils.JavaUtils; +import org.jboss.xb.binding.Constants; +import org.jboss.xb.binding.MappingObjectModelProvider; +import org.jboss.xb.binding.MarshallingContext; +import org.jboss.xb.binding.ObjectLocalMarshaller; +import org.jboss.xb.binding.XercesXsMarshaller; +import org.jboss.xb.util.Dom2Sax; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; + +/** + * An implementation of a JAXB Marshaller that user XercesXSMarshaller impl. + * + * @author Tho...@jb... + * @since 18-Oct-2004 + */ +public class XercesXSMarshallerImpl implements JAXBMarshaller +{ + + // provide logging + private static final Logger log = Logger.getLogger(XercesXSMarshallerImpl.class); + + // The marshaller properties + private HashMap properties = new HashMap(); + + private XercesXsMarshaller delegate; + + public XercesXSMarshallerImpl() + { + delegate = new XercesXsMarshaller(); + delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_XML_VERSION, "false"); + delegate.setProperty(XercesXsMarshaller.PROP_OUTPUT_INDENTATION, "false"); + delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE); + delegate.setSupportNil(true); + delegate.setSimpleContentProperty("_value"); + } + + /** + * Marshal the content tree rooted at obj into a Writer. + */ + public void marshal(Object obj, Writer writer) throws MarshalException + { + assertRequiredProperties(); + + try + { + QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); + delegate.addRootElement(xmlName); + + QName xmlType = (QName)getProperty(JAXBConstants.JAXB_TYPE_QNAME); + if (xmlType != null) + { + delegate.setRootTypeQName(xmlType); + } + + if (xmlName.getNamespaceURI().length() > 0) + { + String prefix = xmlName.getPrefix(); + String nsURI = xmlName.getNamespaceURI(); + delegate.declareNamespace(prefix, nsURI); + } + + MappingObjectModelProvider provider = new MappingObjectModelProvider(); + provider.setIgnoreLowLine(false); + provider.setIgnoreNotFoundField(false); + + // todo complete wsdl mapping merge + JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JAXBConstants.JAXB_JAVA_MAPPING); + if (wsdlMapping != null) + { + JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings(); + if (javaXmlMappings != null) + { + for (int i = 0; i < javaXmlMappings.length; ++i) + { + JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i]; + VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings(); + if (variableMappings != null) + { + String clsName = javaXmlMapping.getJavaType(); + Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader()); + QName clsQName = javaXmlMapping.getRootTypeQName(); + + if (clsQName != null) + { + if ("element".equals(javaXmlMapping.getQnameScope())) + { + delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); + } + else + { + delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); + delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart()); + } + } + + for (int j = 0; j < variableMappings.length; ++j) + { + VariableMapping variableMapping = variableMappings[j]; + String javaName = variableMapping.getJavaVariableName(); + if (variableMapping.getXmlElementName() != null) + { + String xmlElementName = variableMapping.getXmlElementName(); + provider.mapFieldToElement(cls, javaName, "", xmlElementName, null); + } + else if (variableMapping.getXmlAttributeName() != null) + { + log.trace("Unmapped attribute: " + javaName); + } + else if (variableMapping.getXmlWildcard()) + { + delegate.mapFieldToWildcard(cls, "_any", getWildcardMarshaller()); + } + else + { + log.warn("Unmapped variable: " + javaName); + } + } + } + } + } + } + + if (getProperty(JAXBConstants.JAXB_XS_MODEL) != null) + { + XSModel model = (XSModel)getProperty(JAXBConstants.JAXB_XS_MODEL); + delegate.marshal(model, provider, obj, writer); + } + } + catch (RuntimeException e) + { + throw e; + } + catch (Exception e) + { + throw new MarshalException(e); + } + } + + private ObjectLocalMarshaller getWildcardMarshaller() + { + ObjectLocalMarshaller wildcardMarshaller = new ObjectLocalMarshaller() { + public void marshal(MarshallingContext ctx, Object o) + { + if (o == null) + { + return; + } + + Element e = (Element)o; + ContentHandler ch = ctx.getContentHandler(); + try + { + Dom2Sax.dom2sax(e, ch); + } + catch (SAXException e1) + { + throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); + } + } + }; + return wildcardMarshaller; + } + + /** + * Marshal the content tree rooted at obj into SAX2 events. + */ + public void marshal(Object obj, ContentHandler handler) + { + throw new NotImplementedException(); + } + + /** + * Marshal the content tree rooted at obj into a DOM tree. + */ + public void marshal(Object obj, Node node) + { + throw new NotImplementedException(); + } + + /** + * Marshal the content tree rooted at obj into an output stream. + */ + public void marshal(Object obj, OutputStream os) throws MarshalException + { + marshal(obj, new OutputStreamWriter(os)); + } + + /** + * Get the particular property in the underlying implementation of + * Marshaller. + */ + public Object getProperty(String name) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + return properties.get(name); + } + + /** + * Set the particular property in the underlying implementation of + * Marshaller. + * + */ + public void setProperty(String name, Object value) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + properties.put(name, value); + } + + /** + * Get a DOM tree view of the content tree(Optional). + */ + public Node getNode(Object contentTree) + { + throw new NotImplementedException(); + } + + /** + * Assert the required properties + */ + private void assertRequiredProperties() + { + if (getProperty(JAXBConstants.JAXB_SCHEMA_READER) == null && getProperty(JAXBConstants.JAXB_XS_MODEL) == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_XS_MODEL); + + if (getProperty(JAXBConstants.JAXB_JAVA_MAPPING) == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_JAVA_MAPPING); + + QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); + if (xmlName == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_ROOT_QNAME); + + if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0) + throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName); + } +} Property changes on: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/XercesXSMarshallerImpl.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF |
From: <jbo...@li...> - 2006-07-05 08:15:46
|
Author: hei...@jb... Date: 2006-07-05 04:15:21 -0400 (Wed, 05 Jul 2006) New Revision: 559 Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshaller.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBUnmarshallerImpl.java Removed: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayUnmarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayUnmarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayUnmarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeUnmarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleUnmarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeMarshallerTestCase.java branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeUnmarshallerTestCase.java Log: separate implementation and interface Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java 2006-07-05 08:15:21 UTC (rev 559) @@ -0,0 +1,47 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.ws.jaxb; + +import org.xml.sax.ContentHandler; +import org.w3c.dom.Node; + +import java.io.Writer; +import java.io.OutputStream; + +/** + * @author Heiko Braun <hei...@jb...> + * @version $Id$ + * @since Jul 5, 2006 + */ +public interface JAXBMarshaller { + void marshal(Object obj, Writer writer) throws MarshalException; + + void marshal(Object obj, ContentHandler handler); + + void marshal(Object obj, Node node); + + void marshal(Object obj, OutputStream os) throws MarshalException; + + Object getProperty(String name); + + void setProperty(String name, Object value); +} Property changes on: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshaller.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Deleted: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) @@ -1,305 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.jboss.ws.jaxb; - -// $Id$ - -import org.jboss.logging.Logger; -import org.jboss.util.NotImplementedException; -import org.jboss.ws.WSException; -import org.jboss.ws.xop.XOPMarshallerImpl; -import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; -import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping; -import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping; -import org.jboss.ws.utils.JavaUtils; -import org.jboss.xb.binding.Constants; -import org.jboss.xb.binding.MappingObjectModelProvider; -import org.jboss.xb.binding.MarshallingContext; -import org.jboss.xb.binding.ObjectLocalMarshaller; -import org.jboss.xb.binding.introspection.ClassInfos; -import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl; -import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; -import org.jboss.xb.util.Dom2Sax; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; -import javax.xml.namespace.QName; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.util.HashMap; - -/** - * An implementation of a JAXB Marshaller. - * - * @author Tho...@jb... - * @since 18-Oct-2004 - */ -public class JAXBMarshallerImpl -{ - - // provide logging - private static final Logger log = Logger.getLogger(JAXBMarshallerImpl.class); - - // The marshaller properties - private HashMap properties = new HashMap(); - - private MarshallerImpl delegate; - - public JAXBMarshallerImpl() - { - - ClassInfos.disableCache(); - - delegate = new MarshallerImpl(); - delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION, "false"); - delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false"); - delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE); - delegate.setSupportNil(true); - //delegate.setSimpleContentProperty("_value"); - } - - /** - * Marshal the content tree rooted at obj into a Writer. - */ - public void marshal(Object obj, Writer writer) throws MarshalException - { - assertRequiredProperties(); - - try - { - QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); - delegate.addRootElement(xmlName); - - QName xmlType = (QName)getProperty(JAXBConstants.JAXB_TYPE_QNAME); - if (xmlType != null) - { - delegate.setRootTypeQName(xmlType); - } - - if (xmlName.getNamespaceURI().length() > 0) - { - String prefix = xmlName.getPrefix(); - String nsURI = xmlName.getNamespaceURI(); - delegate.declareNamespace(prefix, nsURI); - } - - MappingObjectModelProvider provider = new MappingObjectModelProvider(); - provider.setIgnoreLowLine(false); - provider.setIgnoreNotFoundField(false); - - // todo complete wsdl mapping merge - JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JAXBConstants.JAXB_JAVA_MAPPING); - if (wsdlMapping != null) - { - JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings(); - if (javaXmlMappings != null) - { - for (int i = 0; i < javaXmlMappings.length; ++i) - { - JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i]; - VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings(); - if (variableMappings != null) - { - String clsName = javaXmlMapping.getJavaType(); - Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader()); - QName clsQName = javaXmlMapping.getRootTypeQName() != null ? javaXmlMapping.getRootTypeQName() : javaXmlMapping.getAnonymousTypeQName(); - - if (clsQName != null) - { - if ("element".equals(javaXmlMapping.getQnameScope())) - { - delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); - } - else - { - delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); - delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart()); - } - } - - for (int j = 0; j < variableMappings.length; ++j) - { - VariableMapping variableMapping = variableMappings[j]; - String javaName = variableMapping.getJavaVariableName(); - if (variableMapping.getXmlElementName() != null) - { - String xmlElementName = variableMapping.getXmlElementName(); - provider.mapFieldToElement(cls, javaName, "", xmlElementName, null); - } - else if (variableMapping.getXmlAttributeName() != null) - { - log.trace("Unmapped attribute: " + javaName); - } - else if (variableMapping.getXmlWildcard()) - { - delegate.mapFieldToWildcard(cls, "_any", getWildcardMarshaller()); - } - else - { - log.warn("Unmapped variable: " + javaName); - } - } - } - } - } - } - - // the actual marshalling - SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties); - schemaBinding.setXopMarshaller(new XOPMarshallerImpl()); - delegate.marshal(schemaBinding, provider, obj, writer); - } - catch (RuntimeException e) - { - throw e; - } - catch (Exception e) - { - throw new MarshalException(e); - } - } - - private ObjectLocalMarshaller getWildcardMarshaller() - { - ObjectLocalMarshaller wildcardMarshaller = new ObjectLocalMarshaller() { - public void marshal(MarshallingContext ctx, Object o) - { - if (o == null) - { - return; - } - - Element e = (Element)o; - ContentHandler ch = ctx.getContentHandler(); - try - { - Dom2Sax.dom2sax(e, ch); - } - catch (SAXException e1) - { - throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); - } - /* - DOMSource domSource = new DOMSource(e); - SAXResult streamResult = new SAXResult(ch); - // if i use the system default transformer then it works - // the one that is actually used does not declare namespaces - //System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"); - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer serializer = null; - try - { - serializer = tf.newTransformer(); - serializer.transform(domSource, streamResult); - } - catch(TransformerConfigurationException e1) - { - throw new JBossXBRuntimeException("Failed to create transformer", e1); - } - catch(TransformerException e1) - { - throw new JBossXBRuntimeException("Failed to marshal with transform", e1); - } - */ - } - }; - return wildcardMarshaller; - } - - /** - * Marshal the content tree rooted at obj into SAX2 events. - */ - public void marshal(Object obj, ContentHandler handler) - { - throw new NotImplementedException(); - } - - /** - * Marshal the content tree rooted at obj into a DOM tree. - */ - public void marshal(Object obj, Node node) - { - throw new NotImplementedException(); - } - - /** - * Marshal the content tree rooted at obj into an output stream. - */ - public void marshal(Object obj, OutputStream os) throws MarshalException - { - marshal(obj, new OutputStreamWriter(os)); - } - - /** - * Get the particular property in the underlying implementation of - * Marshaller. - */ - public Object getProperty(String name) - { - if (name == null) - throw new IllegalArgumentException("name parameter is null"); - - return properties.get(name); - } - - /** - * Set the particular property in the underlying implementation of - * Marshaller. - * - */ - public void setProperty(String name, Object value) - { - if (name == null) - throw new IllegalArgumentException("name parameter is null"); - - properties.put(name, value); - } - - /** - * Get a DOM tree view of the content tree(Optional). - */ - public Node getNode(Object contentTree) - { - throw new NotImplementedException(); - } - - /** - * Assert the required properties - */ - private void assertRequiredProperties() - { - if (getProperty(JAXBConstants.JAXB_SCHEMA_READER) == null && getProperty(JAXBConstants.JAXB_XS_MODEL) == null) - throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_XS_MODEL); - - if (getProperty(JAXBConstants.JAXB_JAVA_MAPPING) == null) - throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_JAVA_MAPPING); - - QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); - if (xmlName == null) - throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_ROOT_QNAME); - - if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0) - throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName); - } -} Added: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshaller.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshaller.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshaller.java 2006-07-05 08:15:21 UTC (rev 559) @@ -0,0 +1,37 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.jboss.ws.jaxb; + +import java.io.InputStream; + +/** + * @author Heiko Braun <hei...@jb...> + * @version $Id$ + * @since Jul 5, 2006 + */ +public interface JAXBUnmarshaller { + Object unmarshal(InputStream is) throws UnmarshalException; + + Object getProperty(String name); + + void setProperty(String name, Object value); +} Property changes on: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshaller.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Deleted: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) @@ -1,108 +0,0 @@ -/* - * JBoss, Home of Professional Open Source - * Copyright 2005, JBoss Inc., and individual contributors as indicated - * by the @authors tag. See the copyright.txt in the distribution for a - * full listing of individual contributors. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.jboss.ws.jaxb; - -// $Id$ - -import java.io.InputStream; -import java.util.HashMap; - -import org.jboss.ws.WSException; -import org.jboss.ws.xop.XOPUnmarshallerImpl; -import org.jboss.xb.binding.JBossXBException; -import org.jboss.xb.binding.UnmarshallerFactory; -import org.jboss.xb.binding.introspection.ClassInfos; -import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; - -/** - * An implementation of a JAXB Unmarshaller. - * - * @author Tho...@jb... - * @author Ale...@jb... - * @since 18-Oct-2004 - */ -public class JAXBUnmarshallerImpl -{ - // The marshaller properties - private HashMap<String, Object> properties = new HashMap<String, Object>(); - - /** - * Unmarshal XML data from the specified InputStream and return the resulting content tree. - */ - public Object unmarshal(InputStream is) throws UnmarshalException - { - - ClassInfos.disableCache(); - - assertRequiredProperties(); - - org.jboss.xb.binding.Unmarshaller unm = UnmarshallerFactory.newInstance().newUnmarshaller(); - SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties); - schemaBinding.setXopUnmarshaller(new XOPUnmarshallerImpl()); - try - { - return unm.unmarshal(is, schemaBinding); - } - catch (JBossXBException e) - { - throw new UnmarshalException(e.getMessage(), e); - } - } - - /** - * Get the particular property in the underlying implementation of Unmarshaller. - */ - public Object getProperty(String name) - { - if (name == null) - throw new IllegalArgumentException("name parameter is null"); - - return properties.get(name); - } - - /** - * Set the particular property in the underlying implementation of Unmarshaller. - */ - public void setProperty(String name, Object value) - { - if (name == null) - throw new IllegalArgumentException("name parameter is null"); - - properties.put(name, value); - } - - - /** Assert the required properties - */ - private void assertRequiredProperties() - { - if (getProperty(JAXBConstants.JAXB_XS_MODEL) == null) - { - throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_XS_MODEL); - } - - if (getProperty(JAXBConstants.JAXB_JAVA_MAPPING) == null) - { - throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_JAVA_MAPPING); - } - } -} Copied: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java (from rev 558, branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java) =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) @@ -0,0 +1,304 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.jaxb; + +// $Id$ + +import org.jboss.logging.Logger; +import org.jboss.util.NotImplementedException; +import org.jboss.ws.WSException; +import org.jboss.ws.xop.XOPMarshallerImpl; +import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; +import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping; +import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping; +import org.jboss.ws.utils.JavaUtils; +import org.jboss.xb.binding.Constants; +import org.jboss.xb.binding.MappingObjectModelProvider; +import org.jboss.xb.binding.MarshallingContext; +import org.jboss.xb.binding.ObjectLocalMarshaller; +import org.jboss.xb.binding.introspection.ClassInfos; +import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl; +import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; +import org.jboss.xb.util.Dom2Sax; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; +import javax.xml.namespace.QName; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.HashMap; + +/** + * An implementation of a JAXB Marshaller. + * + * @author Tho...@jb... + * @since 18-Oct-2004 + */ +public class JBossXBMarshallerImpl implements JAXBMarshaller { + + // provide logging + private static final Logger log = Logger.getLogger(JBossXBMarshallerImpl.class); + + // The marshaller properties + private HashMap properties = new HashMap(); + + private MarshallerImpl delegate; + + public JBossXBMarshallerImpl() + { + + ClassInfos.disableCache(); + + delegate = new MarshallerImpl(); + delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION, "false"); + delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false"); + delegate.declareNamespace("xsi", Constants.NS_XML_SCHEMA_INSTANCE); + delegate.setSupportNil(true); + //delegate.setSimpleContentProperty("_value"); + } + + /** + * Marshal the content tree rooted at obj into a Writer. + */ + public void marshal(Object obj, Writer writer) throws MarshalException + { + assertRequiredProperties(); + + try + { + QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); + delegate.addRootElement(xmlName); + + QName xmlType = (QName)getProperty(JAXBConstants.JAXB_TYPE_QNAME); + if (xmlType != null) + { + delegate.setRootTypeQName(xmlType); + } + + if (xmlName.getNamespaceURI().length() > 0) + { + String prefix = xmlName.getPrefix(); + String nsURI = xmlName.getNamespaceURI(); + delegate.declareNamespace(prefix, nsURI); + } + + MappingObjectModelProvider provider = new MappingObjectModelProvider(); + provider.setIgnoreLowLine(false); + provider.setIgnoreNotFoundField(false); + + // todo complete wsdl mapping merge + JavaWsdlMapping wsdlMapping = (JavaWsdlMapping)getProperty(JAXBConstants.JAXB_JAVA_MAPPING); + if (wsdlMapping != null) + { + JavaXmlTypeMapping[] javaXmlMappings = wsdlMapping.getJavaXmlTypeMappings(); + if (javaXmlMappings != null) + { + for (int i = 0; i < javaXmlMappings.length; ++i) + { + JavaXmlTypeMapping javaXmlMapping = javaXmlMappings[i]; + VariableMapping[] variableMappings = javaXmlMapping.getVariableMappings(); + if (variableMappings != null) + { + String clsName = javaXmlMapping.getJavaType(); + Class cls = JavaUtils.loadJavaType(clsName, Thread.currentThread().getContextClassLoader()); + QName clsQName = javaXmlMapping.getRootTypeQName() != null ? javaXmlMapping.getRootTypeQName() : javaXmlMapping.getAnonymousTypeQName(); + + if (clsQName != null) + { + if ("element".equals(javaXmlMapping.getQnameScope())) + { + delegate.mapClassToGlobalElement(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); + } + else + { + delegate.mapClassToGlobalType(cls, clsQName.getLocalPart(), clsQName.getNamespaceURI(), null, provider); + delegate.mapClassToXsiType(cls, clsQName.getNamespaceURI(), clsQName.getLocalPart()); + } + } + + for (int j = 0; j < variableMappings.length; ++j) + { + VariableMapping variableMapping = variableMappings[j]; + String javaName = variableMapping.getJavaVariableName(); + if (variableMapping.getXmlElementName() != null) + { + String xmlElementName = variableMapping.getXmlElementName(); + provider.mapFieldToElement(cls, javaName, "", xmlElementName, null); + } + else if (variableMapping.getXmlAttributeName() != null) + { + log.trace("Unmapped attribute: " + javaName); + } + else if (variableMapping.getXmlWildcard()) + { + delegate.mapFieldToWildcard(cls, "_any", getWildcardMarshaller()); + } + else + { + log.warn("Unmapped variable: " + javaName); + } + } + } + } + } + } + + // the actual marshalling + SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties); + schemaBinding.setXopMarshaller(new XOPMarshallerImpl()); + delegate.marshal(schemaBinding, provider, obj, writer); + } + catch (RuntimeException e) + { + throw e; + } + catch (Exception e) + { + throw new MarshalException(e); + } + } + + private ObjectLocalMarshaller getWildcardMarshaller() + { + ObjectLocalMarshaller wildcardMarshaller = new ObjectLocalMarshaller() { + public void marshal(MarshallingContext ctx, Object o) + { + if (o == null) + { + return; + } + + Element e = (Element)o; + ContentHandler ch = ctx.getContentHandler(); + try + { + Dom2Sax.dom2sax(e, ch); + } + catch (SAXException e1) + { + throw new IllegalStateException("Failed to marshal DOM element " + new QName(e.getNamespaceURI(), e.getLocalName()) + ": " + e1.getMessage()); + } + /* + DOMSource domSource = new DOMSource(e); + SAXResult streamResult = new SAXResult(ch); + // if i use the system default transformer then it works + // the one that is actually used does not declare namespaces + //System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer serializer = null; + try + { + serializer = tf.newTransformer(); + serializer.transform(domSource, streamResult); + } + catch(TransformerConfigurationException e1) + { + throw new JBossXBRuntimeException("Failed to create transformer", e1); + } + catch(TransformerException e1) + { + throw new JBossXBRuntimeException("Failed to marshal with transform", e1); + } + */ + } + }; + return wildcardMarshaller; + } + + /** + * Marshal the content tree rooted at obj into SAX2 events. + */ + public void marshal(Object obj, ContentHandler handler) + { + throw new NotImplementedException(); + } + + /** + * Marshal the content tree rooted at obj into a DOM tree. + */ + public void marshal(Object obj, Node node) + { + throw new NotImplementedException(); + } + + /** + * Marshal the content tree rooted at obj into an output stream. + */ + public void marshal(Object obj, OutputStream os) throws MarshalException + { + marshal(obj, new OutputStreamWriter(os)); + } + + /** + * Get the particular property in the underlying implementation of + * Marshaller. + */ + public Object getProperty(String name) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + return properties.get(name); + } + + /** + * Set the particular property in the underlying implementation of + * Marshaller. + * + */ + public void setProperty(String name, Object value) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + properties.put(name, value); + } + + /** + * Get a DOM tree view of the content tree(Optional). + */ + public Node getNode(Object contentTree) + { + throw new NotImplementedException(); + } + + /** + * Assert the required properties + */ + private void assertRequiredProperties() + { + if (getProperty(JAXBConstants.JAXB_SCHEMA_READER) == null && getProperty(JAXBConstants.JAXB_XS_MODEL) == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_XS_MODEL); + + if (getProperty(JAXBConstants.JAXB_JAVA_MAPPING) == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_JAVA_MAPPING); + + QName xmlName = (QName)getProperty(JAXBConstants.JAXB_ROOT_QNAME); + if (xmlName == null) + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_ROOT_QNAME); + + if (xmlName.getNamespaceURI().length() > 0 && xmlName.getPrefix().length() == 0) + throw new IllegalArgumentException("The given root element name must be prefix qualified: " + xmlName); + } +} Property changes on: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBMarshallerImpl.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Copied: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBUnmarshallerImpl.java (from rev 558, branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java) =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBUnmarshallerImpl.java 2006-07-05 08:15:21 UTC (rev 559) @@ -0,0 +1,108 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.jaxb; + +// $Id$ + +import java.io.InputStream; +import java.util.HashMap; + +import org.jboss.ws.WSException; +import org.jboss.ws.xop.XOPUnmarshallerImpl; +import org.jboss.xb.binding.JBossXBException; +import org.jboss.xb.binding.UnmarshallerFactory; +import org.jboss.xb.binding.introspection.ClassInfos; +import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; + +/** + * An implementation of a JAXB Unmarshaller. + * + * @author Tho...@jb... + * @author Ale...@jb... + * @since 18-Oct-2004 + */ +public class JBossXBUnmarshallerImpl implements JAXBUnmarshaller { + + // The marshaller properties + private HashMap<String, Object> properties = new HashMap<String, Object>(); + + /** + * Unmarshal XML data from the specified InputStream and return the resulting content tree. + */ + public Object unmarshal(InputStream is) throws UnmarshalException + { + + ClassInfos.disableCache(); + + assertRequiredProperties(); + + org.jboss.xb.binding.Unmarshaller unm = UnmarshallerFactory.newInstance().newUnmarshaller(); + SchemaBinding schemaBinding = JBossXBSupport.getOrCreateSchemaBinding(properties); + schemaBinding.setXopUnmarshaller(new XOPUnmarshallerImpl()); + try + { + return unm.unmarshal(is, schemaBinding); + } + catch (JBossXBException e) + { + throw new UnmarshalException(e.getMessage(), e); + } + } + + /** + * Get the particular property in the underlying implementation of Unmarshaller. + */ + public Object getProperty(String name) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + return properties.get(name); + } + + /** + * Set the particular property in the underlying implementation of Unmarshaller. + */ + public void setProperty(String name, Object value) + { + if (name == null) + throw new IllegalArgumentException("name parameter is null"); + + properties.put(name, value); + } + + + /** Assert the required properties + */ + private void assertRequiredProperties() + { + if (getProperty(JAXBConstants.JAXB_XS_MODEL) == null) + { + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_XS_MODEL); + } + + if (getProperty(JAXBConstants.JAXB_JAVA_MAPPING) == null) + { + throw new WSException("Cannot find required property: " + JAXBConstants.JAXB_JAVA_MAPPING); + } + } +} Property changes on: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JBossXBUnmarshallerImpl.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBDeserializer.java 2006-07-05 08:15:21 UTC (rev 559) @@ -31,7 +31,8 @@ import org.jboss.logging.Logger; import org.jboss.ws.binding.BindingException; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -45,12 +46,12 @@ // provide logging private static final Logger log = Logger.getLogger(JAXBDeserializer.class); - private JAXBUnmarshallerImpl jaxbUnmarshaller; + private JAXBUnmarshaller jaxbUnmarshaller; public JAXBDeserializer() throws BindingException { // Get the JAXB marshaller for complex objects - jaxbUnmarshaller = new JAXBUnmarshallerImpl(); + jaxbUnmarshaller = new JBossXBUnmarshallerImpl(); } /** Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxrpc/encoding/JAXBSerializer.java 2006-07-05 08:15:21 UTC (rev 559) @@ -31,7 +31,8 @@ import org.jboss.logging.Logger; import org.jboss.ws.binding.BindingException; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.w3c.dom.NamedNodeMap; @@ -46,12 +47,12 @@ // provide logging private static final Logger log = Logger.getLogger(JAXBSerializer.class); - private JAXBMarshallerImpl jaxbMarshaller; + private JAXBMarshaller JAXBMarshaller; public JAXBSerializer() throws BindingException { // Get the JAXB marshaller for complex objects - jaxbMarshaller = new JAXBMarshallerImpl(); + JAXBMarshaller = new JBossXBMarshallerImpl(); } /** @@ -84,13 +85,13 @@ // Get the jaxrpc-mapping.xml object graph JavaWsdlMapping jaxrpcMapping = serContext.getJavaWsdlMapping(); - jaxbMarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); - jaxbMarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); - jaxbMarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); - jaxbMarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); + JAXBMarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); + JAXBMarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); + JAXBMarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); + JAXBMarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, jaxrpcMapping); StringWriter strwr = new StringWriter(); - jaxbMarshaller.marshal(value, strwr); + JAXBMarshaller.marshal(value, strwr); xmlFragment = strwr.toString(); log.debug("serialized: " + xmlFragment); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -30,7 +30,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -71,7 +72,7 @@ // + " <element name='value' type='decimal' nillable='true' minOccurs='0' maxOccurs='unbounded'/>" + " </sequence>" // + " </complexType>" + "</schema>", "UTF-8"); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/BigDecimalArrayUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -30,7 +30,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -70,7 +71,7 @@ BigDecimal[] objArr = null; // Get the JAXB marshaller - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -32,7 +32,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -75,7 +76,7 @@ XSModel model = generateSchemaXSModel(xmlType, Calendar[].class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/CalendarArrayUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -32,7 +32,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -67,7 +68,7 @@ XSModel model = generateSchemaXSModel(xmlType, Calendar[].class); Calendar[] objArr = null; - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -29,7 +29,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -67,7 +68,7 @@ XSModel model = generateSchemaXSModel(xmlType, QName[].class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/array/QNameArrayUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -29,7 +29,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; /** @@ -64,7 +65,7 @@ XSModel model = generateSchemaXSModel(xmlType, QName[].class); QName[] objArr = null; - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -32,7 +32,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory; @@ -68,7 +69,7 @@ XSModel model = getSchemaModel(xmlType, Base.class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -96,7 +97,7 @@ XSModel model = getSchemaModel(xmlType, Derived.class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -136,7 +137,7 @@ XSModel model = getSchemaModel(xmlType, Composite.class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/complex/ComplexTypeUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -31,7 +31,8 @@ import org.apache.xerces.xs.XSModel; import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory; import org.jboss.ws.tools.JavaToXSD; @@ -70,7 +71,7 @@ exp.a = 100; exp.setB(200); - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, getJavaWSDLMapping()); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -96,7 +97,7 @@ XSModel model = getSchemaModel(xmlType, Derived.class); - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, getJavaWSDLMapping()); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -145,7 +146,7 @@ exp.composite = sub; - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, getJavaWSDLMapping()); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -32,7 +32,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory; @@ -70,7 +71,7 @@ XSModel model = getSchemaModel(); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/docstyle/DocumentStyleUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -30,7 +30,8 @@ import org.apache.xerces.xs.XSModel; import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory; @@ -66,7 +67,7 @@ EchoString_RequestStruct exp = new EchoString_RequestStruct("Hello", "world!"); - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_JAVA_MAPPING, getJavaWSDLMapping()); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeMarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeMarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -29,7 +29,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBMarshallerImpl; +import org.jboss.ws.jaxb.JBossXBMarshallerImpl; +import org.jboss.ws.jaxb.JAXBMarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping; @@ -72,7 +73,7 @@ XSModel model = generateSchemaXSModel(xmlType, SimpleUserType.class); StringWriter strwr; - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -103,7 +104,7 @@ StringWriter strwr; try { - JAXBMarshallerImpl marshaller = new JAXBMarshallerImpl(); + JAXBMarshaller marshaller = new JBossXBMarshallerImpl(); marshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); marshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); marshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeUnmarshallerTestCase.java =================================================================== --- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-07-05 07:08:13 UTC (rev 558) +++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxb/simple/SimpleUserTypeUnmarshallerTestCase.java 2006-07-05 08:15:21 UTC (rev 559) @@ -29,7 +29,8 @@ import org.jboss.test.ws.tools.WSToolsTest; import org.jboss.util.xml.DOMUtils; import org.jboss.ws.jaxb.JAXBConstants; -import org.jboss.ws.jaxb.JAXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JBossXBUnmarshallerImpl; +import org.jboss.ws.jaxb.JAXBUnmarshaller; import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping; import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping; @@ -64,7 +65,7 @@ XSModel model = generateSchemaXSModel(xmlType, SimpleUserType.class); SimpleUserType obj = null; - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); @@ -87,7 +88,7 @@ XSModel model = generateSchemaXSModel(xmlType, SimpleUserType.class); SimpleUserType obj = null; - JAXBUnmarshallerImpl unmarshaller = new JAXBUnmarshallerImpl(); + JAXBUnmarshaller unmarshaller = new JBossXBUnmarshallerImpl(); unmarshaller.setProperty(JAXBConstants.JAXB_XS_MODEL, model); unmarshaller.setProperty(JAXBConstants.JAXB_ROOT_QNAME, xmlName); unmarshaller.setProperty(JAXBConstants.JAXB_TYPE_QNAME, xmlType); |
From: <jbo...@li...> - 2006-07-05 07:08:25
|
Author: hei...@jb... Date: 2006-07-05 03:08:13 -0400 (Wed, 05 Jul 2006) New Revision: 558 Modified: branches/jbossws-1.0/src/main/java/javax/jws/WebMethod.java branches/jbossws-1.0/src/main/java/javax/jws/WebService.java branches/jbossws-1.0/src/main/java/org/jboss/ws/handler/HandlerWrapper.java branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java Log: removed illegal characters Modified: branches/jbossws-1.0/src/main/java/javax/jws/WebMethod.java =================================================================== --- branches/jbossws-1.0/src/main/java/javax/jws/WebMethod.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/javax/jws/WebMethod.java 2006-07-05 07:08:13 UTC (rev 558) @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** - * Specifies that the given method is exposed as a Web Service operation, making it part of the Web Services public + * Specifies that the given method is exposed as a Web Service operation, making it part of the Web Service public * contract. A WebMethod annotation is required for each method that is published by the Web Service. The associated * method must be public and its parameters return value, and exceptions must follow the rules defined in JAX-RPC 1.1, * section 5. The method is not required to throw java.rmi.RemoteException. Modified: branches/jbossws-1.0/src/main/java/javax/jws/WebService.java =================================================================== --- branches/jbossws-1.0/src/main/java/javax/jws/WebService.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/javax/jws/WebService.java 2006-07-05 07:08:13 UTC (rev 558) @@ -52,7 +52,7 @@ /** * The service name of the Web Service. Used as the name of the wsdl:service when mapped to WSDL 1.1. - * Not allowed on interfaces. Defaults to the simple name of the Java class + Service". + * Not allowed on interfaces. Defaults to the simple name of the Java class + Service. */ String serviceName() default ""; @@ -67,7 +67,7 @@ String wsdlLocation() default ""; /** - * The complete name of the service endpoint interface defining the services abstract Web Service contract. This + * The complete name of the service endpoint interface defining the service abstract Web Service contract. This * annotation allows the developer to separate the interface contract from the implementation. If this annotation * is present, the service endpoint interface is used to determine the abstract WSDL contract (portType and * bindings). The service endpoint interface may include JSR-181 annotations to customize the mapping from Java to Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/handler/HandlerWrapper.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/handler/HandlerWrapper.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/handler/HandlerWrapper.java 2006-07-05 07:08:13 UTC (rev 558) @@ -170,7 +170,7 @@ /** * As defined by JAX-RPC, a RuntimeException(other than SOAPFaultException) thrown from any method of - * the Handler results in the destroymethod being invoked and transition to the Does Not Exist state. + * the Handler results in the destroymethod being invoked and transition to the 'Does Not Exist' state. */ private boolean handleRuntimeException(RuntimeException e) { Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/NCName.java 2006-07-05 07:08:13 UTC (rev 558) @@ -30,7 +30,7 @@ /** * The value space of the wsdls:NCName type is the subset of the value space of the wsdls:Token type - * consisting of tokens that do not contain the space (#x20) and : characters. + * consisting of tokens that do not contain the space (#x20) and ':' characters. * * @author Tho...@jb... * @since 10-Oct-2004 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2006-07-05 07:08:13 UTC (rev 558) @@ -45,7 +45,7 @@ * The top level Definitions component is just a container for two categories of components; * WSDL components and type system components. WSDL components are interfaces, bindings and services. * - * Type system components describe the constraints on a messages content. + * Type system components describe the constraints on a message content. * * @author Tho...@jb... * @since 10-Oct-2004 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLImport.java 2006-07-05 07:08:13 UTC (rev 558) @@ -48,7 +48,7 @@ * NOT match the actual value of the enclosing WSDL document targetNamespace attribute * information item. If the import statement results in the import of a WSDL document then the actual value * of the namespace attribute information item MUST be identical to the actual value of the imported - * WSDL documents targetNamespace attribute information item. */ + * WSDL document's targetNamespace attribute information item. */ private String namespace; /** The OPTIONAL location attribute information item is of type xs:anyURI . Its actual value is the location of Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-07-04 19:04:41 UTC (rev 557) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/wsdl/WSDLInterfaceOperationInfault.java 2006-07-05 07:08:13 UTC (rev 558) @@ -40,7 +40,7 @@ private WSDLInterfaceOperation wsdlInterfaceOperation; /** A REQUIRED reference to an Interface Fault component in the {faults} property of the parent - * Interface Operation components parent Interface component. Identifying the Interface Fault + * Interface Operation component's parent Interface component. Identifying the Interface Fault * component therefore indirectly defines the actual content or payload of the fault message. */ private QName ref; |
Author: mar...@jb... Date: 2006-07-04 19:09:51 -0400 (Tue, 04 Jul 2006) New Revision: 4905 Added: labs/jbossrules/trunk/drools-jsr94/src/test/resources/org/drools/jsr94/rules/sisters.xml Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatelessRuleSessionTest.java Log: JBRULES-355 Enable XML rule language support with createRuleExecutionSet JSR 94 API -Changed the xml property key -Streamlined the LocalExecutionSetProviderImpl Modified: labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-07-03 20:47:34 UTC (rev 4904) +++ labs/jbossrules/trunk/drools-jsr94/src/main/java/org/drools/jsr94/rules/admin/LocalRuleExecutionSetProviderImpl.java 2006-07-04 23:09:51 UTC (rev 4905) @@ -73,30 +73,12 @@ * @return The created <code>RuleExecutionSet</code>. */ public RuleExecutionSet createRuleExecutionSet(final InputStream ruleExecutionSetStream, - final Map properties) throws RuleExecutionSetCreateException { - try { - final PackageBuilder builder = new PackageBuilder(); - if ( properties != null && properties.containsKey( "dsl" ) ) { - final Reader dsl = new StringReader( (String) properties.get( "dsl" ) ); - builder.addPackageFromDrl( new InputStreamReader( ruleExecutionSetStream ), - dsl ); - } else if (properties != null && properties.containsKey( "xml" ) ) { - builder.addPackageFromXml(new InputStreamReader( ruleExecutionSetStream ) ); - } else { - builder.addPackageFromDrl( new InputStreamReader( ruleExecutionSetStream ) ); - } - final Package pkg = builder.getPackage(); - return this.createRuleExecutionSet( pkg, - properties ); - } catch ( final IOException e ) { - throw new RuleExecutionSetCreateException( "cannot create rule execution set", - e ); - } catch ( final DroolsParserException e ) { - throw new RuleExecutionSetCreateException( "cannot create rule execution set", - e ); - } + final Map properties) throws RuleExecutionSetCreateException { + return createRuleExecutionSet( new InputStreamReader( ruleExecutionSetStream ), properties); } + + /** * Creates a <code>RuleExecutionSet</code> implementation using a supplied * character stream Reader and additional Drools-specific properties. A @@ -118,28 +100,48 @@ final Map properties) throws RuleExecutionSetCreateException { try { final PackageBuilder builder = new PackageBuilder(); - if ( properties != null && properties.containsKey( "dsl" ) ) { - final Reader dsl = new StringReader( (String) properties.get( "dsl" ) ); - builder.addPackageFromDrl( ruleExecutionSetReader, - dsl ); - } else if (properties != null && properties.containsKey( "xml" )) { - builder.addPackageFromXml( ruleExecutionSetReader ); + String dsl = null; + String source = null; + + if ( properties != null ) { + dsl = ( String ) properties.get( "dsl" ); + source = ( String ) properties.get( "source" ); + } + + if ( source == null ) { + source = "drl"; + } + + + if ( dsl == null ) { + if ( source.equals( "xml" ) ) { + builder.addPackageFromXml( ruleExecutionSetReader ); + } else { + builder.addPackageFromDrl( ruleExecutionSetReader ); + } } else { - builder.addPackageFromDrl( ruleExecutionSetReader ); + if ( source.equals( "xml" ) ) { + // xml cannot specify a dsl + builder.addPackageFromXml( ruleExecutionSetReader ); + } else { + builder.addPackageFromDrl( ruleExecutionSetReader, + new StringReader( dsl ) ); + } } - + final Package pkg = builder.getPackage(); - return this.createRuleExecutionSet( pkg, - properties ); + return createRuleExecutionSet( pkg, + properties ); } catch ( final IOException e ) { throw new RuleExecutionSetCreateException( "cannot create rule execution set", e ); } catch ( final DroolsParserException e ) { throw new RuleExecutionSetCreateException( "cannot create rule execution set", e ); - } + } } - + + /** * Creates a <code>RuleExecutionSet</code> implementation from a * Drools-specific AST representation and Drools-specific properties. Modified: labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatelessRuleSessionTest.java =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatelessRuleSessionTest.java 2006-07-03 20:47:34 UTC (rev 4904) +++ labs/jbossrules/trunk/drools-jsr94/src/test/java/org/drools/jsr94/rules/StatelessRuleSessionTest.java 2006-07-04 23:09:51 UTC (rev 4905) @@ -52,7 +52,7 @@ private final String bindUri = "sisters.drl"; private final String bindUri_drl = "sisters_expander.drl"; private final String bindUri_dsl = "sisters_expander.dsl"; - private final String bindUri_xml = "sisters.xml"; + private final String bindUri_xml = "sisters.xml"; private final String bindUri_globals = "sisters_globals.drl"; /** @@ -73,18 +73,18 @@ this.sessionBuilder.addRuleExecutionSet( this.bindUri_drl, StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_drl ), map ); + final Map map_xml = new HashMap(); - map_xml.put( "xml", "xml" ); + map_xml.put( "source", + "xml" ); this.sessionBuilder.addRuleExecutionSet( this.bindUri_xml, - StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ), - map_xml ); + StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ), + map_xml ); - this.sessionBuilder.addRuleExecutionSet( this.bindUri_globals, StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_globals ) ); } - /* * Taken from DRLParser @@ -103,59 +103,63 @@ return text; } - public void testCreateRuleExecutionSetFromStreamWithXml(){ - - try { - final Map map_xml = new HashMap(); - map_xml.put( "xml", "xml" ); - - RuleServiceProvider ruleServiceProvider; - RuleServiceProviderManager.registerRuleServiceProvider( "http://drools.org/", - RuleServiceProviderImpl.class ); + public void testCreateRuleExecutionSetFromStreamWithXml() { - ruleServiceProvider = RuleServiceProviderManager.getRuleServiceProvider( "http://drools.org/" ); + try { + final Map map = new HashMap(); + map.put( "source", + "xml" ); - LocalRuleExecutionSetProvider ruleSetProvider = ruleServiceProvider.getRuleAdministrator().getLocalRuleExecutionSetProvider( null ); - final RuleExecutionSet ruleExecutionSet = ruleSetProvider.createRuleExecutionSet( StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ), - map_xml ); - assertNotNull(ruleExecutionSet); - } catch (RemoteException e) { - fail(); - } catch (ConfigurationException e) { - fail(); - } catch (RuleExecutionSetCreateException e) { - fail(); - } catch (IOException e) { - fail(); - } + RuleServiceProvider ruleServiceProvider; + RuleServiceProviderManager.registerRuleServiceProvider( "http://drools.org/", + RuleServiceProviderImpl.class ); + + ruleServiceProvider = RuleServiceProviderManager.getRuleServiceProvider( "http://drools.org/" ); + + LocalRuleExecutionSetProvider ruleSetProvider = ruleServiceProvider.getRuleAdministrator().getLocalRuleExecutionSetProvider( null ); + final RuleExecutionSet ruleExecutionSet = ruleSetProvider.createRuleExecutionSet( StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ), + map ); + assertNotNull( ruleExecutionSet ); + } catch ( RemoteException e ) { + fail(); + } catch ( ConfigurationException e ) { + fail(); + } catch ( RuleExecutionSetCreateException e ) { + fail(); + } catch ( IOException e ) { + fail(); + } } -public void testCreateRuleExecutionSetFromStreamReaderWithXml(){ - try { - final Map map_xml = new HashMap(); - map_xml.put( "xml", "xml" ); - - RuleServiceProvider ruleServiceProvider; - RuleServiceProviderManager.registerRuleServiceProvider( "http://drools.org/", - RuleServiceProviderImpl.class ); - ruleServiceProvider = RuleServiceProviderManager.getRuleServiceProvider( "http://drools.org/" ); + public void testCreateRuleExecutionSetFromStreamReaderWithXml() { + try { + final Map map = new HashMap(); + map.put( "source", + "xml" ); - LocalRuleExecutionSetProvider ruleSetProvider = ruleServiceProvider.getRuleAdministrator().getLocalRuleExecutionSetProvider( null ); - final Reader ruleReader = new InputStreamReader( StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ) ); - final RuleExecutionSet ruleExecutionSet = ruleSetProvider.createRuleExecutionSet( ruleReader, - map_xml ); - assertNotNull(ruleExecutionSet); + RuleServiceProvider ruleServiceProvider; + RuleServiceProviderManager.registerRuleServiceProvider( "http://drools.org/", + RuleServiceProviderImpl.class ); - } catch (RemoteException e) { - fail(); - } catch (ConfigurationException e) { - fail(); - } catch (RuleExecutionSetCreateException e) { - fail(); - } catch (IOException e) { - fail(); - } + ruleServiceProvider = RuleServiceProviderManager.getRuleServiceProvider( "http://drools.org/" ); + + LocalRuleExecutionSetProvider ruleSetProvider = ruleServiceProvider.getRuleAdministrator().getLocalRuleExecutionSetProvider( null ); + final Reader ruleReader = new InputStreamReader( StatelessRuleSessionTest.class.getResourceAsStream( this.bindUri_xml ) ); + final RuleExecutionSet ruleExecutionSet = ruleSetProvider.createRuleExecutionSet( ruleReader, + map ); + assertNotNull( ruleExecutionSet ); + + } catch ( RemoteException e ) { + fail(); + } catch ( ConfigurationException e ) { + fail(); + } catch ( RuleExecutionSetCreateException e ) { + fail(); + } catch ( IOException e ) { + fail(); + } } + /** * Test executeRules with globals. */ @@ -263,6 +267,7 @@ statelessSession.release(); } + /** * Test executeRules with normal drl. */ Added: labs/jbossrules/trunk/drools-jsr94/src/test/resources/org/drools/jsr94/rules/sisters.xml =================================================================== --- labs/jbossrules/trunk/drools-jsr94/src/test/resources/org/drools/jsr94/rules/sisters.xml 2006-07-03 20:47:34 UTC (rev 4904) +++ labs/jbossrules/trunk/drools-jsr94/src/test/resources/org/drools/jsr94/rules/sisters.xml 2006-07-04 23:09:51 UTC (rev 4905) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package name="SistersRules" + xmlns="http://drools.org/drools-3.0" + xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" + xs:schemaLocation="http://drools.org/drools-3.0 drools-3.0.xsd"> + + <import name="org.drools.jsr94.rules.Person" /> + + <rule name="FindSisters"> + <lhs> + <column object-type="Person" identifier="$person1"> + <field-binding field-name="name" identifier="$name1" /> + </column> + + <column object-type="Person" identifier="$person2"> + <field-binding field-name="name" identifier="$name2" /> + </column> + <eval>$person1.hasSister($person2)</eval> + </lhs> + + <rhs> + System.out.println($person1.getName() + " and " + $person2.getName() +" are sisters"); + assert( $person1.getName() + " and " + $person2.getName() +" are sisters"); + </rhs> + </rule> +</package> \ No newline at end of file |
From: <jbo...@li...> - 2006-07-04 19:04:46
|
Author: hei...@jb... Date: 2006-07-04 15:04:41 -0400 (Tue, 04 Jul 2006) New Revision: 557 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java Log: docs and comments Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java 2006-07-04 19:04:16 UTC (rev 556) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/ThreadLocalAssociation.java 2006-07-04 19:04:41 UTC (rev 557) @@ -13,26 +13,25 @@ */ public class ThreadLocalAssociation { - /** - * Handles invocations on MDB endpoints. - * - * @see org.jboss.ws.server.ServiceEndpointInvokerMDB - */ - private static ThreadLocal invokerMDBAssoc = new ThreadLocal(); + /** + * Handles invocations on MDB endpoints. + */ + private static ThreadLocal invokerMDBAssoc = new ThreadLocal(); - /** - * SOAP message context - * @see org.jboss.ws.soap.MessageContextAssociation - */ - private static ThreadLocal<Stack<SOAPMessageContextImpl>> msgContextAssoc = new InheritableThreadLocal<Stack<SOAPMessageContextImpl>>(); + /** + * SOAP message context + * @see org.jboss.ws.soap.MessageContextAssociation + */ + private static ThreadLocal<Stack<SOAPMessageContextImpl>> msgContextAssoc = new InheritableThreadLocal<Stack<SOAPMessageContextImpl>>(); - /** - * @see org.jboss.ws.wsse.STRTransform - */ - private static InheritableThreadLocal<SecurityStore> strTransformAssoc = new InheritableThreadLocal<SecurityStore>(); + /** + * @see org.jboss.ws.wsse.STRTransform + */ + private static InheritableThreadLocal<SecurityStore> strTransformAssoc = new InheritableThreadLocal<SecurityStore>(); /** * Stores XOP callee information + * @see org.jboss.ws.xop.XOPContext#doInlineBase64 */ private static ThreadLocal<Boolean> XOPInlineAssoc = new ThreadLocal<Boolean>() { @@ -40,26 +39,26 @@ return Boolean.FALSE; } }; - public static ThreadLocal localInvokerMDBAssoc() { - return invokerMDBAssoc; - } + public static ThreadLocal localInvokerMDBAssoc() { + return invokerMDBAssoc; + } - public static ThreadLocal<Stack<SOAPMessageContextImpl>> localMsgContextAssoc() { - return msgContextAssoc; - } + public static ThreadLocal<Stack<SOAPMessageContextImpl>> localMsgContextAssoc() { + return msgContextAssoc; + } - public static ThreadLocal<SecurityStore> localStrTransformAssoc() { - return strTransformAssoc; - } + public static ThreadLocal<SecurityStore> localStrTransformAssoc() { + return strTransformAssoc; + } public static ThreadLocal<Boolean> localXOPCalleeAssoc() { return XOPInlineAssoc; } - public static void clear() { - invokerMDBAssoc.set(null); - msgContextAssoc.set(null); - strTransformAssoc.set(null); + public static void clear() { + invokerMDBAssoc.set(null); + msgContextAssoc.set(null); + strTransformAssoc.set(null); XOPInlineAssoc.set(null); - } + } } |
From: <jbo...@li...> - 2006-07-04 19:04:22
|
Author: hei...@jb... Date: 2006-07-04 15:04:16 -0400 (Tue, 04 Jul 2006) New Revision: 556 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java Log: cleanup Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java 2006-07-04 19:03:58 UTC (rev 555) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java 2006-07-04 19:04:16 UTC (rev 556) @@ -52,11 +52,14 @@ import org.xml.sax.Attributes; /** - * An implementation of a JAXB Unmarshaller. + * Create SchemaBinding from XSModel and jaxrpc-mapping. * * @author Tho...@jb... * @author Ale...@jb... * @since 18-Oct-2004 + * + * @see XSModel + * @see JavaWsdlMapping */ public class SchemaBindingBuilder { @@ -144,31 +147,36 @@ TypeBinding typeBinding = getTypeBinding(schemaBinding, typeMapping); if (typeBinding != null) { - // Set the java type - ClassMetaData classMetaData = typeBinding.getClassMetaData(); - if (classMetaData == null) + // Set the java type, but skip SimpleTypes + boolean isSimpleTypeBinding = (typeBinding instanceof SimpleTypeBinding); + + if(isSimpleTypeBinding == false) { - classMetaData = new ClassMetaData(); - if( (typeBinding instanceof SimpleTypeBinding) == false ) + ClassMetaData classMetaData = typeBinding.getClassMetaData(); + if (classMetaData == null) + { + classMetaData = new ClassMetaData(); typeBinding.setClassMetaData(classMetaData); - } - classMetaData.setImpl(javaType); + } - // exception mapping drives whether we should use the noarg ctor - JavaWsdlMapping wsdlMapping = typeMapping.getJavaWsdlMapping(); - for (ExceptionMapping aux : wsdlMapping.getExceptionMappings()) - { - if (javaType.equals(aux.getExceptionType())) + classMetaData.setImpl(javaType); + + // exception mapping drives whether we should use the noarg ctor + JavaWsdlMapping wsdlMapping = typeMapping.getJavaWsdlMapping(); + for (ExceptionMapping aux : wsdlMapping.getExceptionMappings()) { - classMetaData.setUseNoArgCtor(false); - break; + if (javaType.equals(aux.getExceptionType())) + { + classMetaData.setUseNoArgCtor(false); + break; + } } - } - if (log.isTraceEnabled()) - { - QName typeQName = typeBinding.getQName(); - log.trace("Bound: [xmlType=" + typeQName + ",javaType=" + javaType + "]"); + if (log.isTraceEnabled()) + { + QName typeQName = typeBinding.getQName(); + log.trace("Bound: [xmlType=" + typeQName + ",javaType=" + javaType + "]"); + } } VariableMapping[] variableMappings = typeMapping.getVariableMappings(); |
From: <jbo...@li...> - 2006-07-04 19:04:02
|
Author: hei...@jb... Date: 2006-07-04 15:03:58 -0400 (Tue, 04 Jul 2006) New Revision: 555 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java Log: disable introspection cache Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java 2006-07-04 18:41:12 UTC (rev 554) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBMarshallerImpl.java 2006-07-04 19:03:58 UTC (rev 555) @@ -35,6 +35,7 @@ import org.jboss.xb.binding.MappingObjectModelProvider; import org.jboss.xb.binding.MarshallingContext; import org.jboss.xb.binding.ObjectLocalMarshaller; +import org.jboss.xb.binding.introspection.ClassInfos; import org.jboss.xb.binding.sunday.marshalling.MarshallerImpl; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.util.Dom2Sax; @@ -67,6 +68,9 @@ public JAXBMarshallerImpl() { + + ClassInfos.disableCache(); + delegate = new MarshallerImpl(); delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_XML_VERSION, "false"); delegate.setProperty(org.jboss.xb.binding.Marshaller.PROP_OUTPUT_INDENTATION, "false"); Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java 2006-07-04 18:41:12 UTC (rev 554) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/JAXBUnmarshallerImpl.java 2006-07-04 19:03:58 UTC (rev 555) @@ -30,6 +30,7 @@ import org.jboss.ws.xop.XOPUnmarshallerImpl; import org.jboss.xb.binding.JBossXBException; import org.jboss.xb.binding.UnmarshallerFactory; +import org.jboss.xb.binding.introspection.ClassInfos; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; /** @@ -49,6 +50,9 @@ */ public Object unmarshal(InputStream is) throws UnmarshalException { + + ClassInfos.disableCache(); + assertRequiredProperties(); org.jboss.xb.binding.Unmarshaller unm = UnmarshallerFactory.newInstance().newUnmarshaller(); |
From: <jbo...@li...> - 2006-07-04 18:41:17
|
Author: hei...@jb... Date: 2006-07-04 14:41:12 -0400 (Tue, 04 Jul 2006) New Revision: 554 Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java Log: Simple types cannot be associated with classMetaData Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java =================================================================== --- branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java 2006-07-04 16:42:35 UTC (rev 553) +++ branches/jbossws-1.0/src/main/java/org/jboss/ws/jaxb/SchemaBindingBuilder.java 2006-07-04 18:41:12 UTC (rev 554) @@ -148,8 +148,9 @@ ClassMetaData classMetaData = typeBinding.getClassMetaData(); if (classMetaData == null) { - classMetaData = new ClassMetaData(); - typeBinding.setClassMetaData(classMetaData); + classMetaData = new ClassMetaData(); + if( (typeBinding instanceof SimpleTypeBinding) == false ) + typeBinding.setClassMetaData(classMetaData); } classMetaData.setImpl(javaType); |
Author: tho...@jb... Date: 2006-07-04 12:42:35 -0400 (Tue, 04 Jul 2006) New Revision: 553 Added: trunk/src/main/java/org/jboss/ws/client/ trunk/src/main/java/org/jboss/ws/client/CommonClient.java trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/jaxws/client/ trunk/src/main/java/org/jboss/ws/jaxws/client/BindingImpl.java trunk/src/main/java/org/jboss/ws/jaxws/client/BindingProviderImpl.java trunk/src/main/java/org/jboss/ws/jaxws/client/JAXWSClient.java trunk/src/main/java/org/jboss/ws/jaxws/client/PortProxy.java trunk/src/main/java/org/jboss/ws/jaxws/spi/ trunk/src/main/java/org/jboss/ws/jaxws/spi/ProviderImpl.java trunk/src/main/java/org/jboss/ws/jaxws/spi/ServiceDelegateImpl.java trunk/src/main/java/org/jboss/ws/jaxws/util/ trunk/src/main/java/org/jboss/ws/jaxws/util/FactoryFinder.java Removed: trunk/src/test/resources/samples/jsr181ejb/META-INF/application-client.xml trunk/src/test/resources/samples/jsr181ejb/META-INF/jboss-client.xml trunk/src/test/resources/samples/jsr181ejb/wstools-config.xml trunk/src/test/resources/samples/jsr181pojo/META-INF/application-client.xml trunk/src/test/resources/samples/jsr181pojo/META-INF/jboss-client.xml trunk/src/test/resources/samples/jsr181pojo/wstools-config.xml Modified: trunk/src/main/java/javax/xml/ws/Service.java trunk/src/main/java/javax/xml/ws/spi/Provider.java trunk/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java trunk/src/main/java/org/jboss/ws/deployment/AbstractMetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java trunk/src/main/java/org/jboss/ws/metadata/MetaDataExtension.java trunk/src/main/java/org/jboss/ws/metadata/TypesMetaData.java trunk/src/main/java/org/jboss/ws/soap/SOAPConnectionImpl.java trunk/src/test/ant/build-jars.xml trunk/src/test/build.xml trunk/src/test/java/org/jboss/test/ws/jbws871/RpcArrayEndpointImpl.java trunk/src/test/java/org/jboss/test/ws/samples/jsr181ejb/JSR181WebServiceEJB3TestCase.java trunk/src/test/java/org/jboss/test/ws/samples/jsr181pojo/JSR181WebServiceJSETestCase.java Log: Implement javax.xml.ws.Service Modified: trunk/src/main/java/javax/xml/ws/Service.java =================================================================== --- trunk/src/main/java/javax/xml/ws/Service.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/javax/xml/ws/Service.java 2006-07-04 16:42:35 UTC (rev 553) @@ -127,11 +127,17 @@ delegate.setExecutor(executor); } + /** + * Create a Service instance. The specified WSDL document location and service qualified name must uniquely identify a wsdl:service element. + */ public static Service create(URL wsdlDocumentLocation, QName serviceName) { return new Service(wsdlDocumentLocation, serviceName); } + /** + * Create a Service instance. + */ public static Service create(QName serviceName) { return new Service(null, serviceName); Modified: trunk/src/main/java/javax/xml/ws/spi/Provider.java =================================================================== --- trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-07-04 16:42:35 UTC (rev 553) @@ -21,12 +21,16 @@ */ package javax.xml.ws.spi; +// $Id$ + import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Endpoint; import javax.xml.ws.WebServiceException; +import org.jboss.ws.jaxws.util.FactoryFinder; + /** * Service provider for ServiceDelegate and Endpoint objects. * @@ -42,11 +46,20 @@ { } + /** + * The algorithm used to locate the provider subclass to use consists of the following steps: + * + * - If a resource with the name of META-INF/services/javax.xml.ws.spi.Provider exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class. + * - If the $java.home/lib/jaxws.properties file exists and it is readable by the java.util.Properties.load(InputStream) method and it contains an entry whose key is javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class. + * - If a system property with the name javax.xml.ws.spi.Provider is defined, then its value is used as the name of the implementation class. + * + * Finally, a default implementation class name is used. + */ public static Provider provider() { try { - return null; //(Provider)FactoryFinder.find(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER); + return (Provider)FactoryFinder.find(JAXWSPROVIDER_PROPERTY, DEFAULT_JAXWSPROVIDER); } catch (Exception ex) { Modified: trunk/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java =================================================================== --- trunk/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/addressing/metadata/AddressingOpMetaExt.java 2006-07-04 16:42:35 UTC (rev 553) @@ -1,9 +1,30 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ package org.jboss.ws.addressing.metadata; +// $Id$ + import org.jboss.ws.metadata.MetaDataExtension; -import javax.xml.namespace.QName; - /** * Addressing meta data extensions: * <ul> @@ -12,28 +33,33 @@ * @author Heiko Braun, <he...@op...> * @since 17-Mar-2006 */ -public class AddressingOpMetaExt extends MetaDataExtension { - +public class AddressingOpMetaExt extends MetaDataExtension +{ private String inboundAction; - private String outboundAction; + private String outboundAction; - public AddressingOpMetaExt(String extensionNameSpace) { + public AddressingOpMetaExt(String extensionNameSpace) + { super(extensionNameSpace); } - public String getInboundAction() { + public String getInboundAction() + { return inboundAction; } - public void setInboundAction(String inboundAction) { + public void setInboundAction(String inboundAction) + { this.inboundAction = inboundAction; } - public String getOutboundAction() { + public String getOutboundAction() + { return outboundAction; } - public void setOutboundAction(String outboundAction) { + public void setOutboundAction(String outboundAction) + { this.outboundAction = outboundAction; } Added: trunk/src/main/java/org/jboss/ws/client/CommonClient.java =================================================================== --- trunk/src/main/java/org/jboss/ws/client/CommonClient.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/client/CommonClient.java 2006-07-04 16:42:35 UTC (rev 553) @@ -0,0 +1,381 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.client; + +// $Id$ + +import java.net.MalformedURLException; +import java.net.URL; +import java.rmi.RemoteException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.xml.namespace.QName; +import javax.xml.rpc.ParameterMode; +import javax.xml.rpc.handler.MessageContext; +import javax.xml.rpc.soap.SOAPFaultException; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPMessage; +import javax.xml.ws.addressing.AddressingProperties; +import javax.xml.ws.addressing.JAXWSAConstants; + +import org.jboss.logging.Logger; +import org.jboss.ws.Constants; +import org.jboss.ws.WSException; +import org.jboss.ws.addressing.AddressingConstantsImpl; +import org.jboss.ws.binding.BindingProvider; +import org.jboss.ws.binding.BindingProviderRegistry; +import org.jboss.ws.binding.EndpointInvocation; +import org.jboss.ws.binding.UnboundHeader; +import org.jboss.ws.jaxrpc.ParameterWrapping; +import org.jboss.ws.jaxrpc.Style; +import org.jboss.ws.metadata.ClientEndpointMetaData; +import org.jboss.ws.metadata.EndpointMetaData; +import org.jboss.ws.metadata.OperationMetaData; +import org.jboss.ws.metadata.ParameterMetaData; +import org.jboss.ws.metadata.ServiceMetaData; +import org.jboss.ws.metadata.UnifiedMetaData; +import org.jboss.ws.soap.EndpointInfo; +import org.jboss.ws.soap.MessageContextAssociation; +import org.jboss.ws.soap.SOAPConnectionImpl; +import org.jboss.ws.soap.SOAPMessageContextImpl; +import org.jboss.ws.utils.HolderUtils; +import org.jboss.ws.utils.JavaUtils; + +/** + * Provides support for the dynamic invocation of a service endpoint. + * + * @author Tho...@jb... + * @since 10-Oct-2004 + */ +public abstract class CommonClient +{ + // provide logging + private static Logger log = Logger.getLogger(CommonClient.class); + + // The endpoint together with the operationName uniquely identify the call operation + protected EndpointMetaData epMetaData; + // The current operation name + protected QName operationName; + // Output parameters + protected EndpointInvocation epInv; + + /** Create a call that needs to be configured manually + */ + protected CommonClient(ServiceMetaData serviceMetaData) + { + // If the WSDLService has only one endpoint, use it + if (serviceMetaData != null && serviceMetaData.getEndpoints().size() == 1) + { + this.epMetaData = serviceMetaData.getEndpoints().get(0); + } + } + + /** Create a call for a known WSDL endpoint. + */ + protected CommonClient(EndpointMetaData epMetaData) + { + this.epMetaData = epMetaData; + } + + /** Create a call for a known WSDL endpoint. + */ + protected CommonClient(ServiceMetaData serviceMetaData, QName portName, QName opName) + { + if (serviceMetaData != null) + { + EndpointMetaData epMetaData = null; + if (serviceMetaData.getEndpoints().size() > 0) + { + epMetaData = serviceMetaData.getEndpoint(portName); + if (epMetaData == null) + throw new WSException("Cannot find endpoint for name: " + portName); + } + + if (epMetaData != null) + { + this.epMetaData = epMetaData; + } + } + + if (opName != null) + { + setOperationName(opName); + } + } + + /** Gets the address of a target service endpoint. + */ + public abstract String getTargetEndpointAddress(); + + /** Sets the address of the target service endpoint. + */ + public abstract void setTargetEndpointAddress(String address); + + /** Gets the name of the operation to be invoked using this Call instance. + */ + public QName getOperationName() + { + return this.operationName; + } + + /** Sets the name of the operation to be invoked using this Call instance. + */ + public void setOperationName(QName operationName) + { + this.operationName = operationName; + } + + /** Get the OperationMetaData for the given operation name + * If it does not exist, it will be created + */ + public OperationMetaData getOperationMetaData() + { + if (operationName == null) + throw new WSException("Operation name not set"); + + return getOperationMetaData(operationName); + } + + /** Get the OperationMetaData for the given operation name + * If it does not exist, it will be created + */ + public OperationMetaData getOperationMetaData(QName opName) + { + if (opName == null) + throw new IllegalArgumentException("Cannot get OperationMetaData for null"); + + EndpointMetaData epMetaData = getEndpointMetaData(); + OperationMetaData opMetaData = epMetaData.getOperation(opName); + if (opMetaData == null && epMetaData.getServiceMetaData().getWsdlDefinitions() == null) + { + opMetaData = new OperationMetaData(epMetaData, opName, opName.getLocalPart()); + epMetaData.addOperation(opMetaData); + } + + if (opMetaData == null) + throw new WSException("Cannot obtain operation meta data for: " + opName); + + return opMetaData; + } + + // Get the EndpointMetaData for all OperationMetaData + public EndpointMetaData getEndpointMetaData() + { + if (epMetaData == null) + { + UnifiedMetaData wsMetaData = new UnifiedMetaData(); + ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousService")); + wsMetaData.addService(serviceMetaData); + + epMetaData = new ClientEndpointMetaData(serviceMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousEndpoint")); + epMetaData.setStyle(Style.RPC); + + serviceMetaData.addEndpoint(epMetaData); + } + return epMetaData; + } + + protected abstract boolean callRequestHandlerChain(QName portName, SOAPMessageContextImpl msgContext); + + protected abstract boolean callResponseHandlerChain(QName portName, SOAPMessageContextImpl msgContext); + + /** Call invokation goes as follows: + * + * 1) synchronize the operation name with the operation meta data + * 2) synchronize the input parameters with the operation meta data + * 3) generate the payload using a BindingProvider + * 4) get the Invoker from Remoting, based on the target endpoint address + * 5) do the invocation through the Remoting framework + * 6) unwrap the result using the BindingProvider + * 7) return the result + */ + protected Object invoke(QName opName, Object[] inputParams, Map<QName, UnboundHeader> unboundHeaders, boolean oneway) throws RemoteException + { + if (opName.equals(operationName) == false) + setOperationName(opName); + + OperationMetaData opMetaData = getOperationMetaData(); + + // Associate a message context with the current thread + SOAPMessageContextImpl msgContext = new SOAPMessageContextImpl(); + MessageContextAssociation.pushMessageContext(msgContext); + msgContext.setOperationMetaData(opMetaData); + + // copy properties to the message context + for (String key : getRequestContext().keySet()) + { + Object value = getRequestContext().get(key); + msgContext.setProperty(key, value); + } + + try + { + // Get the binding provider for the given bindingURI + BindingProvider bindingProvider = BindingProviderRegistry.getDefaultProvider(); + + // Create the invocation and sync the input parameters + epInv = new EndpointInvocation(opMetaData); + epInv.initInputParams(inputParams); + + // Bind the request message + SOAPMessage reqMessage = bindingProvider.bindRequestMessage(opMetaData, epInv, unboundHeaders); + + // Call the request handlers + QName portName = epMetaData.getQName(); + + if (callRequestHandlerChain(portName, msgContext)) + { + String targetAddress = getTargetEndpointAddress(); + + // Fall back to wsa:To + AddressingProperties addrProps = (AddressingProperties)msgContext.getProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND); + if (targetAddress == null && addrProps != null && addrProps.getTo() != null) + { + AddressingConstantsImpl ADDR = new AddressingConstantsImpl(); + String wsaTo = addrProps.getTo().getURI().toString(); + if (wsaTo.equals(ADDR.getAnonymousURI()) == false) + { + try + { + URL wsaToURL = new URL(wsaTo); + log.debug("Sending request to addressing destination: " + wsaToURL); + targetAddress = wsaToURL.toExternalForm(); + } + catch (MalformedURLException ex) + { + log.debug("Not a valid URL: " + wsaTo); + } + } + } + + // The endpoint address must be known beyond this point + if (targetAddress == null) + throw new WSException("Target endpoint address not set"); + + // Setup remoting call properties + Map<String, Object> callProps = new HashMap<String, Object>(); + callProps.putAll(getRequestContext()); + + syncMessageProperties(callProps, msgContext); + + EndpointInfo epInfo = new EndpointInfo(epMetaData, targetAddress, callProps); + SOAPMessage resMessage = new SOAPConnectionImpl().call(reqMessage, epInfo, oneway); + + // Associate current message with message context + msgContext.setMessage(resMessage); + } + + // Get the return object + Object retObj = null; + if (oneway == false) + { + // Call the response handlers + callResponseHandlerChain(portName, msgContext); + + // unbind the return values + SOAPMessage resMessage = msgContext.getMessage(); + bindingProvider.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders); + + retObj = syncOutputParams(inputParams, epInv); + } + + return retObj; + } + catch (SOAPFaultException ex) + { + log.error("Call invocation failed", ex); + String faultCode = ex.getFaultCode().getLocalPart(); + throw new RemoteException("Call invocation failed with code [" + faultCode + "] because of: " + ex.getFaultString(), ex); + } + catch (Exception ex) + { + throw new RemoteException("Call invocation failed: " + ex.getMessage(), ex); + } + finally + { + // Snyc context properties with the stub that clients can access them + syncMessageProperties(getResponseContext(), msgContext); + + // Reset the message context association + MessageContextAssociation.popMessageContext(); + } + } + + protected abstract Map<String, Object> getRequestContext(); + + protected abstract Map<String, Object> getResponseContext(); + + private void syncMessageProperties(Map<String, Object> props, MessageContext msgContext) + { + Iterator it = msgContext.getPropertyNames(); + while (it.hasNext()) + { + String propName = (String)it.next(); + Object property = msgContext.getProperty(propName); + props.put(propName, property); + } + } + + /** Synchronize the operation paramters with the call output parameters. + */ + private Object syncOutputParams(Object[] inParams, EndpointInvocation epInv) throws SOAPException + { + Object retValue = null; + + // Assign the return value, if we have a return param + OperationMetaData opMetaData = getOperationMetaData(); + ParameterMetaData retMetaData = opMetaData.getReturnParameter(); + if (retMetaData != null) + { + retValue = epInv.getReturnValue(); + if (opMetaData.isDocumentWrapped()) + retValue = ParameterWrapping.unwrapResponseParameter(opMetaData, retValue); + + if (JavaUtils.isPrimitive(retMetaData.getJavaType())) + retValue = JavaUtils.getPrimitiveValue(retValue); + } + + // Set the holder values for INOUT parameters + int index = 0; + for (ParameterMetaData paramMetaData : opMetaData.getParameters()) + { + ParameterMode paramMode = paramMetaData.getMode(); + + if (paramMode == ParameterMode.INOUT || paramMode == ParameterMode.OUT) + { + QName xmlName = paramMetaData.getXmlName(); + Object value = epInv.getResponseParamValue(xmlName); + log.debug("holder [" + index + "] " + xmlName); + HolderUtils.setHolderValue(inParams[index], value); + } + + if (index == 0 && opMetaData.isDocumentWrapped()) + index = paramMetaData.getWrappedVariables().size() - 1; + + index++; + } + + return retValue; + } +} Property changes on: trunk/src/main/java/org/jboss/ws/client/CommonClient.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: trunk/src/main/java/org/jboss/ws/deployment/AbstractMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/AbstractMetaDataBuilder.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/deployment/AbstractMetaDataBuilder.java 2006-07-04 16:42:35 UTC (rev 553) @@ -39,15 +39,36 @@ import javax.wsdl.Service; import javax.wsdl.extensions.soap.SOAPAddress; import javax.xml.namespace.QName; +import javax.xml.ws.addressing.AddressingProperties; import org.jboss.logging.Logger; +import org.jboss.ws.Constants; import org.jboss.ws.WSException; +import org.jboss.ws.addressing.AddressingPropertiesImpl; +import org.jboss.ws.addressing.metadata.AddressingOpMetaExt; +import org.jboss.ws.eventing.EventingConstants; +import org.jboss.ws.eventing.deployment.EventingEndpoint; +import org.jboss.ws.eventing.metadata.EventingEpMetaExt; +import org.jboss.ws.jaxrpc.UnqualifiedFaultException; +import org.jboss.ws.jaxrpc.Use; +import org.jboss.ws.metadata.EndpointMetaData; +import org.jboss.ws.metadata.FaultMetaData; +import org.jboss.ws.metadata.OperationMetaData; import org.jboss.ws.metadata.ServerEndpointMetaData; +import org.jboss.ws.metadata.TypesMetaData; import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData; import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData; import org.jboss.ws.metadata.j2ee.UnifiedMessageDrivenMetaData; +import org.jboss.ws.metadata.wsdl.NCName; +import org.jboss.ws.metadata.wsdl.WSDLBinding; +import org.jboss.ws.metadata.wsdl.WSDLBindingOperation; import org.jboss.ws.metadata.wsdl.WSDLDefinitions; import org.jboss.ws.metadata.wsdl.WSDLEndpoint; +import org.jboss.ws.metadata.wsdl.WSDLInterface; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault; +import org.jboss.ws.metadata.wsdl.WSDLProperty; import org.jboss.ws.metadata.wsdl.WSDLService; import org.jboss.ws.server.ServiceEndpointManager; import org.jboss.ws.server.ServiceEndpointManagerFactory; @@ -76,6 +97,54 @@ this.resourceLoader = resourceLoader; } + /** Initialize the endpoint encoding style from the binding operations + */ + protected void initEndpointEncodingStyle(EndpointMetaData epMetaData) + { + WSDLDefinitions wsdlDefinitions = epMetaData.getServiceMetaData().getWsdlDefinitions(); + for (WSDLService wsdlService : wsdlDefinitions.getServices()) + { + for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints()) + { + if (epMetaData.getQName().equals(wsdlEndpoint.getQName())) + { + QName bindQName = wsdlEndpoint.getBinding(); + NCName ncName = new NCName(bindQName.getLocalPart()); + WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(ncName); + if (wsdlBinding == null) + throw new WSException("Cannot obtain binding: " + ncName); + + for (WSDLBindingOperation wsdlBindingOperation : wsdlBinding.getOperations()) + { + String encStyle = wsdlBindingOperation.getEncodingStyle(); + epMetaData.setEncodingStyle(Use.valueOf(encStyle)); + } + } + } + } + } + + protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions) + { + for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces()) + { + WSDLProperty eventSourceProp = wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE); + if (eventSourceProp != null && epMetaData instanceof ServerEndpointMetaData) + { + ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData; + String eventSourceNS = wsdlInterface.getQName().getNamespaceURI() + "/" + wsdlInterface.getQName().getLocalPart(); + Object notificationSchema = null; // todo: resolve schema from operation message + + EventingEpMetaExt ext = new EventingEpMetaExt(EventingConstants.NS_EVENTING); + ext.setEventSourceNS(eventSourceNS); + ext.setNotificationSchema(notificationSchema); + + sepMetaData.addExtension(ext); + sepMetaData.setManagedEndpointBean(EventingEndpoint.class.getName()); + } + } + } + protected ObjectName getServiceEndpointID(UnifiedDeploymentInfo udi, ServerEndpointMetaData sepMetaData) { String endpoint = sepMetaData.getLinkName(); @@ -110,6 +179,71 @@ return ObjectNameFactory.create(idstr.toString()); } + protected void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation) + { + TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData(); + + WSDLInterface wsdlInterface = wsdlOperation.getWsdlInterface(); + for (WSDLInterfaceOperationOutfault outFault : wsdlOperation.getOutfaults()) + { + QName ref = outFault.getRef(); + + WSDLInterfaceFault wsdlFault = wsdlInterface.getFault(new NCName(ref.getLocalPart())); + QName xmlName = wsdlFault.getXmlName(); + QName xmlType = wsdlFault.getXmlType(); + String javaTypeName = null; + + if (typesMetaData.getTypeMappingByXMLType(xmlType) != null) + javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName(); + + if (javaTypeName == null) + { + log.warn("Cannot obtain java type mapping for: " + xmlType); + javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName(); + } + + FaultMetaData faultMetaData = new FaultMetaData(opMetaData, xmlName, xmlType, javaTypeName); + opMetaData.addFault(faultMetaData); + } + } + + /** Process operation meta data extensions. */ + protected void processOpMetaExtensions(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation) + { + + String tns = wsdlOperation.getQName().getNamespaceURI(); + String portTypeName = wsdlOperation.getQName().getLocalPart(); + + AddressingProperties ADDR = new AddressingPropertiesImpl(); + AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI()); + + // inbound action + WSDLProperty wsaInAction = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_IN); + if (wsaInAction != null) + { + addrExt.setInboundAction(wsaInAction.getValue()); + } + else + { + WSDLProperty messageName = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN); + addrExt.setInboundAction(tns + "/" + portTypeName + "/" + messageName); + } + + // outbound action + WSDLProperty wsaOutAction = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_OUT); + if (wsaOutAction != null) + { + addrExt.setOutboundAction(wsaOutAction.getValue()); + } + else + { + WSDLProperty messageName = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT); + addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + messageName); + } + + opMetaData.addExtension(addrExt); + } + /** Get the web service address for a given path */ public String getServiceEndpointAddress(String uriScheme, String servicePath) Added: trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java 2006-07-04 16:42:35 UTC (rev 553) @@ -0,0 +1,338 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.ws.deployment; + +//$Id$ + +import java.io.IOException; +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.rpc.ParameterMode; +import javax.xml.rpc.encoding.TypeMappingRegistry; + +import org.jboss.logging.Logger; +import org.jboss.ws.Constants; +import org.jboss.ws.WSException; +import org.jboss.ws.jaxrpc.ParameterStyle; +import org.jboss.ws.jaxrpc.Style; +import org.jboss.ws.jaxrpc.TypeMappingImpl; +import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl; +import org.jboss.ws.metadata.ClientEndpointMetaData; +import org.jboss.ws.metadata.EndpointMetaData; +import org.jboss.ws.metadata.OperationMetaData; +import org.jboss.ws.metadata.ParameterMetaData; +import org.jboss.ws.metadata.ServiceMetaData; +import org.jboss.ws.metadata.TypeMappingMetaData; +import org.jboss.ws.metadata.TypesMetaData; +import org.jboss.ws.metadata.UnifiedMetaData; +import org.jboss.ws.metadata.wsdl.NCName; +import org.jboss.ws.metadata.wsdl.WSDLBinding; +import org.jboss.ws.metadata.wsdl.WSDLBindingOperation; +import org.jboss.ws.metadata.wsdl.WSDLDefinitions; +import org.jboss.ws.metadata.wsdl.WSDLEndpoint; +import org.jboss.ws.metadata.wsdl.WSDLInterface; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput; +import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput; +import org.jboss.ws.metadata.wsdl.WSDLService; + +/** + * A client side meta data builder. + * + * @author Tho...@jb... + * @since 19-May-2005 + */ +public class JAXWSClientMetaDataBuilder extends JAXWSMetaDataBuilder +{ + // provide logging + private final Logger log = Logger.getLogger(JAXWSClientMetaDataBuilder.class); + + /** Build from WSDL and jaxrpc-mapping.xml + */ + public ServiceMetaData buildMetaData(QName serviceQName, URL wsdlURL) + { + log.debug("START buildMetaData: [service=" + serviceQName + "]"); + try + { + UnifiedMetaData wsMetaData = new UnifiedMetaData(); + wsMetaData.setResourceLoader(resourceLoader); + wsMetaData.setClassLoader(classLoader); + + ServiceMetaData serviceMetaData = new ServiceMetaData(wsMetaData, serviceQName); + wsMetaData.addService(serviceMetaData); + + serviceMetaData.setWsdlFile(wsdlURL.toExternalForm()); + WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions(); + + buildMetaDataInternal(serviceMetaData, wsdlDefinitions); + + // eagerly initialize + wsMetaData.eagerInitialize(); + + log.debug("END buildMetaData: " + serviceMetaData); + return serviceMetaData; + } + catch (RuntimeException rte) + { + throw rte; + } + catch (Exception ex) + { + throw new WSException("Cannot build meta data: " + ex.getMessage(), ex); + } + } + + private void buildMetaDataInternal(ServiceMetaData serviceMetaData, WSDLDefinitions wsdlDefinitions) throws IOException + { + QName serviceQName = serviceMetaData.getName(); + + // Get the WSDL service + WSDLService wsdlService = null; + if (serviceQName == null) + { + if (wsdlDefinitions.getServices().length != 1) + throw new IllegalArgumentException("Expected a single service element"); + + wsdlService = wsdlDefinitions.getServices()[0]; + serviceMetaData.setName(wsdlService.getQName()); + } + else + { + wsdlService = wsdlDefinitions.getService(new NCName(serviceQName.getLocalPart())); + } + if (wsdlService == null) + throw new IllegalArgumentException("Cannot obtain wsdl service: " + serviceQName); + + // Build endpoint meta data + for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints()) + { + QName portName = wsdlEndpoint.getQName(); + ClientEndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData, portName); + epMetaData.setEndpointAddress(wsdlEndpoint.getAddress()); + serviceMetaData.addEndpoint(epMetaData); + + // Init the service encoding style + initEndpointEncodingStyle(epMetaData); + + processEndpointMetaDataExtensions(epMetaData, wsdlDefinitions); + setupOperationsFromWSDL(epMetaData, wsdlEndpoint); + } + } + + protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint wsdlEndpoint) + { + WSDLDefinitions wsdlDefinitions = wsdlEndpoint.getInterface().getWsdlDefinitions(); + + // For every WSDL interface operation build the OperationMetaData + WSDLInterface wsdlInterface = wsdlEndpoint.getInterface(); + for (WSDLInterfaceOperation wsdlOperation : wsdlInterface.getOperations()) + { + String opName = wsdlOperation.getName().toString(); + QName opQName = wsdlOperation.getQName(); + + // Set java method name + String javaName = opName.substring(0, 1).toLowerCase() + opName.substring(1); + + OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName, javaName); + epMetaData.addOperation(opMetaData); + + // Set the operation style + String style = wsdlOperation.getStyle(); + epMetaData.setStyle(Style.valueOf(style)); + + // Set the operation MEP + if (Constants.WSDL20_PATTERN_IN_ONLY.equals(wsdlOperation.getPattern())) + opMetaData.setOneWayOperation(true); + + // Set the operation SOAPAction + WSDLBinding wsdlBinding = wsdlDefinitions.getBindingByInterfaceName(wsdlInterface.getQName()); + WSDLBindingOperation wsdlBindingOperation = wsdlBinding.getOperationByRef(opQName); + if (wsdlBindingOperation != null) + opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction()); + + // Get the type mapping for the encoding style + String encStyle = epMetaData.getEncodingStyle().toURI(); + TypeMappingRegistry tmRegistry = new TypeMappingRegistryImpl(); + TypeMappingImpl typeMapping = (TypeMappingImpl)tmRegistry.getTypeMapping(encStyle); + + // Build the parameter meta data + if (opMetaData.getStyle() == Style.RPC) + { + buildParameterMetaDataRpc(opMetaData, wsdlOperation, typeMapping); + } + else + { + buildParameterMetaDataDoc(opMetaData, wsdlOperation, typeMapping); + } + + // Build operation faults + buildFaultMetaData(opMetaData, wsdlOperation); + + // process further operation extensions + processOpMetaExtensions(opMetaData, wsdlOperation); + } + } + + private void buildParameterMetaDataRpc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, TypeMappingImpl typeMapping) + { + log.trace("buildParameterMetaDataRpc: " + opMetaData.getXmlName()); + + TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData(); + + for (WSDLInterfaceOperationInput opInput : wsdlOperation.getInputs()) + { + QName xmlName = opInput.getElement(); + QName xmlType = opInput.getXMLType(); + String javaTypeName = typeMapping.getJavaTypeName(xmlType); + + if (javaTypeName == null) + throw new WSException("Cannot obtain java type mapping for: " + xmlType); + + ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + opMetaData.addParameter(inMetaData); + + boolean inHeader = opInput.getProperty(Constants.WSDL_PROPERTY_APPLICATION_DATA) != null; + inMetaData.setInHeader(inHeader); + } + + for (WSDLInterfaceOperationOutput opOutput : wsdlOperation.getOutputs()) + { + String partName = opOutput.getProperty(Constants.WSDL_PROPERTY_PART_NAME).getValue(); + QName xmlName = opOutput.getElement(); + + ParameterMetaData outMetaData = opMetaData.getParameter(xmlName); + if (outMetaData != null && wsdlOperation.getInputByPartName(partName) != null) + { + outMetaData.setMode(ParameterMode.INOUT); + } + else + { + QName xmlType = opOutput.getXMLType(); + String javaTypeName = typeMapping.getJavaTypeName(xmlType); + + boolean inHeader = opOutput.getProperty(Constants.WSDL_PROPERTY_APPLICATION_DATA) != null; + boolean hasReturnMapping = (inHeader == false); + + if (javaTypeName == null) + throw new WSException("Cannot obtain java type mapping for: " + xmlType); + + if (hasReturnMapping) + { + outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + opMetaData.setReturnParameter(outMetaData); + } + else + { + outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + outMetaData.setMode(ParameterMode.OUT); + opMetaData.addParameter(outMetaData); + + outMetaData.setInHeader(inHeader); + } + } + } + } + + private void buildParameterMetaDataDoc(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, TypeMappingImpl typeMapping) + { + log.trace("buildParameterMetaDataDoc: " + opMetaData.getXmlName()); + + EndpointMetaData epMetaData = opMetaData.getEndpointMetaData(); + ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData(); + TypesMetaData typesMetaData = serviceMetaData.getTypesMetaData(); + + for (WSDLInterfaceOperationInput opInput : wsdlOperation.getInputs()) + { + QName xmlName = opInput.getElement(); + QName xmlType = opInput.getXMLType(); + String javaTypeName = typeMapping.getJavaTypeName(xmlType); + + TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType); + if (typeMetaData != null) + javaTypeName = typeMetaData.getJavaTypeName(); + + if (javaTypeName == null) + throw new WSException("Cannot obtain java type mapping for: " + xmlType); + + // Check if we need to wrap the parameters + boolean isWrapParameters = false; + + ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + epMetaData.setParameterStyle(isWrapParameters ? ParameterStyle.WRAPPED : ParameterStyle.BARE); + inMetaData.setInHeader(opInput.getProperty(Constants.WSDL_PROPERTY_APPLICATION_DATA) != null); + opMetaData.addParameter(inMetaData); + + // Set the variable names + if (opMetaData.isDocumentWrapped()) + { + throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType); + } + } + + for (WSDLInterfaceOperationOutput opOutput : wsdlOperation.getOutputs()) + { + String partName = opOutput.getProperty(Constants.WSDL_PROPERTY_PART_NAME).getValue(); + QName xmlName = opOutput.getElement(); + + ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName); + if (paramMetaData != null && wsdlOperation.getInputByPartName(partName) != null) + { + paramMetaData.setMode(ParameterMode.INOUT); + } + else + { + QName xmlType = opOutput.getXMLType(); + String javaTypeName = typeMapping.getJavaTypeName(xmlType); + + boolean inHeader = opOutput.getProperty(Constants.WSDL_PROPERTY_APPLICATION_DATA) != null; + boolean hasReturnMapping = (inHeader == false); + + if (typesMetaData.getTypeMappingByXMLType(xmlType) != null) + javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName(); + + if (javaTypeName == null) + throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType); + + if (hasReturnMapping) + { + ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + opMetaData.setReturnParameter(retMetaData); + + // Set the variable names + if (opMetaData.getParameterStyle() == ParameterStyle.WRAPPED) + { + throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping"); + } + } + else + { + ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName); + opMetaData.addParameter(outMetaData); + outMetaData.setMode(ParameterMode.OUT); + + outMetaData.setInHeader(inHeader); + } + } + } + } +} Property changes on: trunk/src/main/java/org/jboss/ws/deployment/JAXWSClientMetaDataBuilder.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR109MetaDataBuilder.java 2006-07-04 16:42:35 UTC (rev 553) @@ -39,22 +39,15 @@ import org.jboss.ws.Constants; import org.jboss.ws.WSException; import org.jboss.ws.addressing.AddressingConstantsImpl; -import org.jboss.ws.addressing.metadata.AddressingOpMetaExt; -import org.jboss.ws.eventing.EventingConstants; -import org.jboss.ws.eventing.deployment.EventingEndpoint; -import org.jboss.ws.eventing.metadata.EventingEpMetaExt; import org.jboss.ws.jaxrpc.LiteralTypeMapping; import org.jboss.ws.jaxrpc.ParameterStyle; import org.jboss.ws.jaxrpc.Style; import org.jboss.ws.jaxrpc.TypeMappingImpl; import org.jboss.ws.jaxrpc.TypeMappingRegistryImpl; -import org.jboss.ws.jaxrpc.UnqualifiedFaultException; import org.jboss.ws.jaxrpc.Use; import org.jboss.ws.metadata.EndpointMetaData; -import org.jboss.ws.metadata.FaultMetaData; import org.jboss.ws.metadata.OperationMetaData; import org.jboss.ws.metadata.ParameterMetaData; -import org.jboss.ws.metadata.ServerEndpointMetaData; import org.jboss.ws.metadata.ServiceMetaData; import org.jboss.ws.metadata.TypeMappingMetaData; import org.jboss.ws.metadata.TypesMetaData; @@ -67,20 +60,16 @@ import org.jboss.ws.metadata.jaxrpcmapping.VariableMapping; import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping; import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping; -import org.jboss.ws.metadata.wsdl.NCName; import org.jboss.ws.metadata.wsdl.WSDLBinding; import org.jboss.ws.metadata.wsdl.WSDLBindingOperation; import org.jboss.ws.metadata.wsdl.WSDLDefinitions; import org.jboss.ws.metadata.wsdl.WSDLEndpoint; import org.jboss.ws.metadata.wsdl.WSDLInterface; -import org.jboss.ws.metadata.wsdl.WSDLInterfaceFault; import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperation; import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationInput; -import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutfault; import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationOutput; import org.jboss.ws.metadata.wsdl.WSDLInterfaceOperationPart; import org.jboss.ws.metadata.wsdl.WSDLProperty; -import org.jboss.ws.metadata.wsdl.WSDLService; import org.jboss.ws.metadata.wsdl.WSDLTypes; import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel; import org.jboss.ws.utils.JavaUtils; @@ -201,7 +190,7 @@ } // Build operation faults - buildFaultMetaData(opMetaData, wsdlOperation, seiMapping); + buildFaultMetaData(opMetaData, wsdlOperation); // process further operation extensions processOpMetaExtensions(opMetaData, wsdlOperation); @@ -628,124 +617,7 @@ } } - private void buildFaultMetaData(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation, ServiceEndpointInterfaceMapping seiMapping) - { - TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData(); - - WSDLInterface wsdlInterface = wsdlOperation.getWsdlInterface(); - for (WSDLInterfaceOperationOutfault outFault : wsdlOperation.getOutfaults()) - { - QName ref = outFault.getRef(); - - WSDLInterfaceFault wsdlFault = wsdlInterface.getFault(new NCName(ref.getLocalPart())); - QName xmlName = wsdlFault.getXmlName(); - QName xmlType = wsdlFault.getXmlType(); - String javaTypeName = null; - - if (typesMetaData.getTypeMappingByXMLType(xmlType) != null) - javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName(); - - if (javaTypeName == null) - { - log.warn("Cannot obtain java type mapping for: " + xmlType); - javaTypeName = new UnqualifiedFaultException(xmlType).getClass().getName(); - } - - FaultMetaData faultMetaData = new FaultMetaData(opMetaData, xmlName, xmlType, javaTypeName); - opMetaData.addFault(faultMetaData); - } - } - - /** Initialize the endpoint encoding style from the binding operations - */ - protected void initEndpointEncodingStyle(EndpointMetaData epMetaData) - { - WSDLDefinitions wsdlDefinitions = epMetaData.getServiceMetaData().getWsdlDefinitions(); - for (WSDLService wsdlService : wsdlDefinitions.getServices()) - { - for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints()) - { - if (epMetaData.getQName().equals(wsdlEndpoint.getQName())) - { - QName bindQName = wsdlEndpoint.getBinding(); - NCName ncName = new NCName(bindQName.getLocalPart()); - WSDLBinding wsdlBinding = wsdlDefinitions.getBinding(ncName); - if (wsdlBinding == null) - throw new WSException("Cannot obtain binding: " + ncName); - - for (WSDLBindingOperation wsdlBindingOperation : wsdlBinding.getOperations()) - { - String encStyle = wsdlBindingOperation.getEncodingStyle(); - epMetaData.setEncodingStyle(Use.valueOf(encStyle)); - } - } - } - } - } - - protected void processEndpointMetaDataExtensions(EndpointMetaData epMetaData, WSDLDefinitions wsdlDefinitions) - { - for (WSDLInterface wsdlInterface : wsdlDefinitions.getInterfaces()) - { - WSDLProperty eventSourceProp = wsdlInterface.getProperty(Constants.WSDL_PROPERTY_EVENTSOURCE); - if (eventSourceProp != null && epMetaData instanceof ServerEndpointMetaData) - { - ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)epMetaData; - String eventSourceNS = wsdlInterface.getQName().getNamespaceURI() + "/" + wsdlInterface.getQName().getLocalPart(); - Object notificationSchema = null; // todo: resolve schema from operation message - - EventingEpMetaExt ext = new EventingEpMetaExt(EventingConstants.NS_EVENTING); - ext.setEventSourceNS(eventSourceNS); - ext.setNotificationSchema(notificationSchema); - - sepMetaData.addExtension(ext); - sepMetaData.setManagedEndpointBean(EventingEndpoint.class.getName()); - } - } - } - /** - * Process operation meta data extensions. - * - * @param opMetaData - * @param wsdlOperation - */ - protected void processOpMetaExtensions(OperationMetaData opMetaData, WSDLInterfaceOperation wsdlOperation) - { - - String tns = wsdlOperation.getQName().getNamespaceURI(); - String portTypeName = wsdlOperation.getQName().getLocalPart(); - - AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI()); - - // inbound action - WSDLProperty wsaInAction = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_IN); - if (wsaInAction != null) - { - addrExt.setInboundAction(wsaInAction.getValue()); - } - else - { - WSDLProperty messageName = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_IN); - addrExt.setInboundAction(tns + "/" + portTypeName + "/" + messageName); - } - - // outbound action - WSDLProperty wsaOutAction = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_ACTION_OUT); - if (wsaOutAction != null) - { - addrExt.setOutboundAction(wsaOutAction.getValue()); - } - else - { - WSDLProperty messageName = wsdlOperation.getProperty(Constants.WSDL_PROPERTY_MESSAGE_NAME_OUT); - addrExt.setOutboundAction(tns + "/" + portTypeName + "/" + messageName); - } - - opMetaData.addExtension(addrExt); - } - - /** * Build default action according to the pattern described in * http://www.w3.org/Submission/2004/SUBM-ws-addressing-20040810/ * Section 3.3.2 'Default Action Pattern'<br> Modified: trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java =================================================================== --- trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/deployment/JSR181MetaDataBuilder.java 2006-07-04 16:42:35 UTC (rev 553) @@ -296,11 +296,11 @@ if (method.isAnnotationPresent(RequestWrapper.class)) { RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class); - + String localName = (anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : operationName); String targetNamespace = (anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : epMetaData.getQName().getNamespaceURI()); xmlName = new QName(targetNamespace, localName); - + if (anReqWrapper.className().length() > 0) { requestWrapperType = anReqWrapper.className(); @@ -332,11 +332,11 @@ if (method.isAnnotationPresent(ResponseWrapper.class)) { ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class); - + String localName = (anResWrapper.localName().length() > 0 ? anResWrapper.localName() : operationName + "Response"); String targetNamespace = (anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : epMetaData.getQName().getNamespaceURI()); xmlName = new QName(targetNamespace, localName); - + if (anResWrapper.className().length() > 0) { responseWrapperType = anResWrapper.className(); Modified: trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-07-04 11:35:28 UTC (rev 552) +++ trunk/src/main/java/org/jboss/ws/jaxrpc/CallImpl.java 2006-07-04 16:42:35 UTC (rev 553) @@ -23,8 +23,6 @@ // $Id$ -import java.net.MalformedURLException; -import java.net.URL; import java.rmi.RemoteException; import java.util.ArrayList; import java.util.Arrays; @@ -44,37 +42,22 @@ import javax.xml.rpc.Stub; import javax.xml.rpc.encoding.SerializerFactory; import javax.xml.rpc.handler.HandlerChain; -import javax.xml.rpc.handler.MessageContext; -import javax.xml.rpc.soap.SOAPFaultException; import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; -import javax.xml.ws.addressing.AddressingProperties; -import javax.xml.ws.addressing.JAXWSAConstants; import org.jboss.logging.Logger; import org.jboss.ws.Constants; -import org.jboss.ws.WSException; -import org.jboss.ws.addressing.AddressingConstantsImpl; -import org.jboss.ws.binding.BindingProvider; -import org.jboss.ws.binding.BindingProviderRegistry; -import org.jboss.ws.binding.EndpointInvocation; import org.jboss.ws.binding.UnboundHeader; +import org.jboss.ws.client.CommonClient; import org.jboss.ws.handler.HandlerChainBaseImpl; import org.jboss.ws.jbossxb.JBossXBDeserializerFactory; import org.jboss.ws.jbossxb.JBossXBSerializerFactory; -import org.jboss.ws.metadata.ClientEndpointMetaData; import org.jboss.ws.metadata.EndpointMetaData; import org.jboss.ws.metadata.OperationMetaData; import org.jboss.ws.metadata.ParameterMetaData; import org.jboss.ws.metadata.ServiceMetaData; import org.jboss.ws.metadata.TypesMetaData; -import org.jboss.ws.metadata.UnifiedMetaData; import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel; -import org.jboss.ws.soap.EndpointInfo; -import org.jboss.ws.soap.MessageContextAssociation; -import org.jboss.ws.soap.SOAPConnectionImpl; import org.jboss.ws.soap.SOAPMessageContextImpl; -import org.jboss.ws.utils.HolderUtils; import org.jboss.ws.utils.JavaUtils; /** Provides support for the dynamic invocation of a service endpoint. @@ -85,25 +68,19 @@ * @author Tho...@jb... * @since 10-Oct-2004 */ -public class CallImpl implements Call +public class CallImpl extends CommonClient implements Call { // provide logging private static Logger log = Logger.getLogger(CallImpl.class); // The service that created this call private ServiceImpl jaxrpcService; - // The endpoint together with the operationName uniquely identify the call operation - private EndpointMetaData epMetaData; - // The current operation name - private QName operationName; // The port type name private QName portType; - // A Map<String,Object> of Call properties - private Map<String, Object> properties = new HashMap<String, Object>(); - // Output parameters - private EndpointInvocation epInv; // A Map<QName,UnboundHeader> of header entries private Map<QName, UnboundHeader> unboundHeaders = new LinkedHashMap<QName, UnboundHeader>(); + // A Map<String,Object> of Call properties + private Map<String, Object> properties = new HashMap<String, Object>(); // The set of supported properties private static final Set<String> standardProperties = new HashSet<String>(); @@ -116,7 +93,7 @@ standardProperties.add(Call.SOAPACTION_USE_PROPERTY); standardProperties.add(Call.USERNAME_PROPERTY); standardProperties.add(Call.PASSWORD_PROPERTY); - + standardProperties.add(Stub.ENDPOINT_ADDRESS_PROPERTY); standardProperties.add(Stub.SESSION_MAINTAIN_PROPERTY); standardProperties.add(Stub.USERNAME_PROPERTY); @@ -127,15 +104,11 @@ */ CallImpl(ServiceImpl service) { + super(service.getServiceMetaData()); this.jaxrpcService = service; - - // If the WSDLService has only one endpoint, use it - ServiceMetaData serviceMetaData = service.getServiceMetaData(); - if (serviceMetaData != null && serviceMetaData.getEndpoints().size() == 1) - { - this.epMetaData = serviceMetaData.getEndpoints().get(0); + + if (epMetaData != null) setTargetEndpointAddress(epMetaData.getEndpointAddress()); - } } /** Create a call for a known WSDL endpoint. @@ -144,8 +117,9 @@ */ CallImpl(ServiceImpl service, EndpointMetaData epMetaData) { + super(epMetaData); this.jaxrpcService = service; - this.epMetaData = epMetaData; + setTargetEndpointAddress(epMetaData.getEndpointAddress()); } @@ -156,32 +130,25 @@ */ CallImpl(ServiceImpl service, QName portName, QName opName) throws ServiceException { + super(service.getServiceMetaData(), portName, opName); this.jaxrpcService = service; + + if (epMetaData != null) + setTargetEndpointAddress(epMetaData.getEndpointAddress()); + } - ServiceMetaData serviceMetaData = service.getServiceMetaData(); - if (serviceMetaData != null) - { - EndpointMetaData epMetaData = null; - if (serviceMetaData.getEndpoints().size() > 0) - { - epMetaData = serviceMetaData.getEndpoint(portName); - if (epMetaData == null) - throw new ServiceException("Cannot find endpoint for name: " + portName); - } - - if (epMetaData != null) - { - this.epMetaData = epMetaData; - setTargetEndpointAddress(epMetaData.getEndpointAddress()); - } - } - - if (opName != null) - { - setOperationName(opName); - } + @Override + protected Map<String, Object> getRequestContext() + { + return properties; } + @Override + protected Map<String, Object> getResponseContext() + { + return properties; + } + /** * Add a header that is not bound to an input parameter. * A propriatory extension, that is not part of JAXRPC. @@ -267,20 +234,6 @@ this.properties.put(Stub.ENDPOINT_ADDRESS_PROPERTY, address); } - /** Gets the name of the operation to be invoked using this Call instance. - */ - public QName getOperationName() - { - return this.operationName; - } - - /** Sets the name of the operation to be invoked using this Call instance. - */ - public void setOperationName(QName operationName) - { - this.operationName = operationName; - } - /** Adds a parameter t... [truncated message content] |
From: <jbo...@li...> - 2006-07-04 11:35:35
|
Author: tho...@jb... Date: 2006-07-04 07:35:28 -0400 (Tue, 04 Jul 2006) New Revision: 552 Modified: trunk/src/test/java/org/jboss/test/ws/wsse/WebClientTestCase.java Log: Add fixme Modified: trunk/src/test/java/org/jboss/test/ws/wsse/WebClientTestCase.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/wsse/WebClientTestCase.java 2006-07-04 11:31:48 UTC (rev 551) +++ trunk/src/test/java/org/jboss/test/ws/wsse/WebClientTestCase.java 2006-07-04 11:35:28 UTC (rev 552) @@ -53,6 +53,7 @@ public void testWebClient() throws Exception { System.out.println("FIXME: JBAS-3350"); + if (true) return; URL url = new URL("http://" + getServerHost() + ":8080/jbossws-wsse-rpc/RpcTestClientServlet?input=Hello"); BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream())); |
From: <jbo...@li...> - 2006-07-04 11:31:51
|
Author: tho...@jb... Date: 2006-07-04 07:31:48 -0400 (Tue, 04 Jul 2006) New Revision: 551 Modified: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java Log: Add fixme Modified: trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-07-04 11:28:03 UTC (rev 550) +++ trunk/src/test/java/org/jboss/test/ws/jsr181/soapbinding/JSR181SOAPBindingTestCase.java 2006-07-04 11:31:48 UTC (rev 551) @@ -165,6 +165,8 @@ File mappingFile = new File("resources/jsr181/soapbinding/wrapped-mapping.xml"); assertTrue(mappingFile.exists()); + System.out.println("FIXME: JBWS-1033"); + /* ServiceFactoryImpl factory = new ServiceFactoryImpl(); Service service = factory.createService(wsdlURL, serviceName, mappingFile.toURL()); CallImpl call = (CallImpl)service.createCall(portName, "SubmitPO"); @@ -176,8 +178,6 @@ PurchaseOrder poReq = new PurchaseOrder("Ferarri"); - System.out.println("FIXME: JBWS-1033"); - /* PurchaseOrderAck poRes = (PurchaseOrderAck)call.invoke(new Object[]{poReq}); assertEquals("Ferarri", poRes.getProduct()); */ |
From: <jbo...@li...> - 2006-07-04 11:28:08
|
Author: tho...@jb... Date: 2006-07-04 07:28:03 -0400 (Tue, 04 Jul 2006) New Revision: 550 Modified: trunk/src/test/java/org/jboss/test/ws/jsr181/complex/client/JSR181ComplexTestCase.java Log: Add fixme Modified: trunk/src/test/java/org/jboss/test/ws/jsr181/complex/client/JSR181ComplexTestCase.java =================================================================== --- trunk/src/test/java/org/jboss/test/ws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-07-04 10:59:16 UTC (rev 549) +++ trunk/src/test/java/org/jboss/test/ws/jsr181/complex/client/JSR181ComplexTestCase.java 2006-07-04 11:28:03 UTC (rev 550) @@ -55,8 +55,8 @@ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jbossws-jsr181-complex/RegistrationService?wsdl"); File mappingFile = new File("resources/jsr181/complex/jaxrpc-mapping.xml"); ServiceFactoryImpl factory = new ServiceFactoryImpl(); - Service service = factory.createService(wsdlURL, null, mappingFile.toURL()); - port = (RegistrationService) service.getPort(RegistrationService.class); + //Service service = factory.createService(wsdlURL, null, mappingFile.toURL()); + //port = (RegistrationService) service.getPort(RegistrationService.class); } |