Author: asankha
Date: Thu Sep 28 04:51:56 2006
New Revision: 450816

URL: http://svn.apache.org/viewvc?view=rev&rev=450816
Log:
update sample service with more cases and the axis2.xml to be in sync with 
Axis2 1.1 RC

Added:
    
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/PlaceOrder.java
Modified:
    
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
    
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl
    incubator/synapse/trunk/java/repository/conf/axis2.xml

Added: 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/PlaceOrder.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/PlaceOrder.java?view=auto&rev=450816
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/PlaceOrder.java
 (added)
+++ 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/PlaceOrder.java
 Thu Sep 28 04:51:56 2006
@@ -0,0 +1,46 @@
+/*
+* 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.services;
+
+public class PlaceOrder {
+    String symbol;
+    int quantity;
+    double price;
+
+    public String getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+
+    public int getQuantity() {
+        return quantity;
+    }
+
+    public void setQuantity(int quantity) {
+        this.quantity = quantity;
+    }
+
+    public double getPrice() {
+        return price;
+    }
+
+    public void setPrice(double price) {
+        this.price = price;
+    }
+}

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?view=diff&rev=450816&r1=450815&r2=450816
==============================================================================
--- 
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
 Thu Sep 28 04:51:56 2006
@@ -14,11 +14,20 @@
 * limitations under the License.
 */
 package samples.services;
+import java.util.Date;
 
 public class SimpleStockQuoteService {
 
+    // in-out
     public GetQuoteResponse getQuote(GetQuote request) {
-        System.out.println("Generating quote for : " + request.getSymbol());
+        System.out.println(new Date() + " :: Generating quote for : " + 
request.getSymbol());
         return new GetQuoteResponse(request.getSymbol());
+    }
+
+    // in only
+    public void placeOrder(PlaceOrder order) {
+        System.out.println(new Date() + " :: Accepted order for : " +
+            order.getQuantity() + " stocks of " + order.getSymbol() +
+            " at $ " + order.getPrice());
     }
 }

Modified: 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl?view=diff&rev=450816&r1=450815&r2=450816
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl
 Thu Sep 28 04:51:56 2006
@@ -1,14 +1,14 @@
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:axis2="http://ws.apache.org/axis2"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:ns0="http://services.samples/xsd"; xmlns:ns1="http://org.apache.axis2/xsd"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
targetNamespace="http://ws.apache.org/axis2";>
+<wsdl:definitions xmlns:axis2="http://services.samples"; 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
xmlns:ns1="http://services.samples/xsd"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
targetNamespace="http://services.samples";>
        <wsdl:types>
-               <xs:schema xmlns:stn_1="http://services.samples/xsd"; 
attributeFormDefault="qualified" elementFormDefault="unqualified" 
targetNamespace="http://services.samples/xsd";>
+               <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:ax21="http://services.samples/xsd"; attributeFormDefault="qualified" 
elementFormDefault="qualified" targetNamespace="http://services.samples/xsd";>
                        <xs:element name="getQuote">
                                <xs:complexType>
                                        <xs:sequence>
-                                               <xs:element name="request" 
type="stn_1:GetQuote"/>
+                                               <xs:element name="request" 
type="ax21:GetQuote"/>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
-                       <xs:element name="GetQuote" type="stn_1:GetQuote"/>
+                       <xs:element name="GetQuote" type="ax21:GetQuote"/>
                        <xs:complexType name="GetQuote">
                                <xs:sequence>
                                        <xs:element name="symbol" 
type="xs:string"/>
@@ -17,18 +17,18 @@
                        <xs:element name="getQuoteResponse">
                                <xs:complexType>
                                        <xs:sequence>
-                                               <xs:element name="response" 
type="stn_1:GetQuoteResponse"/>
+                                               <xs:element name="return" 
type="ax21:GetQuoteResponse"/>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
-                       <xs:element name="GetQuoteResponse" 
type="stn_1:GetQuoteResponse"/>
+                       <xs:element name="GetQuoteResponse" 
type="ax21:GetQuoteResponse"/>
                        <xs:complexType name="GetQuoteResponse">
                                <xs:sequence>
                                        <xs:element name="change" 
