You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/10/30 13:11:15 UTC
svn commit: r590048 [6/9] - in /webservices/axis2/branches/java/jaxws21:
legal/ modules/adb-codegen/ modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/sch...
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubHeaderTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -1,6 +1,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
+
<xsl:template match="/class">
<xsl:variable name="interfaceName"><xsl:value-of select="@interfaceName"/></xsl:variable>
<xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
@@ -42,10 +43,11 @@
/* function prototypes - for header file*/
/**
* <xsl:value-of select="$method-prefix"/>_create
- * create and return the stub with services populated
- * params - env : environment ( mandatory)
- * - client_home : Axis2/C home ( mandatory )
- * - endpoint_uri : service endpoint uri( optional ) - if NULL default picked from wsdl used
+ * Create and return the stub with services populated
+ * @param env Environment ( mandatory)
+ * @param client_home Axis2/C home ( mandatory )
+ * @param endpoint_uri Service endpoint uri( optional ) - if NULL default picked from WSDL used
+ * @return Newly created stub object
*/
axis2_stub_t*
<xsl:value-of select="$method-prefix"/>_create (const axutil_env_t *env,
@@ -54,22 +56,20 @@
/**
* <xsl:value-of select="$method-prefix"/>_populate_services
* populate the svc in stub with the service and operations
+ * @param stub The stub
+ * @param env environment ( mandatory)
*/
void <xsl:value-of select="$method-prefix"/>_populate_services( axis2_stub_t *stub, const axutil_env_t *env);
/**
* <xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl
- * return the endpoint URI picked from wsdl
+ * Return the endpoint URI picked from WSDL
+ * @param env environment ( mandatory)
+ * @return The endpoint picked from WSDL
*/
axis2_char_t *<xsl:value-of select="$method-prefix"/>_get_endpoint_uri_from_wsdl ( const axutil_env_t *env );
<xsl:if test="$isSync='1'">
<xsl:for-each select="method">
- /**
- * auto generated function declaration
- * for "<xsl:value-of select="@qname"/>" operation.
- <!-- select only the body parameters -->
- <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- */
<xsl:variable name="outputours"><xsl:value-of select="output/param/@ours"></xsl:value-of></xsl:variable>
<xsl:variable name="outputtype">
@@ -78,6 +78,20 @@
<xsl:otherwise><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:otherwise>
</xsl:choose>
</xsl:variable>
+ /**
+ * Auto generated function declaration
+ * for "<xsl:value-of select="@qname"/>" operation.
+ * @param stub The stub
+ * @param env environment ( mandatory)
+ <!-- select only the body parameters -->
+ <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+ * return
+ <xsl:choose>
+ <xsl:when test="$outputtype=''">axis2_status_t</xsl:when>
+ <xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
+ </xsl:choose>
+ */
+
<xsl:choose>
<xsl:when test="$outputtype=''">axis2_status_t</xsl:when>
<xsl:when test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:when>
@@ -96,8 +110,10 @@
<xsl:if test="$isAsync='1'">
<xsl:for-each select="method">
/**
- * auto generated function declaration
+ * Auto generated function declaration
* for "<xsl:value-of select="@qname"/>" operation.
+ * @param stub The stub
+ * @param env environment ( mandatory)
<!-- select only the body parameters -->
<xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
* @param on_complete callback to handle on complete
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/c/StubSourceTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -1,6 +1,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
+
<xsl:template match="/class">
<xsl:variable name="interfaceName"><xsl:value-of select="@interfaceName"/></xsl:variable>
<xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
@@ -177,6 +178,7 @@
const axis2_char_t *soap_action = NULL;
axutil_qname_t *op_qname = NULL;
axiom_node_t *payload = NULL;
+ axis2_bool_t is_soap_act_set = AXIS2_TRUE;
<xsl:if test="$style='doc'">
axutil_string_t *soap_act = NULL;
</xsl:if>
@@ -191,7 +193,7 @@
<xsl:if test="position()=1">
<xsl:choose>
<xsl:when test="@ours">
- payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
+ payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_TRUE);
</xsl:when>
<xsl:otherwise>
payload = <xsl:value-of select="@name"/>;
@@ -211,8 +213,9 @@
}
svc_client = axis2_stub_get_svc_client(stub, env );
soap_action = axis2_options_get_action( options, env );
- if ( NULL == soap_action )
+ if (NULL == soap_action)
{
+ is_soap_act_set = AXIS2_FALSE;
soap_action = "<xsl:value-of select="$soapAction"/>";
<xsl:if test="$style='doc'">
soap_act = axutil_string_create(env, "<xsl:value-of select="$soapAction"/>");
@@ -231,7 +234,14 @@
"<xsl:value-of select="@namespace"/>",
NULL);
ret_node = axis2_svc_client_send_receive_with_op_qname( svc_client, env, op_qname, payload);
-
+
+ if (!is_soap_act_set)
+ {
+ <xsl:if test="$style='doc'">
+ axis2_options_set_soap_action(options, env, NULL);
+ </xsl:if>
+ axis2_options_set_action( options, env, NULL);
+ }
<xsl:choose>
<xsl:when test="$outputtype=''">
@@ -283,6 +293,7 @@
const axis2_char_t *soap_action = NULL;
axiom_node_t *payload = NULL;
+ axis2_bool_t is_soap_act_set = AXIS2_TRUE;
<xsl:if test="$style='doc'">
axutil_string_t *soap_act = NULL;
</xsl:if>
@@ -292,7 +303,7 @@
<xsl:if test="position()=1">
<xsl:choose>
<xsl:when test="@ours">
- payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
+ payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_TRUE);
</xsl:when>
<xsl:otherwise>
payload = <xsl:value-of select="@name"/>;
@@ -303,30 +314,31 @@
options = axis2_stub_get_options( stub, env);
- if ( NULL == options )
+ if (NULL == options)
{
AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "options is null in stub: Error code:"
" %d :: %s", env->error->error_number,
AXIS2_ERROR_GET_MESSAGE(env->error));
return;
}
- svc_client = axis2_stub_get_svc_client (stub, env );
- soap_action =axis2_options_get_action ( options, env );
- if ( NULL == soap_action )
+ svc_client = axis2_stub_get_svc_client (stub, env);
+ soap_action =axis2_options_get_action (options, env);
+ if (NULL == soap_action)
{
+ is_soap_act_set = AXIS2_FALSE;
soap_action = "<xsl:value-of select="$soapAction"/>";
<xsl:if test="$style='doc'">
soap_act = axutil_string_create(env, "<xsl:value-of select="$soapAction"/>");
axis2_options_set_soap_action(options, env, soap_act);
</xsl:if>
- axis2_options_set_action( options, env, soap_action );
+ axis2_options_set_action( options, env, soap_action);
}
<xsl:choose>
<xsl:when test="$soapVersion='1.2'">
- axis2_options_set_soap_version(options, env, AXIOM_SOAP12 );
+ axis2_options_set_soap_version(options, env, AXIOM_SOAP12);
</xsl:when>
<xsl:otherwise>
- axis2_options_set_soap_version(options, env, AXIOM_SOAP11 );
+ axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
</xsl:otherwise>
</xsl:choose>
@@ -338,6 +350,14 @@
/* Send request */
axis2_svc_client_send_receive_non_blocking(svc_client, env, payload, callback);
+
+ if (!is_soap_act_set)
+ {
+ <xsl:if test="$style='doc'">
+ axis2_options_set_soap_action(options, env, NULL);
+ </xsl:if>
+ axis2_options_set_action(options, env, NULL);
+ }
}
</xsl:if> <!--close for test="$isASync='1'-->
@@ -375,7 +395,7 @@
<xsl:if test="position()=1">
<xsl:choose>
<xsl:when test="@ours">
- payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_FALSE, AXIS2_TRUE);
+ payload = adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="@name"/>, env, NULL, AXIS2_TRUE);
</xsl:when>
<xsl:otherwise>
payload = <xsl:value-of select="@name"/>;
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -280,13 +280,15 @@
<xsl:text> </xsl:text><xsl:value-of select="@name"/>(
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
+ <xsl:variable name="inputParamCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+
<xsl:choose>
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
- <xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:choose>
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -299,7 +301,8 @@
<xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
</xsl:choose>
- <xsl:if test="$inputcount=1 and input/param[not(@location='body') and @type!='']">,</xsl:if>
+ <xsl:if test="($inputcount=1 and input/param[not(@location='body') and @type!='']) and
+ not($isUnwrapParameters and $inputParamCount=0)">,</xsl:if>
<xsl:for-each select="input/param[not(@location='body') and @type!='']">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>)
@@ -344,7 +347,7 @@
wrapped parameters -->
<!-- unwrapping takes place only if the back word compatiblity is off. if -b on
then we do not unwrapp and only remove the top element -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:variable name="inputElementType" select="input/param[@location='body' and @type!='']/@type"></xsl:variable>
<xsl:variable name="inputElementComplexType" select="input/param[@location='body' and @type!='']/@complextype"></xsl:variable>
<xsl:variable name="opName" select="input/param[@location='body' and @type!='']/@opname"></xsl:variable>
@@ -357,7 +360,7 @@
optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
"<xsl:value-of select="$method-name"/>")));
</xsl:when>
- <xsl:when test="($inputWrappedCount > 0) and not($isbackcompatible='true')">
+ <xsl:when test="($isUnwrapParameters) and not($isbackcompatible='true')">
<xsl:value-of select="$inputElementType"/><xsl:text> </xsl:text>dummyWrappedType = null;
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
@@ -581,13 +584,15 @@
public void start<xsl:value-of select="@name"/>(
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+
<xsl:choose>
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
- <xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:choose>
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -599,7 +604,7 @@
</xsl:when>
<xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
</xsl:choose>
- <xsl:if test="$inputcount=1">,</xsl:if>
+ <xsl:if test="($inputcount=1) and not($isUnwrapParameters and $inputWrappedCount=0)">,</xsl:if>
<xsl:for-each select="input/param[not(@location='body') and @type!='']">
<xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>,
</xsl:for-each>
@@ -635,11 +640,11 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:variable name="inputElementType" select="input/param[@location='body' and @type!='']/@type"></xsl:variable>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:value-of select="$inputElementType"/><xsl:text> </xsl:text>dummyWrappedType = null;
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
@@ -893,9 +898,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -950,11 +955,11 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:variable name="inputElementType" select="input/param[@location='body' and @type!='']/@type"></xsl:variable>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:value-of select="$inputElementType"/><xsl:text> </xsl:text>dummyWrappedType = null;
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -114,9 +114,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -160,9 +160,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -203,9 +203,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -190,9 +190,9 @@
</xsl:when>
</xsl:choose>
</xsl:if>
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="($inputWrappedCount > 0)">
+ <xsl:when test="($isUnwrapParameters)">
<!-- generate the references. the getters need to be
generated by the databinding-->
@@ -371,7 +371,7 @@
<xsl:when test="$style='rpc' or $style='document'">
<xsl:variable name="paramCount" select="count(input/param[@location='body' and @type!=''])"/>
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
<xsl:when test="$paramCount =1">
<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/> wrappedParam = (<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>)fromOM(
@@ -379,7 +379,7 @@
<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>.class,
getEnvelopeNamespaces(inMessage.getEnvelope()));
<xsl:choose>
- <xsl:when test="($inputWrappedCount > 0)">
+ <xsl:when test="($isUnwrapParameters)">
<!-- generate the references. the getters need to be
generated by the databinding-->
@@ -550,9 +550,9 @@
getEnvelopeNamespaces(msgContext.getEnvelope()));
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
skel.<xsl:value-of select="@name"/>(
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position() > 1">,</xsl:if>
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -66,9 +66,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
* @param<xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -124,9 +124,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Tue Oct 30 05:10:34 2007
@@ -68,9 +68,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
* @param<xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
@@ -127,9 +127,9 @@
<xsl:when test="$inputcount=1">
<!-- Even when the parameters are 1 we have to see whether we have the
wrapped parameters -->
- <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:variable name="isUnwrapParameters" select="input/param[@location='body' and @type!='']/@unwrappParameters"/>
<xsl:choose>
- <xsl:when test="$inputWrappedCount > 0">
+ <xsl:when test="$isUnwrapParameters">
<xsl:for-each select="input/param[@location='body' and @type!='']/param">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>
Modified: webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/distribution/pom.xml Tue Oct 30 05:10:34 2007
@@ -179,9 +179,12 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
</dependency>
-
<dependency>
<groupId>xmlbeans</groupId>
<artifactId>xbean</artifactId>
Modified: webservices/axis2/branches/java/jaxws21/modules/documentation/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/documentation/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/documentation/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/documentation/pom.xml Tue Oct 30 05:10:34 2007
@@ -176,7 +176,7 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
</dependency>
<dependency>
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/itest-build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/itest-build.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/itest-build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/itest-build.xml Tue Oct 30 05:10:34 2007
@@ -18,36 +18,114 @@
~ under the License.
-->
<project name="itest" default="build-repos" basedir=".">
+
+ <target name="generate-test-sources" unless="test.skip">
+ <!-- Set a property that can be picked up from the ant build.xml's -->
+
+ <echo>${maven.test.path}</echo>
+ <!-- copy the mars so that they are available on the test classpath -->
+ <copy file="../addressing/target/addressing-${addressing_version}.mar" tofile="target/test-classes/modules/addressing-${addressing_version}.mar" />
+
+ <property name="axis2.home" value="${basedir}/target" />
+ <property name="maven.junit.jvmargs" value="" />
+ <path id="maven.dependency.classpath">
+ <path refid="maven.compile.classpath" />
+ </path>
+ <!-- compiling some custom wsdl files -->
+ <property name="wsdl.source.dir" value="test-resources/wsdl" />
+ <property name="wsdl.output.base.dir" value="target/wsdl" />
+ <!-- make the dirs -->
+ <mkdir dir="${wsdl.output.base.dir}" />
+
+ <echo>Compiling ComplexDataTypes.wsdl</echo>
+ <mkdir dir="${wsdl.output.base.dir}/complexdatatype" />
+
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.runtime.classpath" />
+ <classpath location="${compiled.classes.dir}" />
+ <arg line="-ap -o target/wsdl/complexdatatype -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl" />
+ </java>
+ <javac fork="true" destdir="target/classes" debug="on">
+ <classpath refid="maven.runtime.classpath" />
+ <classpath location="${compiled.classes.dir}" />
+ <src path="target/wsdl/complexdatatype" />
+ </javac>
+
+ <echo>Compiling DocumentUnwrappingTest.wsdl</echo>
+ <mkdir dir="${wsdl.output.base.dir}/documentunwrapping" />
+
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.runtime.classpath" />
+ <classpath location="${compiled.classes.dir}" />
+ <arg line="-ap -o target/wsdl/documentunwrapping -ss -sd -ssi -u -g -uw -uri test-resources/wsdl/DocumentUnwrappingTest.wsdl" />
+ </java>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/documentunwrapping" />
+
+ <echo>Compiling RPCUnwrappingTest.wsdl</echo>
+ <mkdir dir="${wsdl.output.base.dir}/rpcunwrapping" />
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+
+ <classpath refid="maven.runtime.classpath" />
+ <classpath location="${compiled.classes.dir}" />
+ <arg line="-ap -o target/wsdl/rpcunwrapping -ss -sd -ssi -u -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl" />
+ </java>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/rpcunwrapping" />
+
+ <echo>Compiling ComplexDataTypesDocLitBare.wsdl</echo>
+ <mkdir dir="${wsdl.output.base.dir}/complexdatatypebare" />
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.runtime.classpath" />
+ <classpath location="${compiled.classes.dir}" />
+ <arg line="-o target/wsdl/complexdatatypebare -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl" />
+ </java>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/complexdatatypebare" />
+ <copy toDir="target/classes" failonerror="false">
+ <fileset dir="target/wsdl/complexdatatypebare/build/classes">
+ <include name="**/*.class" />
+ </fileset>
+ </copy>
+
+ <!-- compile the schema for XMLbeans -->
+ <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" fork="true">
+ <classpath refid="maven.runtime.classpath" />
+ <arg line="-src target/xmlbeans-src -d target/classes test-resources/xsd/type-test.xsd" />
+ </java>
+
+ <ant antfile="itest-build.xml" inheritall="true" inheritrefs="true" dir="." target="rpc-wsdl-codegen" />
+
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestModuleB" />
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestModuleC" />
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestServiceB" />
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestServiceC" />
+ </target>
+
<target name="rpc-wsdl-codegen">
<echo>Running codegen RPC WSDLs - take 1</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.dependency.classpath"/>
- <arg line="-ap -o target/rpc-test1 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
+ <classpath refid="maven.dependency.classpath" />
+ <arg line="-ap -o target/rpc-test1 -uri test-resources/rpc/test-rpc-2.wsdl -uw" />
</java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test1"
- target="jar.client"/>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test1" target="jar.client" />
<echo>Running codegen RPC WSDLs - take 2</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.dependency.classpath"/>
- <arg line="-ap -o target/rpc-test2 -uri test-resources/rpc/test-rpc-3.wsdl -uw"/>
+ <classpath refid="maven.dependency.classpath" />
+ <arg line="-ap -o target/rpc-test2 -uri test-resources/rpc/test-rpc-3.wsdl -uw" />
</java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test2"
- target="jar.client"/>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test2" target="jar.client" />
<echo>Running codegen RPC WSDLs - take 3</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.dependency.classpath"/>
- <arg line="-ap -o target/rpc-test3 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
+ <classpath refid="maven.dependency.classpath" />
+ <arg line="-ap -o target/rpc-test3 -uri test-resources/rpc/test-rpc-2.wsdl -uw" />
</java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test3"
- target="jar.client"/>
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test3" target="jar.client" />
<echo>Running codegen RPC WSDLs - take 4</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.dependency.classpath"/>
- <arg line="-ap -o target/rpc-test4 -uri test-resources/rpc/test-rpc-2.wsdl -uw -ss -sd"/>
+ <classpath refid="maven.dependency.classpath" />
+ <arg line="-ap -o target/rpc-test4 -uri test-resources/rpc/test-rpc-2.wsdl -uw -ss -sd" />
</java>
<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test4"
target="jar.server"/>
@@ -78,7 +156,7 @@
</java>
<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test1"
target="jar.client"/>
-
+
<echo>Running codegen for Enterprise WSDL - take 2</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
@@ -102,7 +180,7 @@
</java>
<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/enterprise-test4"
target="jar.server"/>
-
+
<echo>Running codegen for eBaySvc WSDL</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
@@ -110,7 +188,7 @@
</java>
<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvc"
target="jar.server"/>
-
+
<echo>Running codegen for eBaySvc WSDL Back word compatibiliy</echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
@@ -118,7 +196,7 @@
</java>
<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/eBaySvcB"
target="jar.server"/>
-
+
<echo>Running codegen for eBaySvc WSDL with un wrapping </echo>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
@@ -128,7 +206,7 @@
target="jar.server"/>
</target>
- <target name="build-repos">
+ <target name="build-repos" unless="test.skip">
<mkdir dir="target/test-resources/samples/modules"/>
<mkdir dir="target/test-resources/samples/conf"/>
<mkdir dir="target/test-resources/repository-client/modules"/>
@@ -146,7 +224,7 @@
<mkdir dir="target/test-resources/local"/>
<copy file="../addressing/target/addressing-${addressing_version}.mar"
tofile="target/test-resources/local/addressing.mar"/>
-
+
<!-- Create Chunked enabled Repository -->
<mkdir dir="target/test-resources/chunking-enabledRepository"/>
<mkdir dir="target/test-resources/chunking-enabledRepository/conf"/>
@@ -243,28 +321,28 @@
<copy file="../addressing/target/addressing-${addressing_version}.mar"
tofile="target/test-resources/SwA-fileCache-enabledRepository/modules/addressing-${addressing_version}.mar"/>
-
- <mkdir dir="target/sample/groovy"/>
- <mkdir dir="target/sample/groovy/lib"/>
- <mkdir dir="target/sample/groovy/META-INF"/>
- <mkdir dir="target/sample/groovy/sample"/>
- <mkdir dir="target/sample/groovy/sample/groovy"/>
- <copy file="../samples/deprecated/groovy/src/sample/groovy/GroovyRcv.groovy"
+ <mkdir dir="target/sample/groovy"/>
+ <mkdir dir="target/sample/groovy/lib"/>
+ <mkdir dir="target/sample/groovy/META-INF"/>
+ <mkdir dir="target/sample/groovy/sample"/>
+ <mkdir dir="target/sample/groovy/sample/groovy"/>
+
+ <copy file="../samples/deprecated/groovy/src/sample/groovy/GroovyRcv.groovy"
tofile="target/sample/groovy/GroovyRcv.groovy"/>
-
- <javac fork="true" destdir="target/classes" debug="on">
- <classpath refid="maven.dependency.classpath"/>
- <src path="../samples/deprecated/groovy/src/sample/groovy"/>
- </javac>
- <copy file="target/classes/sample/groovy/GroovyReceiver.class"
+
+ <javac fork="true" destdir="target/classes" debug="on">
+ <classpath refid="maven.dependency.classpath"/>
+ <src path="../samples/deprecated/groovy/src/sample/groovy"/>
+ </javac>
+ <copy file="target/classes/sample/groovy/GroovyReceiver.class"
tofile="target/sample/groovy/sample/groovy/GroovyReceiver.class"/>
- <delete file="target/classes/sample/groovy/GroovyReceiver.class"/>
+ <delete file="target/classes/sample/groovy/GroovyReceiver.class"/>
- <copy file="../samples/deprecated/groovy/src/sample/groovy/META-INF/services.xml"
+ <copy file="../samples/deprecated/groovy/src/sample/groovy/META-INF/services.xml"
tofile="target/sample/groovy/META-INF/services.xml"/>
- <copy todir="target/sample/groovy/lib/" flatten="true">
+ <copy todir="target/sample/groovy/lib/" flatten="true">
<fileset dir="${maven.repo.local}/groovy/" includes="**/groovy-all-${groovy.all.version}.jar"/>
</copy>
@@ -274,10 +352,10 @@
<mkdir dir="target/groovyRepo/services"/>
<mkdir dir="target/groovyRepo/modules"/>
- <jar destfile="target/groovyRepo/services/groovyService.aar">
- <fileset dir="target/sample/groovy">
- </fileset>
- </jar>
+ <jar destfile="target/groovyRepo/services/groovyService.aar">
+ <fileset dir="target/sample/groovy">
+ </fileset>
+ </jar>
<copy file="../addressing/target/addressing-${addressing_version}.mar"
tofile="target/groovyRepo/modules/addressing-${addressing_version}.mar"/>
@@ -330,11 +408,11 @@
<target name="build-soap12-services">
<ant antfile="build.xml" inheritall="true" inheritrefs="true"
dir="test-resources/SOAP12Testing/SOAP12TestModuleB"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true"
dir="test-resources/SOAP12Testing/SOAP12TestModuleC"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true"
dir="test-resources/SOAP12Testing/SOAP12TestServiceB"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
+ <ant antfile="build.xml" inheritall="true" inheritrefs="true"
dir="test-resources/SOAP12Testing/SOAP12TestServiceC"/>
</target>
</project>
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/pom.xml Tue Oct 30 05:10:34 2007
@@ -250,7 +250,11 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
@@ -540,93 +544,15 @@
<phase>generate-test-sources</phase>
<configuration>
<tasks>
- <!-- Set a property that can be picked up from the ant build.xml's -->
- <property name="maven.class.path" refid="maven.runtime.classpath"/>
+ <condition property="test.skip">
+ <equals arg1="true" arg2="${maven.test.skip}" />
+ </condition>
+ <echo>${test.skip}</echo>
+ <property name="addressing_version" value="${version}"/>
+ <property name="maven.class.path" refid="maven.runtime.classpath"/>
<property name="maven.test.path" refid="maven.compile.classpath"/>
- <echo>${maven.test.path}</echo>
- <!-- copy the mars so that they are available on the test classpath -->
- <copy file="../addressing/target/addressing-${version}.mar"
- tofile="target/test-classes/modules/addressing-${version}.mar"/>
-
- <property name="axis2.home" value="${basedir}/target"/>
- <property name="maven.junit.jvmargs" value=""/>
- <path id="maven.dependency.classpath">
- <path refid="maven.compile.classpath"/>
- </path>
- <!-- compiling some custom wsdl files -->
- <property name="wsdl.source.dir" value="test-resources/wsdl"/>
- <property name="wsdl.output.base.dir" value="target/wsdl"/>
- <!-- make the dirs -->
- <mkdir dir="${wsdl.output.base.dir}"/>
-
- <echo>Compiling ComplexDataTypes.wsdl</echo>
- <mkdir dir="${wsdl.output.base.dir}/complexdatatype"/>
-
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.runtime.classpath"/>
- <classpath location="${compiled.classes.dir}"/>
- <arg line="-ap -o target/wsdl/complexdatatype -s -u -uw -uri test-resources/ComplexDataTypes/ComplexDataTypes.wsdl"/>
- </java>
- <javac fork="true" destdir="target/classes" debug="on">
- <classpath refid="maven.runtime.classpath"/>
- <classpath location="${compiled.classes.dir}"/>
- <src path="target/wsdl/complexdatatype"/>
- </javac>
-
- <echo>Compiling DocumentUnwrappingTest.wsdl</echo>
- <mkdir dir="${wsdl.output.base.dir}/documentunwrapping"/>
-
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.runtime.classpath"/>
- <classpath location="${compiled.classes.dir}"/>
- <arg line="-ap -o target/wsdl/documentunwrapping -ss -sd -ssi -u -g -uw -uri test-resources/wsdl/DocumentUnwrappingTest.wsdl"/>
- </java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="target/wsdl/documentunwrapping"/>
-
- <echo>Compiling RPCUnwrappingTest.wsdl</echo>
- <mkdir dir="${wsdl.output.base.dir}/rpcunwrapping"/>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-
- <classpath refid="maven.runtime.classpath"/>
- <classpath location="${compiled.classes.dir}"/>
- <arg line="-ap -o target/wsdl/rpcunwrapping -ss -sd -ssi -u -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
- </java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="target/wsdl/rpcunwrapping"/>
-
- <echo>Compiling ComplexDataTypesDocLitBare.wsdl</echo>
- <mkdir dir="${wsdl.output.base.dir}/complexdatatypebare"/>
- <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
- <classpath refid="maven.runtime.classpath"/>
- <classpath location="${compiled.classes.dir}"/>
- <arg line="-o target/wsdl/complexdatatypebare -s -uri test-resources/ComplexDataTypesDocLitBare/ComplexDataTypesDocLitBare.wsdl"/>
- </java>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="target/wsdl/complexdatatypebare"/>
- <copy toDir="target/classes" failonerror="false">
- <fileset dir="target/wsdl/complexdatatypebare/build/classes">
- <include name="**/*.class"/>
- </fileset>
- </copy>
-
- <!-- compile the schema for XMLbeans -->
- <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" fork="true">
- <classpath refid="maven.runtime.classpath"/>
- <arg line="-src target/xmlbeans-src -d target/classes test-resources/xsd/type-test.xsd"/>
- </java>
-
- <ant antfile="itest-build.xml" inheritall="true" inheritrefs="true"
- dir="." target="rpc-wsdl-codegen"/>
-
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="test-resources/SOAP12Testing/SOAP12TestModuleB"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="test-resources/SOAP12Testing/SOAP12TestModuleC"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="test-resources/SOAP12Testing/SOAP12TestServiceB"/>
- <ant antfile="build.xml" inheritall="true" inheritrefs="true"
- dir="test-resources/SOAP12Testing/SOAP12TestServiceC"/>
+ <ant antfile="itest-build.xml" inheritall="true" inheritrefs="true"
+ dir="." target="generate-test-sources"/>
</tasks>
</configuration>
<goals>
@@ -638,6 +564,10 @@
<phase>test-compile</phase>
<configuration>
<tasks>
+ <condition property="test.skip">
+ <equals arg1="true" arg2="${maven.test.skip}" />
+ </condition>
+ <echo>${test.skip}</echo>
<property name="addressing_version" value="${version}"/>
<property name="groovy.all.version" value="${groovy.all.version}"/>
<property name="maven.repo.local" value="${user.home}/.m2/repository"/>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/proxy/JAXWSProxyHandler.java Tue Oct 30 05:10:34 2007
@@ -335,7 +335,7 @@
OperationDescription operationDesc =
endpointDesc.getEndpointInterfaceDescription().getOperation(method);
- Message message = MethodMarshallerFactory.getMarshaller(operationDesc, true)
+ Message message = MethodMarshallerFactory.getMarshaller(operationDesc, true, null)
.marshalRequest(args, operationDesc);
if (log.isDebugEnabled()) {
@@ -377,9 +377,9 @@
Throwable t = getFaultResponse(responseContext, operationDesc);
throw t;
}
-
+ ClassLoader cl = (ClassLoader) responseContext.getProperty(Constants.CACHE_CLASSLOADER);
Object object =
- MethodMarshallerFactory.getMarshaller(operationDesc, true)
+ MethodMarshallerFactory.getMarshaller(operationDesc, true, cl)
.demarshalResponse(responseMsg, args, operationDesc);
if (log.isDebugEnabled()) {
log.debug("The response was processed and the return value created successfully.");
@@ -402,7 +402,8 @@
opDesc = opDesc.getSyncOperation();
}
if (msg != null && msg.isFault()) {
- Object object = MethodMarshallerFactory.getMarshaller(opDesc, true)
+ ClassLoader cl = (ClassLoader) msgCtx.getProperty(Constants.CACHE_CLASSLOADER);
+ Object object = MethodMarshallerFactory.getMarshaller(opDesc, true, cl)
.demarshalFaultResponse(msg, opDesc);
if (log.isDebugEnabled() && object != null) {
log.debug("A fault was found and processed.");
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/utils/ContextUtils.java Tue Oct 30 05:10:34 2007
@@ -275,5 +275,49 @@
}
}
}
+
+ public static void addWSDLProperties_provider(MessageContext jaxwsMessageContext) {
+ org.apache.axis2.context.MessageContext msgContext =
+ jaxwsMessageContext.getAxisMessageContext();
+ ServiceContext serviceContext = msgContext.getServiceContext();
+ SOAPMessageContext soapMessageContext = null;
+ if (serviceContext != null) {
+ WebServiceContext wsc =
+ (WebServiceContext)serviceContext.getProperty(WEBSERVICE_MESSAGE_CONTEXT);
+ if (wsc != null) {
+ soapMessageContext = (SOAPMessageContext)wsc.getMessageContext();
+ }
+ }
+
+ String op = jaxwsMessageContext.getOperationName().getLocalPart();
+
+ if (op != null && soapMessageContext != null) {
+ soapMessageContext
+ .put(javax.xml.ws.handler.MessageContext.WSDL_OPERATION, op);
+ soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_OPERATION,
+ Scope.APPLICATION);
+ if (log.isDebugEnabled()) {
+ log.debug("WSDL_OPERATION :" + op);
+ }
+
+ //EndpointInterfaceDescription eid = op.getEndpointInterfaceDescription();
+ EndpointDescription ed = jaxwsMessageContext.getEndpointDescription();
+
+ if (ed != null) {
+ soapMessageContext
+ .put(javax.xml.ws.handler.MessageContext.WSDL_PORT, ed.getPortQName());
+ soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_PORT,
+ Scope.APPLICATION);
+ if (log.isDebugEnabled()) {
+ log.debug("WSDL_PORT :" + ed.getPortQName());
+ }
+ }
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Unable to read WSDL operation, port and interface properties");
+ }
+ }
+ }
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/MessageContext.java Tue Oct 30 05:10:34 2007
@@ -59,6 +59,7 @@
private Message message;
private Mode mode;
private boolean isOutbound; // Outbound or inbound message context
+ private boolean isServer = false; // Indicate if server role, default is false
// TODO: flag to set whether we delegate property setting up to the
// axis2 message context object or keep it local
@@ -333,6 +334,21 @@
*/
public void setOutbound(boolean isOutbound) {
this.isOutbound = isOutbound;
+ }
+
+ /**
+ * @return true if server role
+ */
+ public boolean isServer() {
+ return isServer;
+ }
+
+ /**
+ * Indicate if server role
+ * @param isServer
+ */
+ public void setServer(boolean isServer) {
+ this.isServer = isServer;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/util/MessageContextUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/util/MessageContextUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/util/MessageContextUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/core/util/MessageContextUtils.java Tue Oct 30 05:10:34 2007
@@ -44,6 +44,7 @@
MessageContext newMC = new MessageContext(newAxisMC);
newMC.setOutbound(true);
+ newMC.setServer(true);
newMC.setMEPContext(mc.getMEPContext());
newMC.setEndpointDescription(mc.getEndpointDescription());
newMC.setOperationDescription(mc.getOperationDescription());
@@ -81,6 +82,7 @@
null);
MessageContext jaxwsFaultMC = new MessageContext(faultMC);
jaxwsFaultMC.setOutbound(true);
+ jaxwsFaultMC.setServer(true);
jaxwsFaultMC.setMEPContext(mc.getMEPContext());
jaxwsFaultMC.setEndpointDescription(mc.getEndpointDescription());
jaxwsFaultMC.setOperationDescription(mc.getOperationDescription());
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/SoapMessageContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/SoapMessageContext.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/SoapMessageContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/handler/SoapMessageContext.java Tue Oct 30 05:10:34 2007
@@ -63,13 +63,13 @@
if(log.isDebugEnabled()){
log.debug("Invalid QName, QName cannot be null");
}
- ExceptionFactory.makeWebServiceException(Messages.getMessage(""));
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage(""));
}
if(jaxbcontext == null){
if(log.isDebugEnabled()){
log.debug("Invalid JAXBContext, JAXBContext cannot be null");
}
- ExceptionFactory.makeWebServiceException(Messages.getMessage("SOAPMessageContextErr2"));
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("SOAPMessageContextErr2"));
}
if(flag == false){
@@ -97,7 +97,7 @@
}
}catch(XMLStreamException e){
- ExceptionFactory.makeWebServiceException(e);
+ throw ExceptionFactory.makeWebServiceException(e);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/factory/MethodMarshallerFactory.java Tue Oct 30 05:10:34 2007
@@ -90,19 +90,24 @@
}
return null;
}
-
+
public static MethodMarshaller getMarshaller(OperationDescription op, boolean isClient) {
+ return getMarshaller(op, isClient, null);
+ }
+
+ public static MethodMarshaller getMarshaller(OperationDescription op, boolean isClient,
+ ClassLoader cl) {
MethodMarshaller marshaller = null;
if (isClient) {
if (op.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
- marshaller = createDocLitMethodMarshaller(op, isClient);
+ marshaller = createDocLitMethodMarshaller(op, isClient, cl);
} else if (op.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
marshaller = createRPCLitMethodMarshaller(isClient);
}
} else { // SERVER
if (op.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
- marshaller = createDocLitMethodMarshaller(op, isClient);
+ marshaller = createDocLitMethodMarshaller(op, isClient, cl);
} else if (op.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
marshaller = createRPCLitMethodMarshaller(isClient);
}
@@ -111,11 +116,12 @@
}
private static MethodMarshaller createDocLitMethodMarshaller(OperationDescription op,
- boolean isClient) {
+ boolean isClient,
+ ClassLoader cl) {
SOAPBinding.ParameterStyle parameterStyle = null;
SUBTYPE subType = SUBTYPE.NORMAL;
if (isDocLitBare(op)) {
- if (isDocLitBareMinimal(op)) {
+ if (isDocLitBareMinimal(op, cl)) {
subType = SUBTYPE.MINIMAL;
}
parameterStyle = SOAPBinding.ParameterStyle.BARE;
@@ -190,15 +196,15 @@
* @param op
* @return
*/
- protected static boolean isDocLitBareMinimal(OperationDescription op) {
- return isDocLitBare(op) && !isContextPathConstruction(op);
+ protected static boolean isDocLitBareMinimal(OperationDescription op, ClassLoader cl) {
+ return isDocLitBare(op) && !isContextPathConstruction(op, cl);
}
/**
* @param op
* @return true if JAXBContext constructed using CONTEXT PATH
*/
- private static boolean isContextPathConstruction(OperationDescription op) {
+ private static boolean isContextPathConstruction(OperationDescription op, ClassLoader cl) {
ServiceDescription serviceDesc = op.getEndpointInterfaceDescription()
.getEndpointDescription().getServiceDescription();
MarshalServiceRuntimeDescription marshalDesc =
@@ -207,7 +213,7 @@
Holder<JAXBUtils.CONSTRUCTION_TYPE> holder = new Holder<JAXBUtils.CONSTRUCTION_TYPE>();
try {
JAXBContext context = JAXBUtils.getJAXBContext(marshalDesc.getPackages(), holder,
- marshalDesc.getPackagesKey());
+ marshalDesc.getPackagesKey(), cl);
} catch (JAXBException e) {
throw ExceptionFactory.makeWebServiceException(e);
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Tue Oct 30 05:10:34 2007
@@ -907,6 +907,7 @@
NoSuchMethodException {
Throwable exception = null;
+
// Get the fault from the message and get the detail blocks (probably one)
XMLFault xmlfault = message.getXMLFault();
Block[] detailBlocks = xmlfault.getDetailBlocks();
@@ -924,15 +925,19 @@
i++) {
FaultDescription fd = operationDesc.getFaultDescriptions()[i];
FaultBeanDesc faultBeanDesc = marshalDesc.getFaultBeanDesc(fd);
- QName tryQName = new QName(faultBeanDesc.getFaultBeanNamespace(),
- faultBeanDesc.getFaultBeanLocalName());
- if (log.isErrorEnabled()) {
- log.debug(" FaultDescription qname is (" + tryQName +
- ") and detail element qname is (" + elementQName + ")");
- }
- if (elementQName.equals(tryQName)) {
- faultDesc = fd;
- }
+
+ if (faultBeanDesc != null) {
+ QName tryQName = new QName(faultBeanDesc.getFaultBeanNamespace(),
+ faultBeanDesc.getFaultBeanLocalName());
+ if (log.isErrorEnabled()) {
+ log.debug(" FaultDescription qname is (" + tryQName +
+ ") and detail element qname is (" + elementQName + ")");
+ }
+
+ if (elementQName.equals(tryQName)) {
+ faultDesc = fd;
+ }
+ }
}
}
@@ -942,9 +947,11 @@
i++) {
FaultDescription fd = operationDesc.getFaultDescriptions()[i];
FaultBeanDesc faultBeanDesc = marshalDesc.getFaultBeanDesc(fd);
- String tryName = faultBeanDesc.getFaultBeanLocalName();
- if (elementQName.getLocalPart().equals(tryName)) {
- faultDesc = fd;
+ if (faultBeanDesc != null) {
+ String tryName = faultBeanDesc.getFaultBeanLocalName();
+ if (elementQName.getLocalPart().equals(tryName)) {
+ faultDesc = fd;
+ }
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBBlockContext.java Tue Oct 30 05:10:34 2007
@@ -99,12 +99,16 @@
public TreeSet<String> getContextPackages() {
return contextPackages;
}
+
+ public JAXBContext getJAXBContext() throws JAXBException {
+ return getJAXBContext(null);
+ }
/**
* @return get the JAXBContext
* @throws JAXBException
*/
- public JAXBContext getJAXBContext() throws JAXBException {
+ public JAXBContext getJAXBContext(ClassLoader cl) throws JAXBException {
if (jaxbContext == null) {
if (log.isDebugEnabled()) {
log.debug(
@@ -113,7 +117,7 @@
Holder<JAXBUtils.CONSTRUCTION_TYPE> constructType =
new Holder<JAXBUtils.CONSTRUCTION_TYPE>();
jaxbContext =
- JAXBUtils.getJAXBContext(contextPackages, constructType, contextPackagesKey);
+ JAXBUtils.getJAXBContext(contextPackages, constructType, contextPackagesKey, cl);
constructionType = constructType.value;
} else {
if (log.isDebugEnabled()) {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java Tue Oct 30 05:10:34 2007
@@ -51,14 +51,13 @@
/**
- * JAXB Utilites to pool JAXBContext and related objects. Currently the JAXBContext is pooled by
- * Class name. We may change this to create and pool by package name.
+ * JAXB Utilites to pool JAXBContext and related objects.
*/
public class JAXBUtils {
private static final Log log = LogFactory.getLog(JAXBUtils.class);
- // Create a concurrent map to get the JAXBObject: keys are ClassLoader and Set<String>.
+ // Create a concurrent map to get the JAXBObject: keys are ClassLoader and String (package names).
private static Map<ClassLoader, Map<String, JAXBContextValue>> jaxbMap =
new ConcurrentHashMap<ClassLoader, Map<String, JAXBContextValue>>();
@@ -78,7 +77,8 @@
// In that case, consider pooling Unmarshaller objects.
// Different threads may reuse one Unmarshaller instance,
// as long as you don't use one instance from two threads at the same time.
-
+ // ENABLE_ADV_POOLING is false...which means they are obtained from the JAXBContext instead of
+ // from the pool.
private static boolean ENABLE_ADV_POOLING = false;
// The maps are freed up when a LOAD FACTOR is hit
@@ -89,7 +89,7 @@
BY_CLASS_ARRAY, BY_CONTEXT_PATH, UNKNOWN}
;
-
+
/**
* Get a JAXBContext for the class
*
@@ -99,20 +99,51 @@
* @deprecated
*/
public static JAXBContext getJAXBContext(TreeSet<String> contextPackages) throws JAXBException {
+ return getJAXBContext(contextPackages, new Holder<CONSTRUCTION_TYPE>(),
+ contextPackages.toString(), null);
+ }
+
+ /**
+ * Get a JAXBContext for the class
+ *
+ * Note: The contextPackage object is used by multiple threads. It should be considered immutable
+ * and not altered by this method.
+ *
+ * @param contextPackage Set<Package>
+ * @param cacheKey ClassLoader
+ * @return JAXBContext
+ * @throws JAXBException
+ * @deprecated
+ */
+ public static JAXBContext getJAXBContext(TreeSet<String> contextPackages, ClassLoader
+ cacheKey) throws JAXBException {
return getJAXBContext(contextPackages, new Holder<CONSTRUCTION_TYPE>(),
- contextPackages.toString());
+ contextPackages.toString(), cacheKey);
+ }
+
+ public static JAXBContext getJAXBContext(TreeSet<String> contextPackages,
+ Holder<CONSTRUCTION_TYPE> constructionType,
+ String key)
+ throws JAXBException {
+ return getJAXBContext(contextPackages, constructionType, key, null);
}
/**
* Get a JAXBContext for the class
*
- * @param contextPackage Set<Package>
+ * Note: The contextPackage object is used by multiple threads. It should be considered immutable
+ * and not altered by this method.
+ *
+ * @param contextPackage Set<Package>
* @param contructionType (output value that indicates how the context was constructed)
+ * @param cacheKey ClassLoader
* @return JAXBContext
* @throws JAXBException
*/
public static JAXBContext getJAXBContext(TreeSet<String> contextPackages,
- Holder<CONSTRUCTION_TYPE> constructionType, String key)
+ Holder<CONSTRUCTION_TYPE> constructionType,
+ String key,
+ ClassLoader cacheKey)
throws JAXBException {
// JAXBContexts for the same class can be reused and are supposed to be thread-safe
if (log.isDebugEnabled()) {
@@ -121,11 +152,25 @@
log.debug(pkg);
}
}
- // The JAXBContexts are keyed by ClassLoader and the set of Strings
+
+ // The JAXBContexts are keyed by ClassLoader and the set of Strings
ClassLoader cl = getContextClassLoader();
// Get the innerMap
- Map<String, JAXBContextValue> innerMap = jaxbMap.get(cl);
+ Map<String, JAXBContextValue> innerMap = null;
+ if(cacheKey != null) {
+ if(log.isDebugEnabled()) {
+ log.debug("Using supplied classloader to retrieve JAXBContext: " +
+ cacheKey);
+ }
+ innerMap = jaxbMap.get(cacheKey);
+ }else {
+ if(log.isDebugEnabled()) {
+ log.debug("Using classloader from Thread to retrieve JAXBContext: " +
+ cl);
+ }
+ innerMap = jaxbMap.get(cl);
+ }
if (innerMap == null) {
adjustPoolSize(jaxbMap);
innerMap = new ConcurrentHashMap<String, JAXBContextValue>();
@@ -140,21 +185,26 @@
if (contextValue == null) {
adjustPoolSize(innerMap);
- // A pooled context was not found, so create one and put it in the map.
- synchronized(contextPackages) {
- // synchronized on contextPackages because this method may prune the contextPackages
- contextValue = createJAXBContextValue(contextPackages, cl);
- }
- // Put the new context in the map keyed by both the original and current list of packages
+ // Create a copy of the contextPackages. This new TreeSet will
+ // contain only the valid contextPackages.
+ // Note: The original contextPackage set is accessed by multiple
+ // threads and should not be altered.
+
+ TreeSet<String> validContextPackages = new TreeSet<String>(contextPackages);
+ contextValue = createJAXBContextValue(validContextPackages, cl);
+
+ // Put the new context in the map keyed by both the original and valid list of packages
+ String validPackagesKey = validContextPackages.toString();
innerMap.put(key, contextValue);
- innerMap.put(contextPackages.toString(), contextValue);
+ innerMap.put(validPackagesKey, contextValue);
if (log.isDebugEnabled()) {
- log.debug("JAXBContext [created] for " + contextPackages.toString());
+ log.debug("JAXBContext [created] for " + key);
+ log.debug("JAXBContext also stored by the list of valid packages:" + validPackagesKey);
}
} else {
if (log.isDebugEnabled()) {
- log.debug("JAXBContext [from pool] for " + contextPackages.toString());
+ log.debug("JAXBContext [from pool] for " + key);
}
}
constructionType.value = contextValue.constructionType;
@@ -850,7 +900,7 @@
if (e.getException() instanceof JAXBException) {
throw (JAXBException)e.getException();
} else if (e.getException() instanceof RuntimeException) {
- ExceptionFactory.makeWebServiceException(e.getException());
+ throw ExceptionFactory.makeWebServiceException(e.getException());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org