Author: asankha
Date: Mon Jul 31 03:39:16 2006
New Revision: 427065

URL: http://svn.apache.org/viewvc?rev=427065&view=rev
Log:
Fix samples to run against a copy of the SimpleStockQuote service deployed on 
an Axis2 or compatible server on localhost:9000

Added:
    
incubator/synapse/trunk/java/modules/samples/src/samples/common/StockQuoteHandler.java
      - copied, changed from r427012, 
incubator/synapse/trunk/java/modules/samples/src/samples/common/InvesbotHandler.java
    
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DirectStockQuoteClient.java
Removed:
    
incubator/synapse/trunk/java/modules/samples/src/samples/common/InvesbotHandler.java
Modified:
    incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml
    
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetQuoteResponse.java
    
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
    incubator/synapse/trunk/java/modules/samples/src/samples/common/Util.java
    
incubator/synapse/trunk/java/modules/samples/src/samples/proxy/ProxyStockQuoteClient.java
    
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
    
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
    
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
    incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml
    incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_1.xml
    incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml
    incubator/synapse/trunk/java/repository/conf/sample/transform.xslt
    incubator/synapse/trunk/java/repository/conf/sample/transform_back.xslt
    incubator/synapse/trunk/java/repository/conf/synapse.xml

Modified: 
incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml 
(original)
+++ incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml 
Mon Jul 31 03:39:16 2006
@@ -9,60 +9,70 @@
     ant help 
                display this message
     ant clean 
-               delete the built directory
-
+               delete the build directory
     ant compile 
                build the samples
 
-       These samples make stockquote requests to ws.invesbot.com mediated 
through Synapse
+       These samples make stockquote requests to the sample services through 
Synapse
 
        ant stockquote
                Use the smart client - Synapse in WS-Addressing router mode
+               Use default sample configuration (i.e. start with -sample 0)
     
          examples:
          ant stockquote