type="xs:double"/>
                                        <xs:element name="earnings" 
type="xs:double"/>
                                        <xs:element name="high" 
type="xs:double"/>
                                        <xs:element name="last" 
type="xs:double"/>
-                                       <xs:element name="lastTradeTimestamp" 
type="xs:dateTime"/>
+                                       <xs:element name="lastTradeTimestamp" 
type="xs:string"/>
                                        <xs:element name="low" 
type="xs:double"/>
                                        <xs:element name="marketCap" 
type="xs:double"/>
                                        <xs:element name="name" 
type="xs:string"/>
@@ -40,36 +40,62 @@
                                        <xs:element name="volume" 
type="xs:int"/>
                                </xs:sequence>
                        </xs:complexType>
+                       <xs:element name="placeOrder">
+                               <xs:complexType>
+                                       <xs:sequence>
+                                               <xs:element name="order" 
type="ax21:PlaceOrder"/>
+                                       </xs:sequence>
+                               </xs:complexType>
+                       </xs:element>
+                       <xs:element name="PlaceOrder" type="ax21:PlaceOrder"/>
+                       <xs:complexType name="PlaceOrder">
+                               <xs:sequence>
+                                       <xs:element name="price" 
type="xs:double"/>
+                                       <xs:element name="quantity" 
type="xs:int"/>
+                                       <xs:element name="symbol" 
type="xs:string"/>
+                               </xs:sequence>
+                       </xs:complexType>
                </xs:schema>
        </wsdl:types>
        <wsdl:message name="getQuoteMessage">
-               <wsdl:part name="part1" element="ns0:getQuote"/>
+               <wsdl:part name="part1" element="ns1:getQuote"/>
        </wsdl:message>
-       <wsdl:message name="getQuoteResponse">
-               <wsdl:part name="part1" element="ns0:getQuoteResponse"/>
+       <wsdl:message name="getQuoteResponseMessage">
+               <wsdl:part name="part1" element="ns1:getQuoteResponse"/>
        </wsdl:message>
-       <wsdl:portType name="stockquotePortType">
+       <wsdl:message name="placeOrderMessage">
+               <wsdl:part name="part1" element="ns1:placeOrder"/>
+       </wsdl:message>
+       <wsdl:portType name="SimpleStockQuoteServicePortType">
                <wsdl:operation name="getQuote">
                        <wsdl:input message="axis2:getQuoteMessage"/>
-                       <wsdl:output message="axis2:getQuoteResponse"/>
+                       <wsdl:output message="axis2:getQuoteResponseMessage"/>
+               </wsdl:operation>
+               <wsdl:operation name="placeOrder">
+                       <wsdl:input message="axis2:placeOrderMessage"/>
                </wsdl:operation>
        </wsdl:portType>
-       <wsdl:binding name="stockquoteSOAP11Binding" 
type="axis2:stockquotePortType">
+       <wsdl:binding name="SimpleStockQuoteServiceSOAP11Binding" 
type="axis2:SimpleStockQuoteServicePortType">
                <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="getQuote">
                        <soap:operation soapAction="urn:getQuote" 
style="document"/>
                        <wsdl:input>
-                               <soap:body use="literal"/>
+                               <soap:body use="literal" 
namespace="http://services.samples"/>
                        </wsdl:input>
                        <wsdl:output>
-                               <soap:body use="literal"/>
+                               <soap:body use="literal" 
namespace="http://services.samples"/>
                        </wsdl:output>
                </wsdl:operation>
+               <wsdl:operation name="placeOrder">
+                       <soap:operation soapAction="urn:placeOrder" 
style="document"/>
+                       <wsdl:input>
+                               <soap:body use="literal" 
namespace="http://services.samples"/>
+                       </wsdl:input>
+               </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="SimpleStockQuoteService">
-               <wsdl:port name="stockquoteSOAP11port_http" 
binding="axis2:stockquoteSOAP11Binding">
-                       <soap:address 
location="http://192.168.1.213:8080/axis2/services/stockquote"/>
+               <wsdl:port name="SimpleStockQuoteServiceSOAP11port" 
binding="axis2:SimpleStockQuoteServiceSOAP11Binding">
+                       <soap:address 
location="http://localhost:8080/axis2/services/SimpleStockQuoteService"/>
                </wsdl:port>
        </wsdl:service>
