axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r441491 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/template/java/ kernel/src/org/apache/axis2/client/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/util/ kernel/src/org/apa...
Date Fri, 08 Sep 2006 13:25:36 GMT
Author: deepal
Date: Fri Sep  8 06:25:35 2006
New Revision: 441491

URL: http://svn.apache.org/viewvc?view=rev&rev=441491
Log:
fixing header addition using stubs
(stub._getServiceClient().addStringHeader(new QName("zaas","assa","assasa"),"header");)

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

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=441491&r1=441490&r2=441491
==============================================================================
--- 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
Fri Sep  8 06:25:35 2006
@@ -333,7 +333,8 @@
                             </xsl:choose>
                         </xsl:otherwise>
                     </xsl:choose>
-
+        //adding SOAP headers
+         _serviceClient.addHeadersToEnvelop(env);
         // create message context with that soap envelope
         org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext()
;
         _messageContext.setEnvelope(env);
@@ -531,7 +532,8 @@
                             </xsl:choose>
                         </xsl:otherwise>
                     </xsl:choose>
-
+        //adding SOAP headers
+         _serviceClient.addHeadersToEnvelop(env);
         // create message context with that soap envelope
         org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext()
;
         _messageContext.setEnvelope(env);
@@ -684,7 +686,8 @@
                                         </xsl:otherwise>
                                     </xsl:choose>
 
-
+              //adding SOAP headers
+         _serviceClient.addHeadersToEnvelop(env);
                 // create message context with that soap envelope
             org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext()
