axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r392568 - in /webservices/axis2/trunk/java/modules/samples/src: sample/mtom/imagetransfer/service/ sample/mtom/imagetransfer/service/META-INF/ sample/sgccalculator/ userguide/example1/META-INF/
Date Sat, 08 Apr 2006 18:20:12 GMT
Author: deepal
Date: Sat Apr  8 11:20:10 2006
New Revision: 392568

URL: http://svn.apache.org/viewcvs?rev=392568&view=rev
Log:
- fixing sample

Modified:
    webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/META-INF/services.xml
    webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/MTOMService.java
    webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/AddService.java
    webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/MultiplyService.java
    webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/SubstractService.java
    webservices/axis2/trunk/java/modules/samples/src/userguide/example1/META-INF/services.xml

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/META-INF/services.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/META-INF/services.xml?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/META-INF/services.xml
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/META-INF/services.xml
Sat Apr  8 11:20:10 2006
@@ -4,6 +4,7 @@
     </description>
     <parameter name="ServiceClass" locked="false">sample.mtom.imagetransfer.service.MTOMService</parameter>
     <operation name="mtomSample">
+        <actionMapping>urn:mtomSample</actionMapping>
         <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
     </operation>
 </service>

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/MTOMService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/MTOMService.java?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/MTOMService.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/service/MTOMService.java
Sat Apr  8 11:20:10 2006
@@ -28,6 +28,7 @@
 import java.io.FileOutputStream;
 
 public class MTOMService {
+    
     public OMElement mtomSample(OMElement element) throws Exception {
     	
         OMElement imageEle = element.getFirstElement();

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/AddService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/AddService.java?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/AddService.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/AddService.java
Sat Apr  8 11:20:10 2006
@@ -19,82 +19,85 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.wsdl.WSDLConstants;
 
 import java.util.Iterator;
 
 public class AddService {
 
-	MessageContext msgContext = null;
-	
-	public void init (MessageContext msgContext) {
-		this.msgContext = msgContext;
-	}
-	
-	public OMElement add (OMElement elem) {		
-		Iterator iter = elem.getChildElements();
-		String param1Str = ((OMElement) iter.next()).getText();
-		String param2Str = ((OMElement) iter.next()).getText();
-		
-		int param1 = Integer.parseInt(param1Str);
-		int param2 = Integer.parseInt(param2Str);
-		int result = param1 + param2;
-		
-		if (msgContext!=null)
-			System.out.println ("ServiceGroupContextID:" + msgContext.getServiceGroupContextId());
-		else
-			System.out.println ("Message Context is null");
-		
-		OMFactory fac = OMAbstractFactory.getOMFactory();
-		OMNamespace namespace = fac.createOMNamespace("http://axis2/test/namespace1","ns1");
-		
-		OMElement resultElem = fac.createOMElement("result",namespace);
-		resultElem.setText(Integer.toString(result ));
-		
-		msgContext.getServiceGroupContext().setProperty(Constants.CALCULATOR_PREVIOUS_KEY,Integer.toString(result));
-		return resultElem;
-	}
-	
-	public OMElement addPrevious (OMElement elem) {
-		Iterator iter = elem.getChildElements();
-		String paramStr = ((OMElement) iter.next()).getText();
-		
-		int param = Integer.parseInt(paramStr);
-
-		if (msgContext==null){
-			System.out.println ("message context is null");
-			return null;
-		}
-		
-		ServiceGroupContext sgc = msgContext.getServiceGroupContext();
-		if (sgc==null){
-			System.out.println ("message context is null");
-			return null;
-		}
-		
-		String previousStr = (String) sgc.getProperty(Constants.CALCULATOR_PREVIOUS_KEY);
-		if (previousStr==null) {
-			System.out.println ("Previous is null");
-			return null;
-		}
-		
-		int previous = Integer.parseInt(previousStr);
-		
-		int result = previous + param;
-		
-		if (msgContext!=null)
-			System.out.println ("ServiceGroupContextID:" + msgContext.getServiceGroupContextId());
-		else
-			System.out.println ("Message Context is null");
-		
-		OMFactory fac = OMAbstractFactory.getOMFactory();
-		OMNamespace namespace = fac.createOMNamespace("http://axis2/test/namespace1","ns1");
-		
-		OMElement resultElem = fac.createOMElement("result",namespace);
-		resultElem.setText(Integer.toString(result ));
-		
-		msgContext.getServiceGroupContext().setProperty(Constants.CALCULATOR_PREVIOUS_KEY,Integer.toString(result));
-		return resultElem;
-	}
+    MessageContext msgContext = null;
+
+    public void setOperationContext(OperationContext opContext) throws AxisFault {
+        this.msgContext = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+    }
+
+    public OMElement add(OMElement elem) {
+        Iterator iter = elem.getChildElements();
+        String param1Str = ((OMElement) iter.next()).getText();
+        String param2Str = ((OMElement) iter.next()).getText();
+
+        int param1 = Integer.parseInt(param1Str);
+        int param2 = Integer.parseInt(param2Str);
+        int result = param1 + param2;
+
+        if (msgContext != null)
+            System.out.println("ServiceGroupContextID:" + msgContext.getServiceGroupContextId());
+        else
+            System.out.println("Message Context is null");
+
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace namespace = fac.createOMNamespace("http://axis2/test/namespace1", "ns1");
+
+        OMElement resultElem = fac.createOMElement("result", namespace);
+        resultElem.setText(Integer.toString(result));
+
+        msgContext.getServiceGroupContext().setProperty(Constants.CALCULATOR_PREVIOUS_KEY,
Integer.toString(result));
+        return resultElem;
+    }
+
+    public OMElement addPrevious(OMElement elem) {
+        Iterator iter = elem.getChildElements();
+        String paramStr = ((OMElement) iter.next()).getText();
+
+        int param = Integer.parseInt(paramStr);
+
+        if (msgContext == null) {
+            System.out.println("message context is null");
+            return null;
+        }
+
+        ServiceGroupContext sgc = msgContext.getServiceGroupContext();
+        if (sgc == null) {
+            System.out.println("message context is null");
+            return null;
+        }
+
+        String previousStr = (String) sgc.getProperty(Constants.CALCULATOR_PREVIOUS_KEY);
+        if (previousStr == null) {
+            System.out.println("Previous is null");
+            return null;
+        }
+
+        int previous = Integer.parseInt(previousStr);
+
+        int result = previous + param;
+
+        if (msgContext != null)
+            System.out.println("ServiceGroupContextID:" + msgContext.getServiceGroupContextId());
+        else
+            System.out.println("Message Context is null");
+
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace namespace = fac.createOMNamespace("http://axis2/test/namespace1", "ns1");
+
+        OMElement resultElem = fac.createOMElement("result", namespace);
+        resultElem.setText(Integer.toString(result));
+
+        msgContext.getServiceGroupContext().setProperty(Constants.CALCULATOR_PREVIOUS_KEY,
Integer.toString(result));
+        return resultElem;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/MultiplyService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/MultiplyService.java?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/MultiplyService.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/MultiplyService.java
Sat Apr  8 11:20:10 2006
@@ -21,6 +21,9 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.wsdl.WSDLConstants;
 
 import java.util.Iterator;
 
@@ -28,9 +31,9 @@
 
 	MessageContext msgContext = null;
 	
-	public void init (MessageContext msgContext) {
-		this.msgContext = msgContext;
-	}
+	public void setOperationContext(OperationContext opContext) throws AxisFault {
+        this.msgContext = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+    }
 	
 	public OMElement multiply (OMElement elem) {
 		Iterator iter = elem.getChildElements();

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/SubstractService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/SubstractService.java?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/SubstractService.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/sgccalculator/SubstractService.java
Sat Apr  8 11:20:10 2006
@@ -21,6 +21,9 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.wsdl.WSDLConstants;
 
 import java.util.Iterator;
 
@@ -28,9 +31,9 @@
 
 	MessageContext msgContext = null;
 	
-	public void init (MessageContext msgContext) {
-		this.msgContext = msgContext;
-	}
+	public void setOperationContext(OperationContext opContext) throws AxisFault {
+        this.msgContext = opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+    }
 	
 	public OMElement substract (OMElement elem){
 		Iterator iter = elem.getChildElements();

Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/example1/META-INF/services.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/example1/META-INF/services.xml?rev=392568&r1=392567&r2=392568&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/example1/META-INF/services.xml
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/example1/META-INF/services.xml
Sat Apr  8 11:20:10 2006
@@ -5,8 +5,10 @@
     <parameter name="ServiceClass" locked="false">userguide.example1.MyService</parameter>
     <operation name="echo">
         <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <actionMapping>urn:echo</actionMapping>
     </operation>
     <operation name="ping">
         <messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <actionMapping>urn:ping</actionMapping>
     </operation>
 </service>



Mime
View raw message