-       <wsdl:documentation>My Echo Service XXX</wsdl:documentation>
 </wsdl:definitions>

Modified: incubator/synapse/trunk/java/repository/conf/axis2.xml
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/axis2.xml?view=diff&rev=450816&r1=450815&r2=450816
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/axis2.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/axis2.xml Thu Sep 28 04:51:56 
2006
@@ -5,6 +5,15 @@
     <parameter name="hotdeployment" locked="false">true</parameter>

     <parameter name="hotupdate" locked="false">false</parameter>

     <parameter name="enableMTOM" locked="false">false</parameter>

+    <parameter name="enableSwA" locked="false">false</parameter>

+

+    <!--Uncomment if you want to enable file caching for attachments -->

+    <!--parameter name="cacheAttachments" locked="false">true</parameter>

+    <parameter name="attachmentDIR" locked="false"></parameter>

+    <parameter name="sizeThreshold" locked="false">4000</parameter-->

+

+    <!--This will give out the timout of the configuration contexts, in 
seconds-->

+    <parameter name="ConfigContextTimeoutInterval" 
locked="false">30</parameter>

 

     <!--During a fault, stacktrace can be sent with the fault message. The 
following flag will control -->

     <!--that behaviour.-->

@@ -18,18 +27,48 @@
 

 

     <parameter name="Sandesha2StorageManager" 
locked="false">inmemory</parameter>

-

-    <!--This is the user name and password of admin console-->

     <parameter name="userName" locked="false">admin</parameter>

     <parameter name="password" locked="false">axis2</parameter>

 

-    <!-- ==================================================== -->

-    <parameter name="Sandesha2StorageManager" 
locked="false">inmemory</parameter>

-    <module ref="addressing"/>

-    <module ref="synapse"/>

+    <!--Following params will set the proper context paths for invocations. 
All the endpoints will have a commons context-->

+    <!--root which can configured using the following contextRoot parameter-->

+    <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->

+

+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters 
can be used to distingiush those endpoints-->

+    <!--In case of a servlet, if you change this you have to manually change 
the settings of your servlet container to map this -->

+    <!--context path to proper Axis2 servlets-->

+    <!--<parameter name="servicePath" locked="false">services</parameter>-->

+    <!--<parameter name="restPath" locked="false">rest</parameter>-->

+

 

-    <!-- ==================================================== -->

+    <!--Set the flag to true if you want to enable transport level session 
mangment-->

+    <parameter name="manageTransportSession" locked="false">false</parameter>

 

+    <!--Following two parameters will be used to handle REST in Axis2. The 
default settings will make Axis2 to have two-->

+    <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP 
message handling (AxisServlet). But following-->

+    <!--parameters help to tweak the message handling of two main servlets. -->

+

+    <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet 
will handle both SOAP and REST messages -->

+    <parameter name="enableRESTInAxis2MainServlet" 
locked="true">false</parameter>

+

+    <!-- Following parameter will completely disable REST handling in both the 
servlets-->

+    <parameter name="disableREST" locked="true">false</parameter>

+

+    <!-- This will disable the separate servlet we have for REST handling. -->

+    <parameter name="disableSeparateEndpointForREST" 
locked="true">false</parameter>

+

+    <!-- If you have a frontend host which exposes this webservice using a 
different public URL  -->

+    <!-- use this parameter to override autodetected url -->

+    <!--<parameter name="httpFrontendHostUrl" 
locked="false">https://someotherhost/context</parameter>-->

+

+

+    <!--    The way of adding listener to the system-->

+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->

+    <!--        <parameter name="RSS_URL" 
locked="false">http://127.0.0.1/rss</parameter>-->

