You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by am...@apache.org on 2006/12/07 09:29:39 UTC
svn commit: r483371 - in /webservices/axis2/branches/java/WSDL_2_0/modules:
codegen/src/org/apache/axis2/wsdl/codegen/emitter/
codegen/src/org/apache/axis2/wsdl/template/java/
kernel/src/org/apache/axis2/client/
Author: amilas
Date: Thu Dec 7 00:29:38 2006
New Revision: 483371
URL: http://svn.apache.org/viewvc?view=rev&rev=483371
Log:
set http option parameters to operational client in the generated stub.
Modified:
webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/client/Stub.java
Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=483371&r1=483370&r2=483371
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Thu Dec 7 00:29:38 2006
@@ -605,7 +605,7 @@
doc.appendChild(rootElement);
//////////////////////////////////////////////////////////
- System.out.println(DOM2Writer.nodeToString(rootElement));
+// System.out.println(DOM2Writer.nodeToString(rootElement));
////////////////////////////////////////////////////////////
return doc;
}
Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?view=diff&rev=483371&r1=483370&r2=483371
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Thu Dec 7 00:29:38 2006
@@ -272,6 +272,11 @@
setAppendAddressToEPR(_operationClient,"<xsl:value-of select="@http_location"/>");
</xsl:if>
+ <!-- add the other parameter options to operational client -->
+ <xsl:for-each select="optionParam">
+ addPropertyToOperationClient(_operationClient,<xsl:value-of select="@name"/>,<xsl:value-of select="@value"/>);
+ </xsl:for-each>
+
// create a message context
org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();
@@ -511,6 +516,11 @@
setAppendAddressToEPR(_operationClient,"<xsl:value-of select="@http_location"/>");
</xsl:if>
+ <!-- add the other parameter options to operational client -->
+ <xsl:for-each select="optionParam">
+ addPropertyToOperationClient(_operationClient,<xsl:value-of select="@name"/>,<xsl:value-of select="@value"/>);
+ </xsl:for-each>
+
<!--todo if the stub was generated with unwrapping, wrap all parameters into a single element-->
// create SOAP envelope with that payload
@@ -687,6 +697,11 @@
setAppendAddressToEPR(_operationClient,"<xsl:value-of select="@http_location"/>");
</xsl:if>
+ <!-- add the other parameter options to operational client -->
+ <xsl:for-each select="optionParam">
+ addPropertyToOperationClient(_operationClient,<xsl:value-of select="@name"/>,<xsl:value-of select="@value"/>);
+ </xsl:for-each>
+
<xsl:for-each select="input/param[@Action!='']">_operationClient.getOptions().setAction("<xsl:value-of select="@Action"/>");</xsl:for-each>
org.apache.axiom.soap.SOAPEnvelope env = null;
org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext();
@@ -834,7 +849,7 @@
</xsl:if>
</xsl:for-each>
-
+
/**
* A utility method that copies the namepaces from the SOAPEnvelope
*/
Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/client/Stub.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/client/Stub.java?view=diff&rev=483371&r1=483370&r2=483371
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/client/Stub.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/client/Stub.java Thu Dec 7 00:29:38 2006
@@ -192,4 +192,31 @@
messageContext.setProperty(HTTPConstants.HTTP_HEADERS, headers);
}
+ /**
+ * sets the propertykey and propertyValue as a pair to operation client
+ * @param operationClient
+ * @param propertyKey
+ * @param propertyValue
+ */
+
+ protected void addPropertyToOperationClient(OperationClient operationClient,
+ String propertyKey,
+ Object propertyValue){
+ Options options = new Options();
+ options.setProperty(propertyKey,propertyValue);
+ operationClient.setOptions(options);
+ }
+
+ protected void addPropertyToOperationClient(OperationClient operationClient,
+ String propertyKey,
+ boolean value){
+ addPropertyToOperationClient(operationClient,propertyKey,new Boolean(value));
+ }
+
+ protected void addPropertyToOperationClient(OperationClient operationClient,
+ String propertyKey,
+ int value){
+ addPropertyToOperationClient(operationClient,propertyKey,new Integer(value));
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org