You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by as...@apache.org on 2007/04/19 18:45:58 UTC

svn commit: r530481 - in /webservices/synapse/trunk/java/modules/samples/services: MTOMSampleService/ MTOMSwASampleService/ MTOMSwASampleService/conf/ MTOMSwASampleService/src/samples/services/ SecureStockQuoteService/ SecureStockQuoteService/conf/ Sec...

Author: asankha
Date: Thu Apr 19 09:45:55 2007
New Revision: 530481

URL: http://svn.apache.org/viewvc?view=rev&rev=530481
Log:
update and cleanup sample services - sweep 1

Added:
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/
      - copied from r530324, webservices/synapse/trunk/java/modules/samples/services/MTOMSampleService/
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java   (with props)
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/
      - copied from r529132, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml
      - copied, changed from r530324, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/build.xml
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/
      - copied from r530324, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/conf/
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/src/
      - copied from r530324, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/src/
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/store.jks
      - copied unchanged from r530324, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/store.jks
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuote.java
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuoteResponse.java
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivity.java
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivityResponse.java
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/TradingDay.java
Removed:
    webservices/synapse/trunk/java/modules/samples/services/MTOMSampleService/
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSampleService.java
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService1/
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService1/
Modified:
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/conf/services.xml
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl

Modified: webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml?view=diff&rev=530481&r1=530324&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml Thu Apr 19 09:45:55 2007
@@ -51,7 +51,7 @@
     </target>
 
     <target name="build-service" depends="compile-all">
-        <property name="SSQ.dir" value="${temp.dir}/MTOMSampleService"/>
+        <property name="SSQ.dir" value="${temp.dir}/MTOMSwASampleService"/>
         <mkdir dir="${SSQ.dir}"/>
 
         <mkdir dir="${SSQ.dir}/META-INF"/>
@@ -62,7 +62,7 @@
             </fileset>
         </copy>
 
-        <jar destfile="${services}/MTOMSampleService.aar">
+        <jar destfile="${services}/MTOMSwASampleService.aar">
             <fileset dir="${SSQ.dir}"/>
         </jar>
     </target>

Modified: webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/conf/services.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/conf/services.xml?view=diff&rev=530481&r1=530324&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/conf/services.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/conf/services.xml Thu Apr 19 09:45:55 2007
@@ -18,13 +18,13 @@
   -->
 
 <serviceGroup>
-<service name="MTOMSampleService">
+<service name="MTOMSwASampleService">
 	<messageReceivers>
-		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" 
+		<messageReceiver mep="http://www.w3.org/ns/wsdl/robust-in-only"
 				class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
-		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
+		<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
 				class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
 		</messageReceivers>
-		<parameter locked="false" name="ServiceClass">samples.services.MTOMSampleService</parameter>
+		<parameter locked="false" name="ServiceClass">samples.services.MTOMSwASampleService</parameter>
 </service>
 </serviceGroup>