+    <!--    </listener>-->

+

+    <parameter name="Sandesha2StorageManager" 
locked="false">inmemory</parameter>

+    

     <!-- ================================================= -->

     <!-- Message Receivers -->

     <!-- ================================================= -->

@@ -72,11 +111,19 @@
         <!-- <parameter name="RequestMaxThreadPoolSize"  
locked="false">100</parameter>                     -->

         <!-- <parameter name="threadKeepAliveTime"       
locked="false">240000</parameter>                  -->

         <!-- <parameter name="threadKeepAliveTimeUnit"   
locked="false">MILLISECONDS</parameter>            -->

+

+    <!--Uncomment if you want to have SMTP transport support-->

+    <!--<transportReceiver name="mail" 
class="org.apache.axis2.transport.mail.SimpleMailListener">-->

+    <!--<parameter name="transport.mail.pop3.host" 
locked="false">127.0.0.1</parameter>-->

+    <!--<parameter name="transport.mail.pop3.user" 
locked="false">axis2</parameter>-->

+    <!--<parameter name="transport.mail.pop3.password" 
locked="false">axis2</parameter>-->

+    <!--<parameter name="transport.mail.pop3.port" 
locked="false">110</parameter>-->

+    <!--<parameter name="transport.mail.replyToAddress" locked="false">[EMAIL 
PROTECTED]</parameter>-->

     <!--</transportReceiver>-->

 

     <transportReceiver name="tcp"

                        class="org.apache.axis2.transport.tcp.TCPServer">

-        <parameter name="port" locked="false">6061</parameter>

+        <parameter name="port" locked="false">6060</parameter>

         <!--If you want to give your own host address for EPR generation-->

         <!--uncommet following paramter , and set as you required.-->

         <!--<parameter name="hostname" 
locked="false">tcp://myApp.com/ws</parameter>-->

@@ -111,8 +158,6 @@
                      
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>

     <transportSender name="local"

                      
class="org.apache.axis2.transport.local.LocalTransportSender"/>

-    <transportSender name="jms"

-                     class="org.apache.axis2.transport.jms.JMSSender"/>

     <!--<transportSender name="http"

                      
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">-->

     <transportSender name="http"

@@ -125,6 +170,29 @@
         <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>

         <parameter name="Transfer-Encoding" locked="false">chunked</parameter>

     </transportSender>

+    <transportSender name="jms"

+                     class="org.apache.axis2.transport.jms.JMSSender"/>

+

+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP 
transport Receiver

+   <transportSender name="mailto" 
class="org.apache.axis2.transport.mail.MailTransportSender">

+       <parameter name="transport.mail.smtp.host" 
locked="false">127.0.0.1</parameter>

+       <parameter name="transport.mail.smtp.user" 
locked="false">axis2</parameter>

+       <parameter name="transport.mail.smtp.password" 
locked="false">axis2</parameter>

+       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>

+   </transportSender>

+   -->

+

+    <!-- ================================================= -->

+    <!-- Global Modules  -->

+    <!-- ================================================= -->

+    <!-- Comment this to disable Addressing -->

+    <module ref="addressing"/>

+    <module ref="synapse"/>

+

+    <!--Configuring module , providing parameters for modules whether they 
refer or not-->

+    <!--<moduleConfig name="addressing">-->

+    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->

+    <!--</moduleConfig>-->

 

     <!-- ================================================= -->

     <!-- Phases  -->

@@ -155,7 +223,7 @@
             </handler>

             <handler name="InstanceDispatcher"

                      class="org.apache.axis2.engine.InstanceDispatcher">

-                <order phase="PostDispatch"/>

+                <order phase="Dispatch"/>

             </handler>

         </phase>

         <!--  System pre defined phases       -->

@@ -173,6 +241,7 @@
         <!--these phase will run irrespective of the service-->

         <phase name="PolicyDetermination"/>

         <phase name="MessageOut"/>

+        <phase name="Security"/>

     </phaseOrder>

     <phaseOrder type="INfaultflow">

         <phase name="PreDispatch"/>




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

Reply via email to