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 ke...@apache.org on 2007/03/15 10:37:04 UTC

svn commit: r518547 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java template/java/InterfaceImplementationTemplate.xsl

Author: keithc
Date: Thu Mar 15 02:37:03 2007
New Revision: 518547

URL: http://svn.apache.org/viewvc?view=rev&rev=518547
Log:
Fixing template to handle httpLocation correctly.
Fixing doapversion in template to use http://www.w3.org/2003/05/soap-envelope for soap12

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=518547&r1=518546&r2=518547
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Thu Mar 15 02:37:03 2007
@@ -32,7 +32,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Policy;
-import org.apache.woden.internal.util.dom.DOM2Writer;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Document;
@@ -2001,8 +2000,6 @@
         addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(), methodElement);
         addAttribute(doc, "style", (String) getBindingPropertyFromOperation(
                 WSDLConstants.WSDL_1_1_STYLE, axisOperation.getName()), methodElement);
-        addAttribute(doc, "http_location", (String) getBindingPropertyFromOperation(
-                WSDL2Constants.ATTR_WHTTP_LOCATION, axisOperation.getName()), methodElement);
         addAttribute(doc, "dbsupportname",
                 endpointName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                 methodElement);
@@ -2063,6 +2060,15 @@
         if (property != null) {
             methodElement.appendChild(generateOptionParamComponent(doc,
                     "org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR",
+                    "\"" + property + "\""));
+        }
+
+        property = (String) getBindingPropertyFromOperation(
+                WSDL2Constants.ATTR_WHTTP_LOCATION,
+                axisOperation.getName());
+        if (property != null) {
+            methodElement.appendChild(generateOptionParamComponent(doc,
+                    "org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_LOCATION",
                     "\"" + property + "\""));
         }
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?view=diff&rev=518547&r1=518546&r2=518547
==============================================================================
--- 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 15 02:37:03 2007
@@ -136,7 +136,7 @@
 
         _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(
                 targetEndpoint));
-        <xsl:if test="starts-with($soapVersion,'http://schemas.xmlsoap.org/wsdl/soap12/')">
+        <xsl:if test="starts-with($soapVersion,'http://www.w3.org/2003/05/soap-envelope')">
             //Set the soap version
             _serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         </xsl:if>
@@ -271,20 +271,11 @@
                         ,<xsl:value-of select="@name"/>
                     </xsl:for-each>{
 
-              <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   // keep the old address to add later
-                   String oldAdress = null;
-              </xsl:if>
               try{
                org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
               _operationClient.getOptions().setAction("<xsl:value-of select="$soapAction"/>");
               _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
-              <!-- change the EPR if http location available -->
-              <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   oldAdress = 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"/>);
@@ -411,11 +402,6 @@
         //execute the operation client
         _operationClient.execute(true);
 
-        <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-           // set the old address again
-           setServiceClientEPR(oldAdress);
-        </xsl:if>
-
          <xsl:choose>
             <xsl:when test="$outputtype=''">
                 return;
@@ -454,10 +440,7 @@
             </xsl:otherwise>
         </xsl:choose>
          }catch(org.apache.axis2.AxisFault f){
-            <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-               // set the old address again
-               setServiceClientEPR(oldAdress);
-            </xsl:if>
+
             org.apache.axiom.om.OMElement faultElt = f.getDetail();
             if (faultElt!=null){
                 if (faultExeptionNameMap.containsKey(faultElt.getQName())){
@@ -548,20 +531,10 @@
 
                 throws java.rmi.RemoteException{
 
-              <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   // keep the old address to add later
-                   String oldAdress = null;
-              </xsl:if>
-
               org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
              _operationClient.getOptions().setAction("<xsl:value-of select="$soapAction"/>");
              _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
-             <!-- change the EPR if http location available -->
-              <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   oldAdress = 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"/>);
@@ -716,10 +689,6 @@
 
            //execute the operation client
            _operationClient.execute(false);
-            <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-               // set the old address again
-               setServiceClientEPR(oldAdress);
-            </xsl:if>
 
                     }
                 </xsl:if>
@@ -767,21 +736,11 @@
                 </xsl:if>
                 {
 
-                <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   // keep the old address to add later
-                   String oldAdress = null;
-              </xsl:if>
-
                 <xsl:if test="$mep='11'">try {</xsl:if>
                 org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
                 _operationClient.getOptions().setAction("<xsl:value-of select="$soapAction"/>");
                 _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
 
-                <!-- change the EPR if http location available -->
-               <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   oldAdress = 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"/>);
@@ -892,16 +851,8 @@
 
              _operationClient.execute(true);
 
-              <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-               // set the old address again
-               setServiceClientEPR(oldAdress);
-            </xsl:if>
            <xsl:if test="$mep='11'">
                }catch(org.apache.axis2.AxisFault f){
-                  <xsl:if test="string-length(normalize-space(@http_location)) > 0">
-                   // set the old address again
-                   setServiceClientEPR(oldAdress);
-                  </xsl:if>
                   org.apache.axiom.om.OMElement faultElt = f.getDetail();
                   if (faultElt!=null){
                       if (faultExeptionNameMap.containsKey(faultElt.getQName())){



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org