Added: webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,112 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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;
+
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.attachments.Attachments;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.wsdl.WSDLConstants;
+
+import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
+import javax.xml.namespace.QName;
+import java.io.*;
+
+public class MTOMSwASampleService {
+
+    private static final int BUFFER = 2048;
+
+    public OMElement uploadFileUsingMTOM(OMElement request) throws Exception {
+
+        OMText binaryNode = (OMText) request.
+            getFirstChildWithName(new QName("http://www.apache-synapse.org/test", "request")).
+            getFirstChildWithName(new QName("http://www.apache-synapse.org/test", "image")).
+            getFirstOMChild();
+        DataHandler dataHandler = (DataHandler) binaryNode.getDataHandler();
+        InputStream is = dataHandler.getInputStream();
+
+        File tempFile = File.createTempFile("mtom-", ".gif");
+        FileOutputStream fos = new FileOutputStream(tempFile);
+        BufferedOutputStream dest = new BufferedOutputStream(fos, BUFFER);
+
+        byte data[] = new byte[BUFFER];
+        int count;
+        while ((count = is.read(data, 0, BUFFER)) != -1) {
+            dest.write(data, 0, count);
+        }
+
+        dest.flush();
+        dest.close();
+        System.out.println("Wrote MTOM content to temp file : " + tempFile.getAbsolutePath());
+
+        OMFactory factory = request.getOMFactory();
+        OMNamespace ns = factory.createOMNamespace("http://www.apache-synapse.org/test", "m0");
+        OMElement payload  = factory.createOMElement("uploadFileUsingMTOMResponse", ns);
+        OMElement response = factory.createOMElement("response", ns);
+        OMElement image    = factory.createOMElement("image", ns);
+
+        FileDataSource fileDataSource = new FileDataSource(tempFile);
+        dataHandler = new DataHandler(fileDataSource);
+        OMText textData = factory.createOMText(dataHandler, true);
+        image.addChild(textData);
+        response.addChild(image);
+        payload.addChild(response);
+
+        return payload;
+    }
+
+    public OMElement uploadFileUsingSwA(OMElement request) throws Exception {
+
+        String imageContentId = request.
+            getFirstChildWithName(new QName("http://www.apache-synapse.org/test", "request")).
+            getFirstChildWithName(new QName("http://www.apache-synapse.org/test", "imageId")).
+            getText();
+
+        MessageContext msgCtx   = MessageContext.getCurrentMessageContext();
+        Attachments attachment  = msgCtx.getAttachmentMap();
+        DataHandler dataHandler = attachment.getDataHandler(imageContentId);
+        File tempFile = File.createTempFile("swa-", ".gif");
+        FileOutputStream fos = new FileOutputStream(tempFile);
+        dataHandler.writeTo(fos);
+		fos.flush();
+		fos.close();
+        System.out.println("Wrote SwA attachment to temp file : " + tempFile.getAbsolutePath());
+
+        MessageContext outMsgCtx = msgCtx.getOperationContext().
+            getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+
+        OMFactory factory = request.getOMFactory();
+        OMNamespace ns = factory.createOMNamespace("http://www.apache-synapse.org/test", "m0");
+        OMElement payload  = factory.createOMElement("uploadFileUsingSwAResponse", ns);
+        OMElement response = factory.createOMElement("response", ns);
+        OMElement imageId  = factory.createOMElement("imageId", ns);
+
+        FileDataSource fileDataSource = new FileDataSource(tempFile);
+        dataHandler = new DataHandler(fileDataSource);
+        imageContentId = outMsgCtx.addAttachment(dataHandler);
+        imageId.setText(imageContentId);
+        response.addChild(imageId);
+        payload.addChild(response);
+
+        return payload;
+    }
+}

Propchange: webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/src/samples/services/MTOMSwASampleService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml (from r530324, webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/build.xml)
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml?view=diff&rev=530481&p1=webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/build.xml&r1=530324&p2=webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService3/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml Thu Apr 19 09:45:55 2007
@@ -51,7 +51,7 @@
     </target>
 
     <target name="build-service" depends="compile-all">
-        <property name="SSQ.dir" value="${temp.dir}/SecureStockQuoteService3"/>
+        <property name="SSQ.dir" value="${temp.dir}/SecureStockQuoteService"/>
         <mkdir dir="${SSQ.dir}"/>
 
         <mkdir dir="${SSQ.dir}/META-INF"/>
@@ -63,7 +63,7 @@
             </fileset>
         </copy>
 
-        <jar destfile="${services}/SecureStockQuoteService3.aar">
+        <jar destfile="${services}/SecureStockQuoteService.aar">
             <fileset dir="${SSQ.dir}"/>
         </jar>
     </target>

Modified: webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml?view=diff&rev=530481&r1=530324&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/conf/services.xml Thu Apr 19 09:45:55 2007
@@ -18,7 +18,7 @@
   -->
 
 <serviceGroup>
