~ubuntu-branches/ubuntu/maverick/axis/maverick

« back to all changes in this revision

Viewing changes to debian/patches/patches/03axis-objectweb.patch

  • Committer: Bazaar Package Importer
  • Author(s): Vladimír Lapáček
  • Date: 2006-09-06 22:31:39 UTC
  • Revision ID: james.westby@ubuntu.com-20060906223139-f1o80297h5a5aan4
Tags: 1.4-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- axis-1_2/src/org/apache/axis/handlers/ServiceInvocation.java        1970-01-01 01:00:00.000000000 +0100
 
2
+++ jonas-axis/src/org/apache/axis/handlers/ServiceInvocation.java      2005-01-25 15:02:00.000000000 +0000
 
3
@@ -0,0 +1,111 @@
 
4
+
 
5
+package org.apache.axis.handlers;
 
6
+
 
7
+import java.util.Iterator;
 
8
+
 
9
+import javax.xml.soap.SOAPBody;
 
10
+import javax.xml.soap.SOAPElement;
 
11
+import javax.xml.soap.SOAPEnvelope;
 
12
+import javax.xml.soap.SOAPException;
 
13
+import javax.xml.soap.SOAPMessage;
 
14
+
 
15
+import org.apache.axis.MessageContext;
 
16
+
 
17
+
 
18
+
 
19
+/**
 
20
+ * Keep here the invocation info:
 
21
+ * operation + arguments.
 
22
+ * TODO This class should be in the jonas code.
 
23
+ * @author Ph Durieux
 
24
+ */
 
25
+public class ServiceInvocation {
 
26
+
 
27
+    /**
 
28
+     * @return Returns the argNames.
 
29
+     */
 
30
+    public String getArgNames() {
 
31
+        return argNames;
 
32
+    }
 
33
+    /**
 
34
+     * @param argNames The argNames to set.
 
35
+     */
 
36
+    public void setArgNames(String argNames) {
 
37
+        this.argNames = argNames;
 
38
+    }
 
39
+    /**
 
40
+     * @return Returns the methodName.
 
41
+     */
 
42
+    public String getMethodName() {
 
43
+        return methodName;
 
44
+    }
 
45
+    /**
 
46
+     * @param methodName The methodName to set.
 
47
+     */
 
48
+    public void setMethodName(String methodName) {
 
49
+        this.methodName = methodName;
 
50
+    }
 
51
+    /**
 
52
+     * @return Returns the numArgs.
 
53
+     */
 
54
+    public int getNumArgs() {
 
55
+        return numArgs;
 
56
+    }
 
57
+    /**
 
58
+     * @param numArgs The numArgs to set.
 
59
+     */
 
60
+    public void setNumArgs(int numArgs) {
 
61
+        this.numArgs = numArgs;
 
62
+    }
 
63
+    private String methodName = "";
 
64
+    private String argNames = "";
 
65
+    private int numArgs = -1;
 
66
+    
 
67
+    public ServiceInvocation(MessageContext msgContext) {
 
68
+
 
69
+        SOAPMessage  reqMsg  = msgContext.getMessage();
 
70
+        SOAPEnvelope reqEnv;
 
71
+        try {
 
72
+            reqEnv = reqMsg.getSOAPPart().getEnvelope();
 
73
+        } catch (SOAPException e1) {
 
74
+            e1.printStackTrace();
 
75
+            return;
 
76
+        }
 
77
+        SOAPBody body;
 
78
+        try {
 
79
+            body = reqEnv.getBody();
 
80
+        } catch (SOAPException e) {
 
81
+            e.printStackTrace();
 
82
+            return;
 
83
+        }
 
84
+        if (body == null) {
 
85
+            return;
 
86
+        }
 
87
+        Iterator it = body.getChildElements();
 
88
+        SOAPElement operation = (SOAPElement) it.next();
 
89
+        methodName = operation.getNodeName();
 
90
+        numArgs = 0;
 
91
+        for (Iterator i = operation.getChildElements(); i.hasNext();) {
 
92
+            SOAPElement elt = (SOAPElement) i.next();
 
93
+            numArgs++;
 
94
+            argNames += elt.getNodeName();
 
95
+        }
 
96
+    }
 
97
+
 
98
+    public boolean equals(Object obj) {
 
99
+       if (obj == null) {
 
100
+           return false;
 
101
+       }
 
102
+       return toString().equals(obj.toString());
 
103
+    }
 
104
+
 
105
+    public int hashCode() {
 
106
+       return numArgs;
 
107
+    }
 
108
+
 
109
+    public String toString() {
 
110
+       return "[method=" + methodName + ",Args=" + argNames + "]";
 
111
+    }
 
112
+
 
113
+}
 
114
+