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/08/09 17:15:50 UTC
svn commit: r564235 [2/9] - in /webservices/axis2/branches/java/jaxws21: ./
legal/ modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb/src/org/apache/axis2/databinding/utils/
modules/addressing/src/org/apache/axis2/handlers/addressing...
Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl Thu Aug 9 08:14:52 2007
@@ -113,6 +113,8 @@
return NULL;
}
+ memset(<xsl:value-of select="$name"/>, 0, sizeof(<xsl:value-of select="$axis2_name"/>_t));
+
<xsl:for-each select="property">
<xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
<xsl:choose>
Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Thu Aug 9 08:14:52 2007
@@ -748,13 +748,12 @@
OMElement wrappingElement;
if (partName == null) {
wrappingElement = fac.createOMElement("arg" + argCount, null);
- wrappingElement.addChild((OMElement)arg);
} else {
wrappingElement = fac.createOMElement(partName, null);
- wrappingElement.addChild((OMElement)arg);
}
OMText text = fac.createOMText(arg, true);
- objects.add(text);
+ wrappingElement.addChild(text);
+ objects.add(wrappingElement);
} else {
objects.add(arg);
}
Modified: webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingFinalInHandler.java Thu Aug 9 08:14:52 2007
@@ -83,19 +83,11 @@
//on the inbound response side of a synchronous request-response exchange.
if (!alreadyFoundAddrHeader.contains(WSA_TO) && !messageContext.isServerSide()) {
Options messageContextOptions = messageContext.getOptions();
- EndpointReference epr = messageContextOptions.getTo();
-
- if (epr == null) {
- epr = new EndpointReference("");
- messageContextOptions.setTo(epr);
- }
-
if (log.isTraceEnabled()) {
log.trace(messageContext.getLogIDString() +
" setDefaults: Setting WS-Addressing default value for the To property.");
}
-
- epr.setAddress(Final.WSA_ANONYMOUS_URL);
+ messageContextOptions.setTo(new EndpointReference(Final.WSA_ANONYMOUS_URL));
}
if (!alreadyFoundAddrHeader.contains(WSA_REPLY_TO)) {
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java Thu Aug 9 08:14:52 2007
@@ -40,7 +40,7 @@
System.out.println(CodegenMessages.getMessage("wsdl2code.arg"));
System.out.println(CodegenMessages.getMessage("wsdl2code.arg1"));
- for (int i = 2; i <= 34; i++) {
+ for (int i = 2; i <= 36; i++) {
System.out.println(" " + CodegenMessages.getMessage("wsdl2code.arg" + i));
}
System.exit(0);
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties Thu Aug 9 08:14:52 2007
@@ -26,6 +26,7 @@
# Note the last extension - It includes a check to figure out whether proper databinding has taken place
# This extension should appear AFTER all the databinding extensions inorder to function properly
codegen.extension=org.apache.axis2.wsdl.codegen.extension.PackageFinder,\
+org.apache.axis2.wsdl.codegen.extension.JAXWSWapperExtension,\
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension,\
org.apache.axis2.wsdl.codegen.extension.JaxMeExtension, \
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension, \
@@ -54,7 +55,7 @@
codegen.databinding.frameworks=adb,xmlbeans,jaxme,jibx,jaxbri,none
# this property keeps the names of the databinding frameworks which support
# unwrapping
-codegen.databinding.unwrap.supported=adb,xmlbeans,jibx
+codegen.databinding.unwrap.supported=adb,xmlbeans,jibx,jaxbri
# this property keeps the names of the databinding frameworks that handle unwrapping
# directly (rather than by using the unwrapper extension)
codegen.databinding.unwrap.direct=jibx
@@ -78,12 +79,12 @@
# Language types - these are the language types that the code generator understands. Again this is the name of the
# language that should be passed from the tool as well
#
-codegen.languages=java,c
+codegen.languages=java,c,jax-ws
# Emitter class is the major code generator class that should be changed according to the language.
# The emiiters need to implement the org.apache.axis2.wsdl.codegen.emitter.Emitter interface
# Note - The emitters should appear in the lexical order of the languages. So the language java in the above
# list corresponds to the org.apache.axis2.wsdl.codegen.emitter.JavaEmitter
-codegen.emitters=org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter,org.apache.axis2.wsdl.codegen.emitter.CEmitter
+codegen.emitters=org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter,org.apache.axis2.wsdl.codegen.emitter.CEmitter,org.apache.axis2.wsdl.codegen.emitter.jaxws.JAXWS20Emitter
# Default language, this is the default language that would be picked when no language is specified. it should be
# one of the languages specified above
codegen.languages.default=java
@@ -135,4 +136,15 @@
# file extension for generated source files from this language
c.filename.extension=c
+
+jax-ws.callback.template=org.apache.axis2.wsdl.codegen.writer.CallbackHandlerWriter,/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
+jax-ws.exception.template=org.apache.axis2.wsdl.codegen.writer.ExceptionWriter,/org/apache/axis2/wsdl/template/java/JaxwsExceptionTemplate.xsl
+jax-ws.skeleton.template=org.apache.axis2.wsdl.codegen.writer.SkeletonWriter,/org/apache/axis2/wsdl/template/java/JaxwsServiceClassTemplate.xsl
+jax-ws.skeleton.interface.template=org.apache.axis2.wsdl.codegen.writer.SkeletonInterfaceWriter,/org/apache/axis2/wsdl/template/java/JaxwsServiceEndpointInterfaceTemplate.xsl
+jax-ws.testclass.template=org.apache.axis2.wsdl.codegen.writer.TestClassWriter,/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
+jax-ws.service.template=org.apache.axis2.wsdl.codegen.writer.ServiceXMLWriter,/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
+jax-ws.antbuild.jaxbri.template=org.apache.axis2.wsdl.codegen.writer.AntBuildWriter,/org/apache/axis2/wsdl/template/general/jaxbriAntBuildTemplate.xsl
+jax-ws.antbuild.none.template=org.apache.axis2.wsdl.codegen.writer.AntBuildWriter,/org/apache/axis2/wsdl/template/general/defaultAntBuildTemplate.xsl
+# file extension for generated files from this language
+jax-ws.filename.extension=java
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Thu Aug 9 08:14:52 2007
@@ -279,7 +279,12 @@
axisBindingMessage = (AxisBindingMessage) axisBindingOperation.getChild(key);
if (axisBindingMessage != null) {
- return axisBindingMessage.getEffectivePolicy();
+ try {
+ return axisBindingMessage.getEffectivePolicy();
+ } catch (RuntimeException ex){
+ System.out.println("ERROR: Ignoring policy - " + ex.getMessage());
+ log.error(ex.getMessage(), ex);
+ }
}
}
return null;
@@ -528,7 +533,7 @@
}
}
- private Map getNewCopy(Map copyFormMap) {
+ public Map getNewCopy(Map copyFormMap) {
Map copyToMap = new HashMap();
Object key;
for (Iterator iter = copyFormMap.keySet().iterator(); iter.hasNext();) {
@@ -538,7 +543,7 @@
return copyToMap;
}
- private void copyMap(Map copyFormMap, Map copyToMap) {
+ public void copyMap(Map copyFormMap, Map copyToMap) {
Object key;
for (Iterator iter = copyFormMap.keySet().iterator(); iter.hasNext();) {
key = iter.next();
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JavaPrettyPrinterExtension.java Thu Aug 9 08:14:52 2007
@@ -19,6 +19,7 @@
package org.apache.axis2.wsdl.codegen.extension;
import org.apache.axis2.util.PrettyPrinter;
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import java.io.File;
@@ -31,6 +32,24 @@
* well !!!
*/
fileExtension = ".java";
+ }
+
+ /**
+ * Recursive procedure to prettify the files
+ *
+ * @param file
+ */
+ protected void prettify(File file, CodeGenConfiguration configuration) {
+ if (file.isFile() &&
+ file.exists() &&
+ file.getName().toLowerCase().endsWith(fileExtension)) {
+ prettifyFile(file);
+ } else if (file.isDirectory()) {
+ File[] childFiles = file.listFiles();
+ for (int i = 0; i < childFiles.length; i++) {
+ prettify(childFiles[i], configuration);
+ }
+ }
}
/**
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDL11Writer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDL11Writer.java?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDL11Writer.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDL11Writer.java Thu Aug 9 08:14:52 2007
@@ -39,6 +39,7 @@
import java.util.Map;
import java.util.Vector;
import java.util.ArrayList;
+import java.util.Stack;
public class WSDL11Writer {
@@ -76,7 +77,7 @@
public void writeWSDL(AxisService axisService, Definition definition, Map changedMap) {
try {
if (axisService != null) {
- writeWSDL(definition, axisService.getName(), changedMap);
+ writeWSDL(definition, axisService.getName(), changedMap, new Stack());
}
} catch (Exception e) {
throw new RuntimeException("WSDL writing failed!", e);
@@ -85,7 +86,9 @@
private void writeWSDL(Definition definition,
String serviceName,
- Map changedMap) throws Exception {
+ Map changedMap,
+ Stack stack) throws Exception {
+ stack.push(definition);
// first process the imports and save them.
Map imports = definition.getImports();
if (imports != null && (imports.size() > 0)) {
@@ -98,13 +101,16 @@
for (Iterator importsIter = importsVector.iterator(); importsIter.hasNext();) {
wsdlImport = (Import)importsIter.next();
wsdlName = "wsdl_" + count++ + ".wsdl";
- writeWSDL(wsdlImport.getDefinition(), wsdlName, changedMap);
+ Definition innerDefinition = wsdlImport.getDefinition();
+ if(!stack.contains(innerDefinition)) {
+ writeWSDL(innerDefinition, wsdlName, changedMap, stack);
+ }
wsdlImport.setLocationURI(wsdlName);
}
}
}
// change the locations on the imported schemas
- adjustWSDLSchemaLocatins(definition, changedMap);
+ adjustWSDLSchemaLocations(definition, changedMap);
// finally save the file
WSDLWriter wsdlWriter = WSDLFactory.newInstance().newWSDLWriter();
File outputFile = FileWriter.createClassFile(baseFolder,
@@ -148,14 +154,25 @@
}
out.flush();
out.close();
+ stack.pop();
}
/**
+ * @deprecated please use adjustWSDLSchemaLocations
+ * @param definition
+ * @param changedSchemaLocations
+ */
+ public void adjustWSDLSchemaLocatins(Definition definition, Map changedSchemaLocations) {
+ adjustWSDLSchemaLocations(definition, changedSchemaLocations);
+ }
+
+ /**
* adjust the schema locations in the original wsdl
*
- * @param changedScheamLocations
+ * @param definition
+ * @param changedSchemaLocations
*/
- public void adjustWSDLSchemaLocatins(Definition definition, Map changedScheamLocations) {
+ public void adjustWSDLSchemaLocations(Definition definition, Map changedSchemaLocations) {
Types wsdlTypes = definition.getTypes();
if (wsdlTypes != null) {
List extensibilityElements = wsdlTypes.getExtensibilityElements();
@@ -165,7 +182,7 @@
currentObject = iter.next();
if (currentObject instanceof Schema) {
schema = (Schema)currentObject;
- changeLocations(schema.getElement(), changedScheamLocations);
+ changeLocations(schema.getElement(), changedSchemaLocations);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties (original)
+++ webservices/axis2/branches/java/jaxws21/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties Thu Aug 9 08:14:52 2007
@@ -65,9 +65,11 @@
wsdl2code.arg29= -E<key> <value> Extra configuration options specific to certain databindings. Examples:
wsdl2code.arg30= \t\t\t -Ebindingfile <path> (for jibx) - specify the file path for the binding file
wsdl2code.arg31= \t\t\t -Etypesystemname <my_type_system_name> (for xmlbeans) - override the randomly generated type system name
-wsdl2code.arg32= --noBuildXML Don't generate the build.xml in the output directory
-wsdl2code.arg33= --noWSDL Don't generate WSDL's in the resources directory
-wsdl2code.arg34= --noMessageReceiver Don't generate a MessageReceiver in the generated sources
+wsdl2code.arg32= \t\t\t -Emp <package name> (for ADB) - extension mapper package name
+wsdl2code.arg33= \t\t\t -Eosv (for ADB) - off strict validation.
+wsdl2code.arg34= --noBuildXML Don't generate the build.xml in the output directory
+wsdl2code.arg35= --noWSDL Don't generate WSDL's in the resources directory
+wsdl2code.arg36= --noMessageReceiver Don't generate a MessageReceiver in the generated sources
################## prop file loader #################################
propfileload.frameworkMismatch=Number of frameworks and extension names do not match!
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?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- 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 Thu Aug 9 08:14:52 2007
@@ -34,6 +34,11 @@
#include "<xsl:value-of select="$inputtype"/>.h"
</xsl:for-each>
</xsl:for-each>
+
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
/* function prototypes - for header file*/
/**
* <xsl:value-of select="$method-prefix"/>_create
@@ -113,5 +118,9 @@
</xsl:if> <!--close for test="$mep='http://www.w3.org/2004/08/wsdl/in-out'"-->
</xsl:for-each>
</xsl:if> <!--close for test="$isAsync='1'-->
+
+ #ifdef __cplusplus
+ }
+ #endif
</xsl:template>
</xsl:stylesheet>
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?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- 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 Thu Aug 9 08:14:52 2007
@@ -19,6 +19,7 @@
*/
#include "<xsl:value-of select="@name"/>.h"
+ #include <axis2_msg.h>
/**
* <xsl:value-of select="@name"/> C implementation
@@ -53,10 +54,23 @@
axutil_qname_t *op_qname = NULL;
axis2_svc_t *svc = NULL;
axis2_op_t *op = NULL;
+ axis2_op_t *annon_op = NULL;
+ axis2_msg_t *msg_out = NULL;
+ axis2_msg_t *msg_in = NULL;
+ axis2_msg_t *msg_out_fault = NULL;
+ axis2_msg_t *msg_in_fault = NULL;
+
/* Modifying the Service */
svc_client = axis2_stub_get_svc_client (stub, env );
svc = (axis2_svc_t*)axis2_svc_client_get_svc( svc_client, env );
+
+ annon_op = axis2_svc_get_op_with_name(svc, env, AXIS2_ANON_OUT_IN_OP);
+ msg_out = axis2_op_get_msg(annon_op, env, AXIS2_MSG_OUT);
+ msg_in = axis2_op_get_msg(annon_op, env, AXIS2_MSG_IN);
+ msg_out_fault = axis2_op_get_msg(annon_op, env, AXIS2_MSG_OUT_FAULT);
+ msg_in_fault = axis2_op_get_msg(annon_op, env, AXIS2_MSG_IN_FAULT);
+
axutil_qname_create(env,"<xsl:value-of select="@servicename"/>" ,NULL, NULL);
axis2_svc_set_qname (svc, env, svc_qname);
@@ -77,6 +91,15 @@
axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_IN);
</xsl:otherwise>
</xsl:choose>
+ axis2_msg_increment_ref(msg_out, env);
+ axis2_msg_increment_ref(msg_in, env);
+ axis2_msg_increment_ref(msg_out_fault, env);
+ axis2_msg_increment_ref(msg_in_fault, env);
+ axis2_op_add_msg(op, env, AXIS2_MSG_OUT, msg_out);
+ axis2_op_add_msg(op, env, AXIS2_MSG_IN, msg_in);
+ axis2_op_add_msg(op, env, AXIS2_MSG_OUT_FAULT, msg_out);
+ axis2_op_add_msg(op, env, AXIS2_MSG_IN_FAULT, msg_in);
+
axis2_svc_add_op(svc, env, op);
</xsl:for-each>
@@ -155,7 +178,7 @@
axutil_qname_t *op_qname = NULL;
axiom_node_t *payload = NULL;
<xsl:if test="$style='doc'">
- const axutil_string_t *soap_act = NULL;
+ axutil_string_t *soap_act = NULL;
</xsl:if>
<xsl:if test="output/param/@ours">
<!-- this means data binding is enable -->
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?view=diff&rev=564235&r1=564234&r2=564235
==============================================================================
--- 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 Thu Aug 9 08:14:52 2007
@@ -385,14 +385,11 @@
<xsl:choose>
<xsl:when test="@mustUnderstand = 'true'">
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.setMustUnderstand(true);
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env,true);
</xsl:when>
<xsl:otherwise>
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env);
</xsl:otherwise>
</xsl:choose>
}
@@ -482,6 +479,10 @@
return toShort(_returnEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(_returnEnv));
</xsl:when>
+ <xsl:when test="$outputtype='boolean'">
+ return toBoolean(_returnEnv.getBody().getFirstElement(),
+ getEnvelopeNamespaces(_returnEnv));
+ </xsl:when>
<xsl:otherwise>
java.lang.Object object = fromOM(
_returnEnv.getBody().getFirstElement() ,
@@ -662,14 +663,11 @@
<xsl:choose>
<xsl:when test="@mustUnderstand = 'true'">
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.setMustUnderstand(true);
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env,true);
</xsl:when>
<xsl:otherwise>
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env);
</xsl:otherwise>
</xsl:choose>
}
@@ -754,6 +752,10 @@
callback.receiveResult<xsl:value-of select="@name"/>(toShort(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
+ <xsl:when test="$outputtype='boolean'">
+ callback.receiveResult<xsl:value-of select="@name"/>(toBoolean(resultEnv.getBody().getFirstElement(),
+ getEnvelopeNamespaces(resultEnv)));
+ </xsl:when>
<xsl:otherwise>
java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),
<xsl:value-of select="$outputtype"/>.class,
@@ -778,8 +780,64 @@
}
}
- public void onError(java.lang.Exception e) {
- callback.receiveError<xsl:value-of select="@name"/>(e);
+ public void onError(java.lang.Exception error) {
+ if (error instanceof org.apache.axis2.AxisFault) {
+ org.apache.axis2.AxisFault f = (org.apache.axis2.AxisFault) error;
+ org.apache.axiom.om.OMElement faultElt = f.getDetail();
+ if (faultElt!=null){
+ if (faultExceptionNameMap.containsKey(faultElt.getQName())){
+ //make the fault by reflection
+ try{
+ java.lang.String exceptionClassName = (java.lang.String)faultExceptionClassNameMap.get(faultElt.getQName());
+ java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
+ java.lang.Exception ex=
+ (java.lang.Exception) exceptionClass.newInstance();
+ //message class
+ java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());
+ java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
+ java.lang.Object messageObject = fromOM(faultElt,messageClass,null);
+ java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
+ new java.lang.Class[]{messageClass});
+ m.invoke(ex,new java.lang.Object[]{messageObject});
+ <xsl:for-each select="fault/param">
+ if (ex instanceof <xsl:value-of select="@name"/>){
+ callback.receiveError<xsl:value-of select="$method-name"/>((<xsl:value-of select="@name"/>)ex);
+ return;
+ }
+ </xsl:for-each>
+
+ callback.receiveError<xsl:value-of select="@name"/>(new java.rmi.RemoteException(ex.getMessage(), ex));
+ } catch(java.lang.ClassCastException e){
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (java.lang.ClassNotFoundException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (java.lang.NoSuchMethodException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (java.lang.reflect.InvocationTargetException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (java.lang.IllegalAccessException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (java.lang.InstantiationException e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ } catch (org.apache.axis2.AxisFault e) {
+ // we cannot intantiate the class - throw the original Axis fault
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ }
+ } else {
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ }
+ } else {
+ callback.receiveError<xsl:value-of select="@name"/>(f);
+ }
+ } else {
+ callback.receiveError<xsl:value-of select="@name"/>(error);
+ }
}
public void onFault(org.apache.axis2.context.MessageContext faultContext) {
@@ -911,14 +969,11 @@
<xsl:choose>
<xsl:when test="@mustUnderstand = 'true'">
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.setMustUnderstand(true);
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env,true);
</xsl:when>
<xsl:otherwise>
org.apache.axiom.om.OMElement omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- org.apache.axiom.soap.SOAPHeaderBlock soapHeaderBlock<xsl:value-of select="@name"/> = env.getHeader().addHeaderBlock(omElement<xsl:value-of select="@name"/>.getLocalName(),omElement<xsl:value-of select="@name"/>.getNamespace());
- soapHeaderBlock<xsl:value-of select="@name"/>.addChild(omElement<xsl:value-of select="@name"/>.getFirstElement());
+ addHeader(omElement<xsl:value-of select="@name"/>,env);
</xsl:otherwise>
</xsl:choose>
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org