-<service name="SecureStockQuoteService3">
+<service name="SecureStockQuoteService">
 	<module ref="rampart"/>
 	
 	<messageReceivers>

Modified: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml?view=diff&rev=530481&r1=530480&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/conf/services.xml Thu Apr 19 09:45:55 2007
@@ -20,9 +20,9 @@
 <serviceGroup>
 <service name="SimpleStockQuoteService">
 	<messageReceivers>
-		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" 
+		<messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" 
 				class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
-		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" 
+		<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
 				class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
 		</messageReceivers>
 		<parameter locked="false" name="ServiceClass">samples.services.SimpleStockQuoteService</parameter>

Added: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuote.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuote.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuote.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuote.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 GetFullQuote {
+    String symbol;
+
+    public GetFullQuote() {
+    }
+
+    public GetFullQuote(String symbol) {
+        this.symbol = symbol;
+    }
+
+    public String getSymbol() {
+        return symbol;
+    }
+
+    public void setSymbol(String symbol) {
+        this.symbol = symbol;
+    }
+}
\ No newline at end of file

Added: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuoteResponse.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuoteResponse.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuoteResponse.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetFullQuoteResponse.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 GetFullQuoteResponse {
+
+    private static final int COUNT = 365;
+    TradingDay[] tradeHistory = null;
+
+    public GetFullQuoteResponse() {
+    }
+
+    public GetFullQuoteResponse(String symbol) {
+        tradeHistory = new TradingDay[COUNT];
+        for (int i=0; i<COUNT; i++) {
+            tradeHistory[i] = new TradingDay(i, new GetQuoteResponse(symbol));
+        }
+    }
+
+    public TradingDay[] getTradeHistory() {
+        return tradeHistory;
+    }
+
+    public void setTradeHistory(TradingDay[] tradeHistory) {
+        this.tradeHistory = tradeHistory;
+    }
+
+}

Added: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivity.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivity.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivity.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivity.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 GetMarketActivity {
+    String[] symbols;
+
+    public GetMarketActivity() {
+    }
+
+    public GetMarketActivity(String[] symbols) {
+        this.symbols = symbols;
+    }
+
+    public String[] getSymbols() {
+        return symbols;
+    }
+
+    public void setSymbols(String[] symbols) {
+        this.symbols = symbols;
+    }
+}
\ No newline at end of file

Added: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivityResponse.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivityResponse.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivityResponse.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/GetMarketActivityResponse.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,43 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 GetMarketActivityResponse {
+
+    GetQuoteResponse[] quotes = null;
+
+    public GetMarketActivityResponse() {
+    }
+
+    public GetMarketActivityResponse(String[] symbols) {
+        quotes = new GetQuoteResponse[symbols.length];
+        for (int i=0; i<symbols.length; i++) {
+            quotes[i] = new GetQuoteResponse(symbols[i]);
+        }
+    }
+
+    public GetQuoteResponse[] getQuotes() {
+        return quotes;
+    }
+
+    public void setQuotes(GetQuoteResponse[] quotes) {
+        this.quotes = quotes;
+    }
+}

Modified: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java?view=diff&rev=530481&r1=530480&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/SimpleStockQuoteService.java Thu Apr 19 09:45:55 2007
@@ -23,14 +23,39 @@
 
     // in-out
     public GetQuoteResponse getQuote(GetQuote request) {
-        System.out.println(new Date() + " SimpleStockQuoteService :: Generating quote for : " + request.getSymbol());
+        System.out.println(new Date() + " " + this.getClass().getName() +
+            " :: Generating quote for : " + request.getSymbol());
         return new GetQuoteResponse(request.getSymbol());
     }
 