;
             _messageContext.setEnvelope(env);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?view=diff&rev=441491&r1=441490&r2=441491
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Fri Sep  8 06:25:35 2006
@@ -310,7 +310,8 @@
     }
 
     /**
-     * To remove all the headers in ServiceClient
+     * To remove all the
+     *  in ServiceClient
      */
     public void removeHeaders() {
         if (headers != null) {
@@ -418,7 +419,7 @@
             }
         } else {
             MessageContext mc = new MessageContext();
-            fillSoapEnvelope(mc, elem);
+            fillSOAPEnvelope(mc, elem);
             OperationClient mepClient = createClient(operation);
             mepClient.addMessageContext(mc);
             mepClient.execute(true);
@@ -455,7 +456,7 @@
         // create a message context and put the payload in there along with any
         // headers
         MessageContext mc = new MessageContext();
-        fillSoapEnvelope(mc, elem);
+        fillSOAPEnvelope(mc, elem);
         // add the message context there and have it go
         mepClient.addMessageContext(mc);
         mepClient.execute(false);
@@ -517,8 +518,8 @@
             // process the result of the invocation
             if (callback.envelope != null) {
                 // transport was already returned by the call back receiver
-            	//Buidling of the Envelope should happen at the setComplete()
-            	// or onComplete() methods of the Callback class
+                //Buidling of the Envelope should happen at the setComplete()
+                // or onComplete() methods of the Callback class
                 return callback.envelope.getBody().getFirstElement();
             } else {
                 if (callback.error instanceof AxisFault) {
@@ -532,7 +533,7 @@
             }
         } else {
             MessageContext mc = new MessageContext();
-            fillSoapEnvelope(mc, elem);
+            fillSOAPEnvelope(mc, elem);
             OperationClient mepClient = createClient(operation);
             mepClient.addMessageContext(mc);
             mepClient.execute(true);
@@ -566,7 +567,7 @@
     public void sendReceiveNonBlocking(QName operation, OMElement elem,
                                        Callback callback) throws AxisFault {
         MessageContext mc = new MessageContext();
-        fillSoapEnvelope(mc, elem);
+        fillSOAPEnvelope(mc, elem);
         OperationClient mepClient = createClient(operation);
         // here a blocking invocation happens in a new thread, so the
         // progamming model is non blocking
@@ -647,7 +648,7 @@
      * @param elem the payload content
      * @throws AxisFault if something goes wrong
      */
-    private void fillSoapEnvelope(MessageContext mc, OMElement elem)
+    private void fillSOAPEnvelope(MessageContext mc, OMElement elem)
             throws AxisFault {
         mc.setServiceContext(serviceContext);
         SOAPFactory soapFactory = getSOAPFactory();
@@ -655,13 +656,18 @@
         if (elem != null) {
             envelope.getBody().addChild(elem);
         }
+        addHeadersToEnvelop(envelope);
+        mc.setEnvelope(envelope);
+    }
+
+
+    public void addHeadersToEnvelop(SOAPEnvelope envelope) {
         if (headers != null) {
             SOAPHeader sh = envelope.getHeader();
             for (int i = 0; i < headers.size(); i++) {
                 sh.addChild((OMElement) headers.get(i));
             }
         }
-        mc.setEnvelope(envelope);
     }
 
 
@@ -703,12 +709,12 @@
         private Exception error;
 
         public void onComplete(AsyncResult result) {
-			this.envelope = result.getResponseEnvelope();
-			// Transport input stream gets closed after calling setComplete
-			// method. Have to build the whole envelope including the
-			// attachments at this stage. Data might get lost if the input
-			// stream gets closed before building the whole envelope.
-			this.envelope.buildWithAttachments();
+            this.envelope = result.getResponseEnvelope();
+            // Transport input stream gets closed after calling setComplete
+            // method. Have to build the whole envelope including the
+            // attachments at this stage. Data might get lost if the input
+            // stream gets closed before building the whole envelope.
+            this.envelope.buildWithAttachments();
             this.msgctx = result.getResponseMessageContext();
         }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=441491&r1=441490&r2=441491
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
Fri Sep  8 06:25:35 2006
@@ -533,7 +533,6 @@
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
                                         currentArchiveFile.getName()));
                             } catch (DeploymentException de) {
-                                de.printStackTrace();
                                 log.error(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
                                         currentArchiveFile.getName(),
                                         de.getMessage()),

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=441491&r1=441490&r2=441491
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
Fri Sep  8 06:25:35 2006
@@ -13,14 +13,13 @@
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.DependencyManager;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.ws.commons.schema.utils.NamespaceMap;
 import org.apache.ws.java2wsdl.Java2WSDLConstants;
 import org.apache.ws.java2wsdl.SchemaGenerator;
 import org.apache.ws.java2wsdl.utils.TypeTable;
-import org.apache.ws.commons.schema.utils.NamespaceMap;
 import org.codehaus.jam.JMethod;
 
 import javax.xml.namespace.QName;
@@ -212,7 +211,8 @@
      * This guy will create a AxisService using java reflection
      */
     public static void fillAxisService(AxisService axisService,
-                                       AxisConfiguration axisConfig, ArrayList excludeOperations)
throws Exception {
+                                       AxisConfiguration axisConfig,
+                                       ArrayList excludeOperations) throws Exception {
         String serviceClass;
         Parameter implInfoParam = axisService.getParameter(Constants.SERVICE_CLASS);
         ClassLoader serviceClassLoader = axisService.getClassLoader();
@@ -274,10 +274,9 @@
                 // no need to expose , private and protected methods
                 continue;
             }
-            if (jmethod.getSimpleName().equals("init")
-                    || DependencyManager.MESSAGE_CONTEXT_INJECTION_METHOD.equals(jmethod.getSimpleName())
-                    || DependencyManager.SERVICE_DESTROY_METHOD.equals(jmethod.getSimpleName()))
+            if (excludeOperations.contains(jmethod.getSimpleName())) {
                 continue;
+            }
             String opName = jmethod.getSimpleName();
             AxisOperation operation = axisService.getOperation(new QName(opName));
             // if the opeartion there in services.xml then try to set it schema element name

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=441491&r1=441490&r2=441491
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Fri Sep  8 06:25:35 2006
@@ -1246,6 +1246,16 @@
         ClassLoader serviceClassLoader = axisService.getClassLoader();
         SchemaGenerator schemaGenerator;
         ArrayList excludeOpeartion = new ArrayList();
+
+
+        NamespaceMap map = new NamespaceMap();
+        map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
+                Java2WSDLConstants.AXIS2_XSD);
+        map.put(Java2WSDLConstants.DEFAULT_SCHEMA_NAMESPACE_PREFIX,
+                Java2WSDLConstants.URI_2001_SCHEMA_XSD);
+        axisService.setNameSpacesMap(map);
+
+
         try {
             schemaGenerator = new SchemaGenerator(serviceClassLoader,
                     implClass, schemaNameSpace,



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


Mime
View raw message