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 de...@apache.org on 2007/07/12 12:49:52 UTC

svn commit: r555579 - in /webservices/axis2/trunk/java/modules/samples: databinding/README.txt databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java mtom/README.txt mtom/build.xml

Author: deepal
Date: Thu Jul 12 03:49:45 2007
New Revision: 555579

URL: http://svn.apache.org/viewvc?view=rev&rev=555579
Log:
fixed AXIS2-2910
- Suran thx for the patch 

Modified:
    webservices/axis2/trunk/java/modules/samples/databinding/README.txt
    webservices/axis2/trunk/java/modules/samples/databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java
    webservices/axis2/trunk/java/modules/samples/mtom/README.txt
    webservices/axis2/trunk/java/modules/samples/mtom/build.xml

Modified: webservices/axis2/trunk/java/modules/samples/databinding/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/databinding/README.txt?view=diff&rev=555579&r1=555578&r2=555579
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/databinding/README.txt (original)
+++ webservices/axis2/trunk/java/modules/samples/databinding/README.txt Thu Jul 12 03:49:45 2007
@@ -1,4 +1,4 @@
-Sample: Data Binding
+3Sample: Data Binding
 ====================
 
 Introduction
@@ -16,8 +16,9 @@
  * Download latest stax-utils jar from
    https://stax-utils.dev.java.net/servlets/ProjectDocumentList?folderID=1106 and drop that into the
    new lib directory.
- * Download latest Castor jar from http://www.castor.org/download.html and drop that into the new
-   lib directory
+ * Download version 1.0.4 of Castor jar from http://dist.codehaus.org/castor/1.0.4/castor-1.0.4.jar and drop that into the new
+   lib directory.(The latest releases of castor are available at http://www.castor.org/download.html, but this example may not run 	
+   with versions later than 1.0.4)
 
 You can achieve all three of the above steps by running "ant download.jars", but it will take some 
 time to download those two jars, using ant.
@@ -31,14 +32,14 @@
 inside Axis2_HOME/samples/databinding and put it under Axis2_HOME/repository/services.
 
 You need to then startup the server to deploy the service. Go to Axis2_HOME/bin folder and execute either
-axis2server.bat or axis2server.sh, depending on your platform.
+axis2server.bat (in Windows) or axis2server.sh(in Linux), depending on your platform.
 
 
 Running the Client
 ==================
 
-Running the run.client runs the client/src/samples/databinding/StockClient.java class. You may use
-the command scripts to do so. You need to supply 2 parameters to the command- url and symbol.
+Typing the command "ant run.client" inside Axis2_HOME/samples/databinding runs the Axis2_HOME/samples/databinding/client/src/samples/databinding/StockClient.java class. You may use
+the command scripts (as specified above) to do so. You need to supply 2 parameters to the command- url and symbol.
 
  * ant run.client -Durl=http://localhost:8080/axis2/services/StockQuoteService -Dsymbol=IBM
    Succeeds with a Price of 99.0. You will see "Price = 99.0"
@@ -59,6 +60,12 @@
 - Get StAX events from the castor objects and construct OMElements from them. Those StAX events
   are fed into StAXOMBuilder which can create OM tree from it.
 - Feed those OMElement in to generated code.
+
+Note
+==============
+Sometimes, if you're having trouble running the client successfully, 
+It may be necessary to clean the services repository before you generate the service, deploy it
+and run the client. (i.e. delete services created from previous samples.)
 
 Help
 ====

Modified: webservices/axis2/trunk/java/modules/samples/databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java?view=diff&rev=555579&r1=555578&r2=555579
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java (original)
+++ webservices/axis2/trunk/java/modules/samples/databinding/service/src/samples/databinding/StockQuoteServiceSkeleton.java Thu Jul 12 03:49:45 2007
@@ -26,6 +26,7 @@
 package samples.databinding;
 import javanet.staxutils.StAXSource;
 import org.apache.axiom.om.impl.builder.SAXOMBuilder;
+import org.apache.axis2.AxisFault;
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.UnmarshalHandler;
@@ -53,7 +54,7 @@
      *
      * @param param0
      */
-    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) {
+    public org.apache.axiom.om.OMElement getStockQuote(org.apache.axiom.om.OMElement param0) throws AxisFault {
         StAXSource staxSource =
                 new StAXSource(param0.getXMLStreamReader());
         Unmarshaller unmarshaller = new Unmarshaller(GetStockQuote.class);
@@ -68,6 +69,10 @@
         } catch (TransformerException e) {
             throw new RuntimeException(e);
         }
+        
+        if (!stockQuote.getSymbol().equals("IBM")) {
+			throw new AxisFault("StockQuote details for the symbol '"+ stockQuote.getSymbol() + "' are not available.");
+        }
         GetStockQuoteResponse stockQuoteResponse = new GetStockQuoteResponse();
         Quote quote = new Quote();
         quote.setSymbol(stockQuote.getSymbol());
@@ -98,4 +103,4 @@
         return builder.getRootElement();
     }
 }
-    
\ No newline at end of file
+    

Modified: webservices/axis2/trunk/java/modules/samples/mtom/README.txt
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/mtom/README.txt?view=diff&rev=555579&r1=555578&r2=555579
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/mtom/README.txt (original)
+++ webservices/axis2/trunk/java/modules/samples/mtom/README.txt Thu Jul 12 03:49:45 2007
@@ -15,12 +15,18 @@
 Running the Sample:
 ===================
 1. Use ant generate.service or just the ant command alone in the Axis2_HOME/sample/mtom/ to build the service.
-2. Generated service gets copied to the Axis2_HOME/repository/services automatically.
-3. Run the Axis2_HOME/bin/axis2server.{sh.bat} to start the standalone axis2 server. (Alternatively
+2. Generated service gets copied to the AXIS2_HOME/repository/services automatically.
+3. Run the AXIS2_HOME/bin/axis2server.{sh/bat} to start the standalone axis2 server. (Alternatively
   you can drop the sample into the services directory of a Axis2 server running in a servlet container)
 4. Use ant generate.client to build the client.
 5. Use ant run.client -Dfile "file to be sent" -Ddest "destination file name" to run the client.
 
+
+Note
+==============
+Sometimes, if you're having trouble running the client successfully, 
+It may be necessary to clean the services repository before you generate the service, deploy it
+and run the client. (i.e. delete services created from previous samples.)
 
 Help
 ====

Modified: webservices/axis2/trunk/java/modules/samples/mtom/build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/mtom/build.xml?view=diff&rev=555579&r1=555578&r2=555579
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/mtom/build.xml (original)
+++ webservices/axis2/trunk/java/modules/samples/mtom/build.xml Thu Jul 12 03:49:45 2007
@@ -65,7 +65,7 @@
 	</target>
 
 	<target name="print-usage" unless="parameters.set">
-		<echo message="ant -Dfile &lt;file to be transferred&gt;  -Ddest &lt;name of the destination file&gt;" />
+		<echo message="ant run.client -Dfile &lt;file to be transferred&gt;  -Ddest &lt;name of the destination file&gt;" />
 	</target>
 
 	<!-- Generate Client -->



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