+    // in-out large response
+    public GetFullQuoteResponse getFullQuote(GetFullQuote request) {
+        System.out.println(new Date() + " " + this.getClass().getName() +
+            " :: Full quote for : " + request.getSymbol());
+        return new GetFullQuoteResponse(request.getSymbol());
+    }
+
+    // in-out large request and response
+    public GetMarketActivityResponse getMarketActivity(GetMarketActivity request) {
+        StringBuffer sb = new StringBuffer();
+        String[] symbols = request.getSymbols();
+        sb.append("[");
+        for (int i=0; i<symbols.length; i++) {
+            sb.append(symbols[i]);
+            if (i < symbols.length-1) {
+                sb.append(", ");
+            }
+        }
+        sb.append("]");
+        System.out.println(new Date() + " " + this.getClass().getName() +
+            " :: Generating Market activity report for : "  + sb.toString());
+        return new GetMarketActivityResponse(request.getSymbols());
+    }
+
     // in only
     public void placeOrder(PlaceOrder order) {
-        System.out.println(new Date() + " SimpleStockQuoteService :: Accepted order for : " +
-            order.getQuantity() + " stocks of " + order.getSymbol() +
-            " at $ " + order.getPrice());
+        System.out.println(new Date() + " " + this.getClass().getName() +
+            "  :: Accepted order for : " + order.getQuantity() +
+            " stocks of " + order.getSymbol() + " at $ " + order.getPrice());
     }
 }

Added: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/TradingDay.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/TradingDay.java?view=auto&rev=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/TradingDay.java (added)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/src/samples/services/TradingDay.java Thu Apr 19 09:45:55 2007
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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 TradingDay {
+    int day = 0;
+    GetQuoteResponse quote = null;
+
+    public TradingDay(int day, GetQuoteResponse quote) {
+        this.day = day;
+        this.quote = quote;
+    }
+
+    public int getDay() {
+        return day;
+    }
+
+    public void setDay(int day) {
+        this.day = day;
+    }
+
+    public GetQuoteResponse getQuote() {
+        return quote;
+    }
+
+    public void setQuote(GetQuoteResponse quote) {
+        this.quote = quote;
+    }
+}
\ No newline at end of file

Modified: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl?view=diff&rev=530481&r1=530480&r2=530481
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/wsdl/SimpleStockQuoteService.wsdl Thu Apr 19 09:45:55 2007
@@ -17,104 +17,274 @@
   ~  under the License.
   -->
 
