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 sa...@apache.org on 2006/03/09 10:04:29 UTC
svn commit: r384466 - in /webservices/axis2/trunk/java/modules:
codegen/src/org/apache/axis2/wsdl/codegen/emitter/
codegen/src/org/apache/axis2/wsdl/codegen/extension/
codegen/src/org/apache/axis2/wsdl/template/java/
codegen/src/org/apache/axis2/wsdl/u...
Author: sanka
Date: Thu Mar 9 01:04:26 2006
New Revision: 384466
URL: http://svn.apache.org/viewcvs?rev=384466&view=rev
Log:
Adding policy support for MTOM in the generated stubs
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTConstants.java
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/PolicyExtension.java
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Thu Mar 9 01:04:26 2006
@@ -73,8 +73,6 @@
import org.w3c.dom.Element;
import org.w3c.dom.Text;
-import com.ibm.wsdl.util.xml.DOM2Writer;
-
//~--- classes ----------------------------------------------------------------
public abstract class MultiLanguageClientEmitter implements Emitter {
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java Thu Mar 9 01:04:26 2006
@@ -29,10 +29,11 @@
import org.apache.axis2.description.AxisModule;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.modules.Module;
-import org.apache.axis2.modules.PolicyExtension;
import org.apache.axis2.modules.ModulePolicyExtension;
+import org.apache.axis2.modules.PolicyExtension;
import org.apache.axis2.util.PolicyAttachmentUtil;
import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
+import org.apache.axis2.wsdl.util.XSLTConstants;
import org.apache.ws.policy.AndCompositeAssertion;
import org.apache.ws.policy.Policy;
import org.apache.ws.policy.PrimitiveAssertion;
@@ -55,7 +56,9 @@
CodeGenConfiguration configuration;
- HashMap ns2modules = new HashMap();
+//HashMap ns2modules = new HashMap();
+
+ HashMap ns2Exts = new HashMap();
PolicyAttachmentUtil util;
@@ -67,17 +70,35 @@
public void init(CodeGenConfiguration configuration) {
this.configuration = configuration;
util = new PolicyAttachmentUtil(configuration.getWom());
+
+ //////////////////////////////////////////////////////////////////
+
+ // adding default PolicyExtensions
+ ns2Exts.put("http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization", new MTOMPolicyExtension());
+ ns2Exts.put("http://schemas.xmlsoap.org/ws/2004/09/policy/encoding", new EncodePolicyExtension());
+
+ //////////////////////////////////////////////////////////////////
+
+
+ configuration.putProperty("policyExtensionTemplate", "/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl");
+
+
+
+ ////////////////////////////////////////////////////////////////////
+
+
+
String repository = configuration.getRepositoryPath();
-
+
if (repository == null) {
- System.err.println("Warning: repository is not specified");
- System.err.println("policy will not be supported");
return;
}
try {
+
+
ConfigurationContext configurationCtx = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(repository, null);
AxisConfiguration axisConfiguration = configurationCtx
@@ -85,15 +106,23 @@
for (Iterator iterator = axisConfiguration.getModules().values()
.iterator(); iterator.hasNext();) {
- AxisModule axisModule = (AxisModule) iterator.next();
+
+ AxisModule axisModule = (AxisModule) iterator.next();
String[] namespaces = axisModule.getSupportedPolicyNamespaces();
if (namespaces == null) {
continue;
}
+
+ Module module = axisModule.getModule();
+ if (!(module instanceof ModulePolicyExtension)) {
+ continue;
+ }
+
+ PolicyExtension ext = ((ModulePolicyExtension) module).getPolicyExtension();
for (int i = 0; i < namespaces.length; i++) {
- ns2modules.put(namespaces[i], axisModule);
+ ns2Exts.put(namespaces[i], ext);
}
}
@@ -102,16 +131,13 @@
System.err
.println("cannot create repository : policy will not be supported");
}
-
- //
- configuration.putProperty("policyExtensionTemplate", "/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl");
}
public void engage() {
- if (ns2modules.isEmpty()) {
- System.err.println("Any policy supported module not found");
- return;
- }
+
+ // TODO XSLTConstants.BASE_64_PROPERTY_KEY
+
+
WSDLDescription womDescription = configuration.getWom();
String serviceName = configuration.getServiceName();
@@ -161,7 +187,7 @@
for (Iterator iterator = wsdlInterface.getOperations().values()
.iterator(); iterator.hasNext();) {
WSDLOperation wsdlOperation = (WSDLOperation) iterator.next();
- Policy policy = util.getOperationPolicy(wsdlEndpoint.getName(),
+ Policy policy = util.getPolicyForOperation(wsdlEndpoint.getName(),
wsdlOperation.getName());
if (policy != null) {
@@ -190,6 +216,7 @@
private void processPolicies(Document document, Element rootElement,
Policy policy, WSDLEndpoint wsdlEndpoint, WSDLOperation operation) {
+
if (!policy.isNormalized()) {
policy = (Policy) policy.normalize();
}
@@ -225,26 +252,16 @@
for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
String namespace = (String) iterator.next();
- AxisModule axisModule = (AxisModule) ns2modules.get(namespace);
+ PolicyExtension policyExtension = (PolicyExtension) ns2Exts.get(namespace);
+
+// AxisModule axisModule = (AxisModule) ns2modules.get(namespace);
- if (axisModule == null) {
- System.err.println("cannot find a module to process "
+ if (policyExtension == null) {
+ System.err.println("cannot find a PolicyExtension to process "
+ namespace + "type assertions");
continue;
}
- Module module = axisModule.getModule();
-
- if (!(module instanceof ModulePolicyExtension)) {
- System.err
- .println(axisModule.getName()
- + " module doesnt provde a PolicyExtension to process policies");
- continue;
- }
-
- PolicyExtension policyExtension = ((ModulePolicyExtension) module)
- .getPolicyExtension();
-
Policy nPolicy = new Policy();
XorCompositeAssertion nXOR = new XorCompositeAssertion();
nPolicy.addTerm(nXOR);
@@ -253,7 +270,8 @@
.get(namespace);
nXOR.addTerm(nAND);
- policyExtension.addMethodsToStub(document, rootElement, nPolicy);
+ QName operationName = operation.getName();
+ policyExtension.addMethodsToStub(document, rootElement, operationName, nPolicy);
}
configuration.putProperty("stubMethods", rootElement);
@@ -269,4 +287,35 @@
throw new RuntimeException(e);
}
}
+
+ class MTOMPolicyExtension implements PolicyExtension {
+
+ boolean setOnce = false;
+
+ public void addMethodsToStub(Document document, Element element, QName operationName, Policy policy) {
+
+ if (!setOnce) {
+ Object plainBase64PropertyMap = configuration.getProperty(XSLTConstants.PLAIN_BASE_64_PROPERTY_KEY);
+ configuration.putProperty(XSLTConstants.BASE_64_PROPERTY_KEY, plainBase64PropertyMap);
+
+ setOnce = true;
+ }
+
+ Element optimizeContent = document.createElement("optimizeContent");
+ Element opNameElement = document.createElement("opName");
+
+ opNameElement.setAttribute("ns-url", operationName.getNamespaceURI());
+ opNameElement.setAttribute("localName", operationName.getLocalPart());
+
+ optimizeContent.appendChild(opNameElement);
+
+ element.appendChild(optimizeContent);
+ }
+ };
+
+ class EncodePolicyExtension implements PolicyExtension {
+ public void addMethodsToStub(Document document, Element element, QName operationName, Policy policy) {
+ // TODO implement encoding
+ }
+ }
}
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Thu Mar 9 01:04:26 2006
@@ -190,6 +190,7 @@
// prune the generated schema type system and add the list of base64 types
FindBase64Types(sts);
+ findPlainBase64Types(sts);
//get the schematypes and add the document types to the type mapper
SchemaType[] schemaType = sts.documentTypes();
@@ -276,7 +277,43 @@
configuration.putProperty(XSLTConstants.BASE_64_PROPERTY_KEY, base64ElementQNamesList);
}
-
+
+ private void findPlainBase64Types(SchemaTypeSystem sts) {
+ ArrayList allSeenTypes = new ArrayList();
+
+ allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
+ allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
+
+ ArrayList base64Types = new ArrayList();
+
+ for (Iterator iterator = allSeenTypes.iterator(); iterator.hasNext(); ) {
+ SchemaType stype = (SchemaType) iterator.next();
+ findPlainBase64Types(stype, base64Types);
+ }
+
+ configuration.putProperty(XSLTConstants.PLAIN_BASE_64_PROPERTY_KEY, base64Types);
+ }
+
+ private void findPlainBase64Types(SchemaType stype, ArrayList base64Types) {
+
+ SchemaProperty[] elementProperties = stype.getElementProperties();
+
+ for (int i = 0; i < elementProperties.length; i++) {
+ SchemaType schemaType = elementProperties[i].getType();
+
+ if (schemaType.isPrimitiveType()) {
+ SchemaType primitiveType = schemaType.getPrimitiveType();
+
+ if (Constants.BASE_64_CONTENT_QNAME.equals(primitiveType.getName())) {
+ base64Types.add(elementProperties[i].getName());
+ }
+
+ } else {
+ findPlainBase64Types(schemaType, base64Types);
+ }
+ }
+ }
+
/**
* Loading the external schemas.
*
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/DatabindingTemplate.xsl Thu Mar 9 01:04:26 2006
@@ -16,24 +16,26 @@
<xsl:for-each select="param">
<xsl:if test="@type!=''">
- private org.apache.ws.commons.om.OMElement toOM(<xsl:value-of select="@type"/> param){
+ private org.apache.ws.commons.om.OMElement toOM(<xsl:value-of select="@type"/> param, boolean optimzieContent){
org.apache.ws.commons.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.ws.commons.om.impl.llom.builder.StAXOMBuilder
(org.apache.ws.commons.om.OMAbstractFactory.getOMFactory(),new org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader())) ;
org.apache.ws.commons.om.OMElement documentElement = builder.getDocumentElement();
- <xsl:if test="$base64">
+ <xsl:if test="$base64">
+ if (optimzieContent) {
optimizeContent(documentElement,qNameArray);
+ }
</xsl:if>
((org.apache.ws.commons.om.impl.OMNodeEx)documentElement).setParent(null);
return documentElement;
}
- private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
+ private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param, boolean optimizeContent){
org.apache.ws.commons.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
if (param != null){
- envelope.getBody().addChild(toOM(param));
+ envelope.getBody().addChild(toOM(param, optimizeContent));
}
return envelope;
}
@@ -67,6 +69,7 @@
<!-- Generate the base 64 optimize methods only if the base64 items are present -->
<xsl:if test="$base64">
+
private void optimizeContent(org.apache.ws.commons.om.OMElement element, javax.xml.namespace.QName[] qNames){
for (int i = 0; i < qNames.length; i++) {
markElementsAsOptimized(qNames[i],element);
@@ -116,10 +119,10 @@
}
private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(
- org.apache.ws.commons.soap.SOAPFactory factory, Object param) {
+ org.apache.ws.commons.soap.SOAPFactory factory, Object param, boolean optimizeContent) {
org.apache.ws.commons.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
if (param != null){
- envelope.getBody().addChild(toOM(param));
+ envelope.getBody().addChild(toOM(param, optimizeContent));
}
return envelope;
@@ -191,7 +194,7 @@
}
}
- private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param){
+ private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param, boolean optimizeContent){
if (param instanceof org.apache.axis2.databinding.ADBBean){
org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new
org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(<xsl:value-of select="@type"/>.MY_QNAME),
@@ -244,7 +247,7 @@
return param;
}
- private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, org.apache.ws.commons.om.OMElement param){
+ private org.apache.ws.commons.soap.SOAPEnvelope toEnvelope(org.apache.ws.commons.soap.SOAPFactory factory, org.apache.ws.commons.om.OMElement param, boolean optimizeContent){
org.apache.ws.commons.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
envelope.getBody().addChild(param);
return envelope;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Thu Mar 9 01:04:26 2006
@@ -9,6 +9,7 @@
-->
<xsl:include href="externalTemplate"/>
+
<xsl:include href="policyExtensionTemplate"/>
<xsl:template match="/class">
@@ -173,6 +174,11 @@
<xsl:variable name="soapAction"><xsl:value-of select="@soapaction"></xsl:value-of></xsl:variable>
<xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
+
+ <!-- MTOM -->
+ <xsl:variable name="method-name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="method-ns"><xsl:value-of select="@namespace"/> </xsl:variable>
+ <!-- MTOM -->
<!-- Code generation for the in-out mep -->
<xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-out'">
@@ -216,18 +222,18 @@
<xsl:for-each select="input/param[@location='body']">
<xsl:choose>
<xsl:when test="@type!=''">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="@name"/>);
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
</xsl:when>
<xsl:otherwise>
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()));
</xsl:otherwise>
</xsl:choose>
- </xsl:for-each>
+ </xsl:for-each>
<xsl:for-each select="input/param[@location='header']">
// add the children only if the parameter is not null
if (<xsl:value-of select="@name"/>!=null){
- env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>));
+ env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>"))));
}
</xsl:for-each>
</xsl:when>
@@ -330,7 +336,7 @@
<xsl:for-each select="input/param[@location='body']">
<xsl:choose>
<xsl:when test="@type!=''">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="@name"/>);
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
</xsl:when>
<xsl:otherwise>
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()));
@@ -340,7 +346,7 @@
<xsl:for-each select="input/param[@location='header']">
// add the headers only if they are not null
if (<xsl:value-of select="@name"/>!=null){
- env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>));
+ env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>"))));
}
</xsl:for-each>
</xsl:when>
@@ -442,7 +448,7 @@
<xsl:when test="$style='doc'">
<!-- for the doc lit case there can be only one element. So take the first element -->
//Style is Doc.
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>);
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
</xsl:when>
<xsl:otherwise>
//Unknown style!! No code is generated
@@ -574,7 +580,39 @@
////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+
+
</xsl:if>
+
+ ///////////////////////////////////////////////////////////////////////
+
+
+
+ private javax.xml.namespace.QName[] opNameArray;
+
+
+ private boolean optimizeContent(javax.xml.namespace.QName opName) {
+ if (opNameArray == null) {
+ return false;
+ }
+ for (int i = 0; i < opNameArray.length; i++) {
+ if (opName.equals(opNameArray[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+
+ ////////////////////////////////////////////////////////////////////////
//<xsl:apply-templates/>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Thu Mar 9 01:04:26 2006
@@ -96,7 +96,7 @@
<xsl:choose>
<xsl:when test="$returntype!=''">
- envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>);
+ envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
</xsl:when>
<xsl:otherwise>
envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/PolicyExtensionTemplate.xsl Thu Mar 9 01:04:26 2006
@@ -2,7 +2,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="stubMethods">
-
+
<xsl:if test="//createSequence">
/**
* Starts a reliabel message sequence
@@ -29,6 +29,19 @@
_getServiceClient().getOptions().setProperty("END_RM_SEQUENCE", "true");
}
</xsl:if>
+
+ <xsl:variable name="optimized">
+ <xsl:value-of select="//optimizeContent"/>
+ </xsl:variable>
+
+ <xsl:if test="$optimized">
+ opNameArray = {
+ <xsl:for-each select="optimizeContent/opName">
+ <xsl:if test="position()>1">,
+ </xsl:if>new javax.xml.namespace.QName("<xsl:value-of select="@ns-url"/>","<xsl:value-of select="@localName"/>")
+ </xsl:for-each>
+ };
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTConstants.java?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTConstants.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/XSLTConstants.java Thu Mar 9 01:04:26 2006
@@ -20,6 +20,7 @@
public interface XSLTConstants {
String BASE_64_PROPERTY_KEY = "base64map";
+ String PLAIN_BASE_64_PROPERTY_KEY = "plainbase64map";
String EXTERNAL_TEMPLATE_PROPERTY_KEY = "externalTemplate";
String XSLT_INCLUDE_DATABIND_SUPPORTER_HREF_KEY = "databindsupporter";
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/PolicyExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/PolicyExtension.java?rev=384466&r1=384465&r2=384466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/PolicyExtension.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/PolicyExtension.java Thu Mar 9 01:04:26 2006
@@ -16,6 +16,8 @@
package org.apache.axis2.modules;
+import javax.xml.namespace.QName;
+
import org.apache.ws.policy.Policy;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -25,6 +27,6 @@
* @author Sanka Samaranayake (sanka@apache.org)
*/
public interface PolicyExtension {
- public void addMethodsToStub(Document document, Element element, Policy policy);
+ public void addMethodsToStub(Document document, Element element, QName methodName,Policy policy);
}