-         ant stockquote [-Dsymbol=IBM] 
[-Durl=http://ws.invesbot.com/stockquotes.asmx]
+         ant stockquote [-Dsymbol=IBM] 
+               
[-Durl=http://localhost:9000/axis2/services/SimpleStockQuoteService]
                [-Dsynapseurl=http://localhost:8080] [-Drepository=client_repo]
        
        ant proxystockquote
-           Use the http proxy client - Synapse in "transparent mode" using 
HTTP proxy
+           Use the http proxy client - Synapse in "transparent mode" as an 
HTTP proxy
+           Use default sample configuration (i.e. start with -sample 0)
     
                examples:
          ant proxystockquote
-         ant proxystockquote [-Dsymbol=IBM] 
[-Durl=http://ws.invesbot.com/stockquotes.asmx]
+         ant proxystockquote [-Dsymbol=IBM] 
+               
[-Durl=http://localhost:9000/axis2/services/SimpleStockQuoteService]
                [-Dsynapseurl=http://localhost:8080]
 
     ant dumbstockquote 
-      Use the dumb soap client - Synapse in "gateway" mode, and transport set 
to virtual
-      url interpreted by Synapse
+      Use the dumb soap client - Synapse in "gateway" mode; transport set to 
virtual
+      url which is interpreted by Synapse
+      Use default sample configuration (i.e. start with -sample 0)
   
                examples:
                ant dumbstockquote 
            ant dumbstockquote [-Dsymbol=IBM] 
[-Dgatewayurl=http://localhost:8080/StockQuote]
 
     ant customquote 
-      Use custom stock quote request and transform (XSLT) between schemas
+      Use a custom stock quote request and response format, and transform 
(XSLT) between
+      Use sample configuration #1 (i.e. start with -sample 1)
   
                examples:
                ant customquote 
-           ant customquote [-Dsymbol=IBM] 
[-Durl=http://ws.invesbot.com/stockquotes.asmx] 
+           ant customquote [-Dsymbol=IBM] 
+               
[-Durl=http://localhost:9000/axis2/services/SimpleStockQuoteService]
                [-Dsynapseurl=http://localhost:8080]
 
     ant advancedquote 
-      Use validating custom quote requests, and also validate against XSD
+      Validate custom quote requests against a schema before sending out
+      Use sample configuration #2 (i.e. start with -sample 2)
   
                examples:
                ant advancedquote 
-           ant advancedquote [-Durl=http://ws.invesbot.com/stockquotes.asmx] 
+           ant advancedquote 
+               
[-Durl=http://localhost:9000/axis2/services/SimpleStockQuoteService]
                [-Dsynapseurl=http://localhost:8080]
 
     ant simplequote 
-      Use a simple quote using WS-A addressing to demonstrate the Custom 
server (programmatic configuration creation)
+      Use a simple quote using addressing to demonstrate the custom server 
+      configuration created programmatically
+      Use sample configuration created programmatically (i.e. start using 
custom.bat/sh)
   
                examples:
                ant simplequote 
            ant simplequote [-Dsymbol=IBM] 
-               [-Durl=http://ws.invesbot.com/stockquotes.asmx] 
+               
[-Durl=http://localhost:9000/axis2/services/SimpleStockQuoteService]
                [-Dsynapseurl=http://localhost:8080] [-Drepository=client_repo]
 
        ant proxyquote
@@ -71,20 +81,20 @@
                examples:
          ant proxyquote
          ant proxyquote -Dsymbol=IBM 
-               
-DfwdProxy=http://localhost:8080/axis2/services/InvesbotForwardProxy 
-               
-DdefProxy=http://localhost:8080/axis2/services/InvesbotDefaultProxy 
-               
-DseqProxy=http://localhost:8080/axis2/services/InvesbotSequenceProxy";
+               
-DfwdProxy=http://localhost:8080/axis2/services/StockQuoteForwardProxy 
+               
-DdefProxy=http://localhost:8080/axis2/services/StockQuoteDefaultProxy 
+               
-DseqProxy=http://localhost:8080/axis2/services/StockQuoteSequenceProxy";
         </echo>
     </target>
 
                <property name="symbol" value="IBM"/>
-    <property name="url" value="http://ws.invesbot.com/stockquotes.asmx"/>
+    <property name="url" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
     <property name="synapseurl" value="http://localhost:8080"/>
     <property name="gatewayurl" value="http://localhost:8080/StockQuote"/>
     <property name="repository" value="client_repo"/>
-    <property name="fwdProxy" 
value="http://localhost:8080/axis2/services/InvesbotForwardProxy"/>
-    <property name="defProxy" 
value="http://localhost:8080/axis2/services/InvesbotDefaultProxy"/>
-    <property name="seqProxy" 
value="http://localhost:8080/axis2/services/InvesbotSequenceProxy"/>
+    <property name="fwdProxy" 
value="http://localhost:8080/axis2/services/StockQuoteForwardProxy"/>
+    <property name="defProxy" 
value="http://localhost:8080/axis2/services/StockQuoteDefaultProxy"/>
+    <property name="seqProxy" 
value="http://localhost:8080/axis2/services/StockQuoteSequenceProxy"/>
 
     <property name="class.dir" value="target/classes"/>
 
@@ -144,7 +154,7 @@
     </target>
 
     <target name="simplequote" depends="compile">        
-        <java classname="samples.config.SimpleStockQuoteClient"
+        <java classname="samples.userguide.StockQuoteClient"
               classpathref="javac.classpath" fork="true">
                <arg value="${symbol}"/>
             <arg value="${url}"/>

Modified: 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetQuoteResponse.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetQuoteResponse.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetQuoteResponse.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetQuoteResponse.java
 Mon Jul 31 03:39:16 2006
@@ -44,7 +44,7 @@
         this.open = getRandom(last, 0.05, false);
         this.high = getRandom(last, 0.05, false);
         this.low = getRandom(last, 0.05, false);
-        this.volume = (int) getRandom(10000, 1.0, false);
+        this.volume = (int) getRandom(10000, 1.0, true);
         this.marketCap = getRandom(10E6, 5.0, false);
         this.prevClose = getRandom(last, 0.15, false);
         this.percentageChange = change / prevClose * 100;

Modified: 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
 Mon Jul 31 03:39:16 2006
@@ -18,6 +18,7 @@
 public class SimpleStockQuoteService {
 
     public GetQuoteResponse getQuote(GetQuote request) {
+        System.out.println("Generating quote for : " + request.getSymbol());
         return new GetQuoteResponse(request.getSymbol());
     }
 }

Copied: 
incubator/synapse/trunk/java/modules/samples/src/samples/common/StockQuoteHandler.java
 (from r427012, 
incubator/synapse/trunk/java/modules/samples/src/samples/common/InvesbotHandler.java)
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/common/StockQuoteHandler.java?p2=incubator/synapse/trunk/java/modules/samples/src/samples/common/StockQuoteHandler.java&p1=incubator/synapse/trunk/java/modules/samples/src/samples/common/InvesbotHandler.java&r1=427012&r2=427065&rev=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/common/InvesbotHandler.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/common/StockQuoteHandler.java
 Mon Jul 31 03:39:16 2006
@@ -23,10 +23,9 @@
 import javax.xml.namespace.QName;
 
 /**
- * A class that can create messages to, and parse replies from the
- * invesbot stock quote service at http://ws.invesbot.com/stockquotes.asmx
+ * A class that can create messages to, and parse replies from our sample 
StockQuote service
  */
-public class InvesbotHandler {
+public class StockQuoteHandler {
     /**
      * Create a new custom stock quote request with a body as follows
      * <m0:CheckPriceRequest xmlns:m0="http://www.apache-synapse.org/test";>
@@ -67,18 +66,22 @@
 
     /**
      * Create a new custom stock quote request with a body as follows
-     *  <m:GetQuote xmlns:m="http://ws.invesbot.com/";>
-     *      <m:symbol>IBM</m:symbol>
+     *  <m:GetQuote xmlns:m="http://services.samples/xsd";>
+     *      <m:request>
+     *          <m:symbol>IBM</m:symbol>
+     *      </m:request>
      *  </m:GetQuote>
      * @param symbol the stock symbol
      * @return OMElement for SOAP body
      */
     public static OMElement createStandardRequestPayload(String symbol) {
         OMFactory factory   = OMAbstractFactory.getOMFactory();
-        OMNamespace ns      = 
factory.createOMNamespace("http://ws.invesbot.com/";, "m0");
-        OMElement getQuote  = factory.createOMElement("GetQuote", ns);
+        OMNamespace ns      = 
factory.createOMNamespace("http://services.samples/xsd";, "m0");
+        OMElement getQuote  = factory.createOMElement("getQuote", ns);
+        OMElement request   = factory.createOMElement("request", ns);
         OMElement symb      = factory.createOMElement("symbol", ns);
-        getQuote.addChild(symb);
+        request.addChild(symb);
+        getQuote.addChild(request);
         symb.setText(symbol);
         return getQuote;
     }
@@ -89,25 +92,21 @@
      * @return
      * @throws javax.xml.stream.XMLStreamException
      *
-     *  <GetQuoteResponse xmlns="http://ws.invesbot.com/";>
-     *      <GetQuoteResult>
-     *          <StockQuote xmlns="">
-     *              <Symbol>IBM</Symbol>
-     *              ...
-     *              <Price>82.47</Price>
-     *              .......
-     *          </StockQuote>
-     *      </GetQuoteResult>
-     *  </GetQuoteResponse>
+     *  <ns:getQuoteResponse xmlns:ns="http://services.samples/xsd";>
+     *      <ns:return>
+     *          <ns:change>-2.3238706829151026</ns:change>
+     *          ...
+     *          <ns:symbol>IBM</ns:symbol>
+     *          <ns:volume>17949</ns:volume>
+     *      </ns:return>
+     *  </ns:getQuoteResponse>
      */
     public static String parseStandardResponsePayload(OMElement result) throws 
Exception {
 
-        OMElement getQResp = result.getFirstChildWithName(
-            new QName("", "StockQuote"));
-        if (getQResp != null) {
-            OMElement price = getQResp.getFirstChildWithName(
-                new QName("", "Price"));
-            return price.getText();
+        OMElement last = result.getFirstChildWithName(
+            new QName("http://services.samples/xsd";, "last"));
+        if (last != null) {
+            return last.getText();
         } else {
             throw new Exception("Unexpected response : " + result);
         }

Modified: 
incubator/synapse/trunk/java/modules/samples/src/samples/common/Util.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/common/Util.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/common/Util.java 
(original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/common/Util.java 
Mon Jul 31 03:39:16 2006
@@ -32,7 +32,7 @@
         String symbol, String soapAction, String xurl, String turl, String 
repo) {
 
         try {
-            OMElement getQuote = 
InvesbotHandler.createStandardRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createStandardRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -55,7 +55,7 @@
 
             OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
             System.out.println("Standard :: Stock price = $" +
-                InvesbotHandler.parseStandardResponsePayload(result));
+                StockQuoteHandler.parseStandardResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -66,7 +66,7 @@
         String symbol, String soapAction, String xurl, String turl, String 
repo) {
 
         try {
-            OMElement getQuote = 
InvesbotHandler.createCustomRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createCustomRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -89,7 +89,7 @@
 
             OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
             System.out.println("Custom :: Stock price = $" +
-                InvesbotHandler.parseCustomResponsePayload(result));
+                StockQuoteHandler.parseCustomResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -99,7 +99,7 @@
     public static void testAdvancedQuote(
         String symbol, String soapAction, String xurl, String turl, String 
repo) {
         try {
-            OMElement getQuote = 
InvesbotHandler.createCustomRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createCustomRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -122,7 +122,7 @@
 
             OMElement result = serviceClient.sendReceive(getQuote);
             System.out.println("Custom :: Stock price = $" +
-                
InvesbotHandler.parseCustomResponsePayload(result.getFirstElement()));
+                
StockQuoteHandler.parseCustomResponsePayload(result.getFirstElement()));
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -132,7 +132,7 @@
     public static void testErroneousQuote(
         String symbol, String soapAction, String xurl, String turl, String 
repo) {
         try {
-            OMElement getQuote = 
InvesbotHandler.createErroneousCustomRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createErroneousCustomRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -155,7 +155,7 @@
 
             OMElement result = serviceClient.sendReceive(getQuote);
             System.out.println("Error :: Stock price = $" +
-                
InvesbotHandler.parseCustomResponsePayload(result.getFirstElement()));
+                
StockQuoteHandler.parseCustomResponsePayload(result.getFirstElement()));
 
         } catch (Exception e) {
             if (e instanceof AxisFault) {

Modified: 
incubator/synapse/trunk/java/modules/samples/src/samples/proxy/ProxyStockQuoteClient.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/proxy/ProxyStockQuoteClient.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/proxy/ProxyStockQuoteClient.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/proxy/ProxyStockQuoteClient.java
 Mon Jul 31 03:39:16 2006
@@ -19,7 +19,7 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.MessageContextConstants;
-import samples.common.InvesbotHandler;
+import samples.common.StockQuoteHandler;
 import samples.common.Util;
 
 public class ProxyStockQuoteClient {

Added: 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DirectStockQuoteClient.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DirectStockQuoteClient.java?rev=427065&view=auto
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DirectStockQuoteClient.java
 (added)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DirectStockQuoteClient.java
 Mon Jul 31 03:39:16 2006
@@ -0,0 +1,54 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package samples.userguide;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.MessageContextConstants;
+import samples.common.StockQuoteHandler;
+
+public class DirectStockQuoteClient {
+
+    public static void main(String[] args) {
+
+        String symbol  = "IBM";
+        String turl    = 
"http://localhost:9000/axis2/services/SimpleStockQuoteService";;
+        String sAction = "urn:getQuote";
+
+        if (args.length > 0) symbol = args[0];
+        if (args.length > 2) turl   = args[2];
+
+        try {
+            OMElement getQuote = 
StockQuoteHandler.createStandardRequestPayload(symbol);
+
+            Options options = new Options();
+            if (turl != null)
+                options.setProperty(MessageContextConstants.TRANSPORT_URL, 
turl);
+            options.setAction(sAction);
+
+            ServiceClient serviceClient = new ServiceClient();
+            serviceClient.setOptions(options);
+            OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
+
+            System.out.println("Standard :: Stock price = $" +
+                StockQuoteHandler.parseStandardResponsePayload(result));
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

Modified: 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
 Mon Jul 31 03:39:16 2006
@@ -19,7 +19,7 @@
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
 import org.apache.axis2.context.MessageContextConstants;
-import samples.common.InvesbotHandler;
+import samples.common.StockQuoteHandler;
 
 /**
  * A simple example showing a dumb client.. the client just sets the transport
@@ -30,15 +30,15 @@
 
     public static void main(String[] args) {
 
-        String symbol = "IBM";
-        String turl = "http://localhost:8080/StockQuote";;
-        String sAction = "http://ws.invesbot.com/GetQuote";;
+        String symbol  = "IBM";
+        String turl    = 
"http://localhost:9000/axis2/services/SimpleStockQuoteService";;
+        String sAction = "urn:getQuote";
 
         if (args.length > 0) symbol = args[0];
         if (args.length > 1) turl = args[1];
 
         try {
-            OMElement getQuote = 
InvesbotHandler.createStandardRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createStandardRequestPayload(symbol);
 
             Options options = new Options();
             if (turl != null)
@@ -50,7 +50,7 @@
 
             OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
             System.out.println("Standard :: Stock price = $" +
-                InvesbotHandler.parseStandardResponsePayload(result));
+                StockQuoteHandler.parseStandardResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();

Modified: 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
 Mon Jul 31 03:39:16 2006
@@ -12,7 +12,7 @@
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HttpTransportProperties;
 import org.apache.axiom.om.OMElement;
-import samples.common.InvesbotHandler;
+import samples.common.StockQuoteHandler;
 
 import javax.xml.namespace.QName;
 
@@ -31,16 +31,16 @@
     public static void main(String[] args) {
 
         String symbol = "IBM";
-        String xurl   = "http://ws.invesbot.com/stockquotes.asmx";;
+        String xurl   = 
"http://localhost:9000/axis2/services/SimpleStockQuoteService";;
         String purl   = "http://localhost:8080";;
-        String sAction= "http://ws.invesbot.com/GetQuote";;
+        String sAction= "urn:getQuote";
 
         if (args.length > 0) symbol = args[0];
         if (args.length > 1) xurl   = args[1];
         if (args.length > 2) purl   = args[2];
 
         try {
-            OMElement getQuote = 
InvesbotHandler.createStandardRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createStandardRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -66,7 +66,7 @@
 
             OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
             System.out.println("Standard :: Stock price = $" +
-                InvesbotHandler.parseStandardResponsePayload(result));
+                StockQuoteHandler.parseStandardResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();

Modified: 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
 Mon Jul 31 03:39:16 2006
@@ -10,7 +10,7 @@
 
 import javax.xml.namespace.QName;
 
-import samples.common.InvesbotHandler;
+import samples.common.StockQuoteHandler;
 
 /**
  * The EPR to the actual service is set, but the transport is set to
@@ -21,9 +21,9 @@
     public static void main(String[] args) {
 
         String symbol  = "IBM";
-        String xurl    = "http://ws.invesbot.com/stockquotes.asmx";;
+        String xurl    = 
"http://localhost:9000/axis2/services/SimpleStockQuoteService";;
         String turl    = "http://localhost:8080";;
-        String sAction = "http://ws.invesbot.com/GetQuote";;
+        String sAction = "urn:getQuote";
         String repo    = "client_repo";
 
         if (args.length > 0) symbol = args[0];
@@ -32,7 +32,7 @@
         if (args.length > 3) repo   = args[3];
 
         try {
-            OMElement getQuote = 
InvesbotHandler.createStandardRequestPayload(symbol);
+            OMElement getQuote = 
StockQuoteHandler.createStandardRequestPayload(symbol);
 
             Options options = new Options();
             if (xurl != null)
@@ -55,7 +55,7 @@
 
             OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
             System.out.println("Standard :: Stock price = $" +
-                InvesbotHandler.parseStandardResponsePayload(result));
+                StockQuoteHandler.parseStandardResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();

Modified: 
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml 
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml 
Mon Jul 31 03:39:16 2006
@@ -4,10 +4,10 @@
     
     <sequence name="stockquote">
        <!-- set the To address to the real endpoint -->
-       <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+       <header name="To" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
     
        <!-- check if the symbol is MSFT -->
-      <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://ws.invesbot.com/";>
+      <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://services.samples/xsd";>
        <!-- if it is throw a fault -->
        <makefault>
                <code value="tns:Receiver" 
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>

Modified: 
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_1.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_1.xml?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_1.xml 
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_1.xml 
Mon Jul 31 03:39:16 2006
@@ -23,9 +23,12 @@
                          
                        <xsl:template match="m0:CheckPriceRequest">
                        
-                       <m:GetQuote xmlns:m="http://ws.invesbot.com/";>
-                               <m:symbol><xsl:value-of 
select="m0:Code"/></m:symbol>
-                       </m:GetQuote>
+                       <m:getQuote xmlns:m="http://services.samples/xsd";>
+                               <m:request>
+                                       <m:symbol><xsl:value-of 
select="m0:Code"/></m:symbol>
+                               </m:request>
+                       </m:getQuote>
+
                                        
                        </xsl:template>
                        </xsl:stylesheet>
@@ -35,7 +38,7 @@
 
     <sequence name="customrequest">
        <!-- set the To address to the real endpoint -->
-       <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+       <header name="To" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
        
        <!-- set correlation field to custom label -->
        <set-property name="correlate/label" value="customquote"/>
@@ -57,7 +60,7 @@
     
     <sequence name="stockquote">
        <!-- set the To address to the real endpoint -->
-       <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+       <header name="To" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
     
        <!-- check if the symbol is MSFT -->
       <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://www.webserviceX.NET/";>

Modified: 
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml 
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_2.xml 
Mon Jul 31 03:39:16 2006
@@ -18,7 +18,7 @@
        <set-property name="xslt-key-resp" 
key="file:synapse_repository/conf/sample/transform_back.xslt"/>
   
        <!-- define a reuseable endpoint definition and use it within config -->
-       <endpoint name="invesbot" 
address="http://ws.invesbot.com/stockquotes.asmx"/>
+       <endpoint name="stockquote" 
address="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
 
     <sequence name="customrequest">
        <!-- is this a valid custom request ? -->
@@ -63,9 +63,9 @@
                <property name="symbol" expression="get-property('symbol')"/>
        </log>
        
-       <!-- send message to real endpoint referenced by name "invesbot" and 
stop -->
+       <!-- send message to real endpoint referenced by name "stockquote" and 
stop -->
        <send>
-               <endpoint ref="invesbot"/>
+               <endpoint ref="stockquote"/>
        </send>
     </sequence>
 
@@ -79,7 +79,7 @@
     
     <sequence name="stockquote">
        <!-- set the To address to the real endpoint -->
-       <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+       <header name="To" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
     
        <!-- check if the symbol is MSFT -->
       <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://www.webserviceX.NET/";>

Modified: incubator/synapse/trunk/java/repository/conf/sample/transform.xslt
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/transform.xslt?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/transform.xslt 
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/transform.xslt Mon Jul 
31 03:39:16 2006
@@ -12,9 +12,11 @@
   
 <xsl:template match="m0:CheckPriceRequest">
 
-<m:GetQuote xmlns:m="http://ws.invesbot.com/";>
-       <m:symbol><xsl:value-of select="m0:Code"/></m:symbol>
-</m:GetQuote>
+<m:getQuote xmlns:m="http://services.samples/xsd";>
+       <m:request>
+               <m:symbol><xsl:value-of select="m0:Code"/></m:symbol>
+       </m:request>
+</m:getQuote>
 
 </xsl:template>
 </xsl:stylesheet>

Modified: 
incubator/synapse/trunk/java/repository/conf/sample/transform_back.xslt
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/transform_back.xslt?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/transform_back.xslt 
(original)
+++ incubator/synapse/trunk/java/repository/conf/sample/transform_back.xslt Mon 
Jul 31 03:39:16 2006
@@ -2,21 +2,21 @@
 <xsl:stylesheet version="2.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
        xmlns:fn="http://www.w3.org/2005/02/xpath-functions";
-       xmlns:m0="http://ws.invesbot.com/";
+       xmlns:m0="http://services.samples/xsd";
        exclude-result-prefixes="m0 fn">
 <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
 
 <xsl:template match="/">
-  <xsl:apply-templates select="//StockQuote" /> 
+  <xsl:apply-templates select="//m0:return" /> 
 </xsl:template>
   
-<xsl:template match="StockQuote">
+<xsl:template match="m0:return">
 
 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
 <soap:Body>
 <m:CheckPriceResponse xmlns:m="http://www.apache-synapse.org/test";>
-       <m:Code><xsl:value-of select="m0:Symbol"/></m:Code>
-       <m:Price><xsl:value-of select="m0:Price"/></m:Price>
+       <m:Code><xsl:value-of select="m0:symbol"/></m:Code>
+       <m:Price><xsl:value-of select="m0:last"/></m:Price>
 </m:CheckPriceResponse>
 </soap:Body>
 </soap:Envelope>

Modified: incubator/synapse/trunk/java/repository/conf/synapse.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/synapse.xml?rev=427065&r1=427064&r2=427065&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/synapse.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/synapse.xml Mon Jul 31 
03:39:16 2006
@@ -4,10 +4,10 @@
     
     <sequence name="stockquote">
        <!-- set the To address to the real endpoint -->
-       <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+       <header name="To" 
value="http://localhost:9000/axis2/services/SimpleStockQuoteService"/>
     
        <!-- check if the symbol is MSFT -->
-      <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://ws.invesbot.com/";>
+      <filter xpath="//*[wsx:symbol='MSFT']" 
xmlns:wsx="http://services.samples/xsd";>
        <!-- if it is throw a fault -->
        <makefault>
                <code value="tns:Receiver" 
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to