-<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: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="ax21:GetQuote"/>
-					</xs:sequence>
-				</xs:complexType>
-			</xs:element>
-			<xs:element name="GetQuote" type="ax21:GetQuote"/>
-			<xs:complexType name="GetQuote">
-				<xs:sequence>
-					<xs:element name="symbol" type="xs:string"/>
-				</xs:sequence>
-			</xs:complexType>
-			<xs:element name="getQuoteResponse">
-				<xs:complexType>
-					<xs:sequence>
-						<xs:element name="return" type="ax21:GetQuoteResponse"/>
-					</xs:sequence>
-				</xs:complexType>
-			</xs:element>
-			<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:string"/>
-					<xs:element name="low" type="xs:double"/>
-					<xs:element name="marketCap" type="xs:double"/>
-					<xs:element name="name" type="xs:string"/>
-					<xs:element name="open" type="xs:double"/>
-					<xs:element name="peRatio" type="xs:double"/>
-					<xs:element name="percentageChange" type="xs:double"/>
-					<xs:element name="prevClose" type="xs:double"/>
-					<xs:element name="symbol" type="xs:string"/>
-					<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="ns1:getQuote"/>
-	</wsdl:message>
-	<wsdl:message name="getQuoteResponseMessage">
-		<wsdl:part name="part1" element="ns1:getQuoteResponse"/>
-	</wsdl:message>
-	<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:getQuoteResponseMessage"/>
-		</wsdl:operation>
-		<wsdl:operation name="placeOrder">
-			<wsdl:input message="axis2:placeOrderMessage"/>
-		</wsdl:operation>
-	</wsdl:portType>
-	<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" namespace="http://services.samples"/>
-			</wsdl:input>
-			<wsdl:output>
-				<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="SimpleStockQuoteServiceSOAP11port" binding="axis2:SimpleStockQuoteServiceSOAP11Binding">
-			<soap:address location="http://localhost:8080/axis2/services/SimpleStockQuoteService"/>
-		</wsdl:port>
-	</wsdl:service>
-</wsdl:definitions>
+<wsdl:definitions xmlns:axis2="http://services.samples"
+                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+                  xmlns:ns0="http://services.samples/xsd"
+                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+                  xmlns:ns1="http://org.apache.axis2/xsd"
+                  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  targetNamespace="http://services.samples">
+    <wsdl:documentation>SimpleStockQuoteService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema xmlns:ns="http://services.samples/xsd" attributeFormDefault="qualified"
+                   elementFormDefault="qualified" targetNamespace="http://services.samples/xsd">
+            <xs:element name="getFullQuote">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="request" nillable="true" type="ns:GetFullQuote"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="GetFullQuote" type="ns:GetFullQuote"/>
+            <xs:complexType name="GetFullQuote">
+                <xs:sequence>
+                    <xs:element name="symbol" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="getFullQuoteResponse">
+                <xs:complexType>
+
+                    <xs:sequence>
+                        <xs:element name="return" nillable="true" type="ns:GetFullQuoteResponse"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="GetFullQuoteResponse" type="ns:GetFullQuoteResponse"/>
+            <xs:complexType name="GetFullQuoteResponse">
+                <xs:sequence>
+                    <xs:element maxOccurs="unbounded" name="tradeHistory" nillable="true"
+                                type="ns:TradingDay"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="TradingDay" type="ns:TradingDay"/>
+            <xs:complexType name="TradingDay">
+                <xs:sequence>
+                    <xs:element name="day" type="xs:int"/>
+                    <xs:element name="quote" nillable="true" type="ns:GetQuoteResponse"/>
+                </xs:sequence>
+
+            </xs:complexType>
+            <xs:element name="GetQuoteResponse" type="ns: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" nillable="true" type="xs:string"/>
+                    <xs:element name="low" type="xs:double"/>
+                    <xs:element name="marketCap" type="xs:double"/>
+                    <xs:element name="name" nillable="true" type="xs:string"/>
+                    <xs:element name="open" type="xs:double"/>
+                    <xs:element name="peRatio" type="xs:double"/>
+                    <xs:element name="percentageChange" type="xs:double"/>
+                    <xs:element name="prevClose" type="xs:double"/>
+                    <xs:element name="symbol" nillable="true" type="xs:string"/>
+
+                    <xs:element name="volume" type="xs:int"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="getMarketActivity">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="request" nillable="true" type="ns:GetMarketActivity"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="GetMarketActivity" type="ns:GetMarketActivity"/>
+            <xs:complexType name="GetMarketActivity">
+                <xs:sequence>
+                    <xs:element maxOccurs="unbounded" name="symbols" nillable="true"
+                                type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="getMarketActivityResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="return" nillable="true"
+                                    type="ns:GetMarketActivityResponse"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="GetMarketActivityResponse" type="ns:GetMarketActivityResponse"/>
+            <xs:complexType name="GetMarketActivityResponse">
+                <xs:sequence/>
+            </xs:complexType>
+            <xs:element name="getQuote">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="request" nillable="true" type="ns:GetQuote"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+
+            <xs:element name="GetQuote" type="ns:GetQuote"/>
+            <xs:complexType name="GetQuote">
+                <xs:sequence>
+                    <xs:element name="symbol" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="getQuoteResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="return" nillable="true" type="ns:GetQuoteResponse"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="placeOrder">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="order" nillable="true" type="ns:PlaceOrder"/>
+
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="PlaceOrder" type="ns: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" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="placeOrderMessage">
+        <wsdl:part name="part1" element="ns0:placeOrder"/>
+    </wsdl:message>
+    <wsdl:message name="getQuoteMessage">
+        <wsdl:part name="part1" element="ns0:getQuote"/>
+    </wsdl:message>
+    <wsdl:message name="getQuoteResponse">
+        <wsdl:part name="part1" element="ns0:getQuoteResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getMarketActivityMessage">
+        <wsdl:part name="part1" element="ns0:getMarketActivity"/>
+    </wsdl:message>
+    <wsdl:message name="getMarketActivityResponse">
+        <wsdl:part name="part1" element="ns0:getMarketActivityResponse"/>
+    </wsdl:message>
+    <wsdl:message name="getFullQuoteMessage">
+        <wsdl:part name="part1" element="ns0:getFullQuote"/>
+    </wsdl:message>
+    <wsdl:message name="getFullQuoteResponse">
+        <wsdl:part name="part1" element="ns0:getFullQuoteResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="SimpleStockQuoteServicePortType">
+        <wsdl:operation name="placeOrder">
+            <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+                        message="axis2:placeOrderMessage" wsaw:Action="urn:placeOrder"/>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+                        message="axis2:getQuoteMessage" wsaw:Action="urn:getQuote"/>
+            <wsdl:output message="axis2:getQuoteResponse"/>
+        </wsdl:operation>
+        <wsdl:operation name="getMarketActivity">
+            <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+                        message="axis2:getMarketActivityMessage"
+                        wsaw:Action="urn:getMarketActivity"/>
+            <wsdl:output message="axis2:getMarketActivityResponse"/>
+        </wsdl:operation>
+        <wsdl:operation name="getFullQuote">
+            <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+                        message="axis2:getFullQuoteMessage" wsaw:Action="urn:getFullQuote"/>
+            <wsdl:output message="axis2:getFullQuoteResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="SimpleStockQuoteServiceSOAP11Binding"
+                  type="axis2:SimpleStockQuoteServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+        <wsdl:operation name="placeOrder">
+            <soap:operation soapAction="urn:placeOrder" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap:operation soapAction="urn:getQuote" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMarketActivity">
+            <soap:operation soapAction="urn:getMarketActivity" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getFullQuote">
+            <soap:operation soapAction="urn:getFullQuote" style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="SimpleStockQuoteServiceSOAP12Binding"
+                  type="axis2:SimpleStockQuoteServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+        <wsdl:operation name="placeOrder">
+            <soap12:operation soapAction="urn:placeOrder" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+        <wsdl:operation name="getQuote">
+            <soap12:operation soapAction="urn:getQuote" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getMarketActivity">
+            <soap12:operation soapAction="urn:getMarketActivity" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getFullQuote">
+            <soap12:operation soapAction="urn:getFullQuote" style="document"/>
+            <wsdl:input>
+                <soap12:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SimpleStockQuoteService">
+        <wsdl:port name="SimpleStockQuoteServiceSOAP11port_https"
+                   binding="axis2:SimpleStockQuoteServiceSOAP11Binding">
+            <soap:address location="https://asankha:9002/axis2/services/SimpleStockQuoteService"/>
+        </wsdl:port>
+        <wsdl:port name="SimpleStockQuoteServiceSOAP11port_http1"
+                   binding="axis2:SimpleStockQuoteServiceSOAP11Binding">
+            <soap:address location="http://asankha:9000/axis2/services/SimpleStockQuoteService"/>
+        </wsdl:port>
+        <wsdl:port name="SimpleStockQuoteServiceSOAP12port_https"
+                   binding="axis2:SimpleStockQuoteServiceSOAP12Binding">
+            <soap12:address location="https://asankha:9002/axis2/services/SimpleStockQuoteService"/>
+        </wsdl:port>
+        <wsdl:port name="SimpleStockQuoteServiceSOAP12port_http1"
+                   binding="axis2:SimpleStockQuoteServiceSOAP12Binding">
+            <soap12:address location="http://asankha:9000/axis2/services/SimpleStockQuoteService"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file



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