Author: asankha
Date: Thu Jan 25 09:26:07 2007
New Revision: 499861
URL: http://svn.apache.org/viewvc?view=rev&rev=499861
Log:
prevent serialization of the message when debug logging is off
limit client processor threads to one to try to overcome concurrent
modification exception
add a fast stockquote service that causes least performance implication to be
used for performance tests
show a debug log message for connection exceptions
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/services.xml
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/FastStockQuoteService.java
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuote.java
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuoteResponse.java
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/PlaceOrder.java
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/FastStockQuoteService.wsdl
Modified:
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java
Modified:
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java?view=diff&rev=499861&r1=499860&r2=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
(original)
+++
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/builtin/SendMediator.java
Thu Jan 25 09:26:07 2007
@@ -60,23 +60,20 @@
boolean shouldTrace = shouldTrace(synCtx.getTracingState());
try {
- // TODO this may be really strange but true.. unless you call the
below, sometimes it
- // results in an unbound URI exception for no credible reason -
needs more investigation
- // seems like a woodstox issue. Use hack for now
- // synCtx.getEnvelope().build();
-
if (shouldTrace) {
trace.trace("Start : Send mediator");
trace.trace("Sending Message :: " + synCtx.getEnvelope());
}
// if no endpoints are defined, send where implicitly stated
if (endpoints.isEmpty()) {
- log.debug("Sending message using implicit message
properties..");
- log.debug("Sending To: " + (synCtx.getTo() != null ?
- synCtx.getTo().getAddress() : "null"));
- log.debug("SOAPAction: " + (synCtx.getWSAAction() != null ?
- synCtx.getWSAAction() : "null"));
- log.debug("Body : \n" + synCtx.getEnvelope());
+ if (log.isDebugEnabled()) {
+ log.debug("Sending message using implicit message
properties..");
+ log.debug("Sending To: " + (synCtx.getTo() != null ?
+ synCtx.getTo().getAddress() : "null"));
+ log.debug("SOAPAction: " + (synCtx.getWSAAction() != null ?
+ synCtx.getWSAAction() : "null"));
+ log.debug("Body : \n" + synCtx.getEnvelope());
+ }
synCtx.getEnvironment().send(synCtx);
} else if (endpoints.size() == 1) {
@@ -115,8 +112,6 @@
synCtx.setProperty(Constants.OUTFLOW_USE_SEPARATE_LISTENER, Boolean.TRUE);
}
String endPointName = singleEndpoint.getName();
- log.debug("Sending message to endpoint :: name = " +
- endPointName + " resolved address = " + eprAddress);
// Setting Required property to collect the End Point
statistics
boolean statisticsEnable =
(org.apache.synapse.Constants.STATISTICS_ON ==
singleEndpoint.getStatisticsEnable());
@@ -126,11 +121,16 @@
synCtx.setCorrelationProperty(org.apache.synapse.Constants.ENDPOINT_STATISTICS_STACK,
endPointStatisticsStack);
}
synCtx.setTo(new EndpointReference(eprAddress));
- log.debug("Sending To: " + (synCtx.getTo() != null ?
- synCtx.getTo().getAddress() : "null"));
- log.debug("SOAPAction: " + (synCtx.getWSAAction() != null ?
- synCtx.getWSAAction() : "null"));
- log.debug("Body : \n" + synCtx.getEnvelope());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Sending message to endpoint :: name = " +
+ endPointName + " resolved address = " +
eprAddress);
+ log.debug("Sending To: " + (synCtx.getTo() != null ?
+ synCtx.getTo().getAddress() : "null"));
+ log.debug("SOAPAction: " + (synCtx.getWSAAction() != null ?
+ synCtx.getWSAAction() : "null"));
+ log.debug("Body : \n" + synCtx.getEnvelope());
+ }
// if RM is turned on
if (singleEndpoint.isReliableMessagingOn()) {
Modified:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java?view=diff&rev=499861&r1=499860&r2=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
(original)
+++
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/HttpCoreNIOSender.java
Thu Jan 25 09:26:07 2007
@@ -91,7 +91,7 @@
HttpParams params = getClientParameters();
try {
- ioReactor = new DefaultConnectingIOReactor(2, params);
+ ioReactor = new DefaultConnectingIOReactor(1, params);
} catch (IOException e) {
log.error("Error starting the IOReactor", e);
}
Modified:
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java?view=diff&rev=499861&r1=499860&r2=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java
(original)
+++
webservices/synapse/trunk/java/modules/nhttp/src/org/apache/axis2/transport/nhttp/ServerHandler.java
Thu Jan 25 09:26:07 2007
@@ -253,7 +253,11 @@
* @param e the exception encountered
*/
public void exception(NHttpServerConnection conn, IOException e) {
- log.error("I/O error: " + e.getMessage());
+ if (e instanceof ConnectionClosedException) {
+ log.debug("I/O error: " + e.getMessage());
+ } else {
+ log.error("I/O error: " + e.getMessage());
+ }
shutdownConnection(conn);
}
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,71 @@
+<!--
+ ~ 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.
+ -->
+
+<project default="build-service">
+
+ <property name="synapse.home" value="../../../.."/>
+ <property name="lib" value="${synapse.home}/lib"/>
+ <property name="temp.dir" value="temp"/>
+ <property name="classes" value="${temp.dir}/classes"/>
+ <property name="src" value="src"/>
+ <property name="services" value="../../repository/services"/>
+
+ <path id="synapse.class.path">
+ <pathelement path="${java.class.path}"/>
+ <fileset dir="${synapse.home}">
+ <include name="lib/*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="init" depends="clean">
+ <mkdir dir="${temp.dir}"/>
+ <mkdir dir="${classes}"/>
+ <mkdir dir="${services}"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${temp.dir}"/>
+ </target>
+
+ <target name="compile-all" depends="init">
+ <javac debug="on" destdir="${classes}">
+ <src path="${src}"/>
+ <classpath refid="synapse.class.path"/>
+ </javac>
+ </target>
+
+ <target name="build-service" depends="compile-all">
+ <property name="SSQ.dir" value="${temp.dir}/SimpleStockQuote"/>
+ <mkdir dir="${SSQ.dir}"/>
+
+ <mkdir dir="${SSQ.dir}/META-INF"/>
+ <copy file="conf/services.xml"
tofile="${SSQ.dir}/META-INF/services.xml"/>
+ <copy file="wsdl/FastStockQuoteService.wsdl"
tofile="${SSQ.dir}/META-INF/service.wsdl"/>
+ <copy toDir="${SSQ.dir}">
+ <fileset dir="${classes}">
+ <include name="**/*.class"/>
+ </fileset>
+ </copy>
+
+ <jar destfile="${services}/FastStockQuoteService.aar">
+ <fileset dir="${SSQ.dir}"/>
+ </jar>
+ </target>
+
+</project>
\ No newline at end of file
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/services.xml
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/services.xml?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/services.xml
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/conf/services.xml
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+
+<serviceGroup>
+<service name="FastStockQuoteService">
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+
class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
+ </messageReceivers>
+ <parameter locked="false"
name="ServiceClass">samples.services.FastStockQuoteService</parameter>
+</service>
+</serviceGroup>
\ No newline at end of file
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/FastStockQuoteService.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/FastStockQuoteService.java?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/FastStockQuoteService.java
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/FastStockQuoteService.java
Thu Jan 25 09:26:07 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 java.util.Date;
+
+import javax.xml.stream.XMLStreamException;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+
+public class FastStockQuoteService {
+
+ private final static OMElement response = createResponse();
+
+ private static OMElement createResponse() {
+
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = fac.createOMNamespace("http://services.samples/xsd",
"ns");
+ OMElement getQuoteResponse = fac.createOMElement("getQuoteResponse ",
ns);
+ OMElement returnElt = fac.createOMElement("return", ns);
+
+ OMElement change = fac.createOMElement("change", ns);
+ change.addChild(fac.createOMText(change, "-2.573165716892239"));
+ returnElt.addChild(change);
+
+ OMElement earnings = fac.createOMElement("earnings", ns);
+ earnings.addChild(fac.createOMText(earnings, "12.729598827258027"));
+ returnElt.addChild(earnings);
+
+ OMElement high = fac.createOMElement("high", ns);
+ high.addChild(fac.createOMText(high, "181.57938605633444"));
+ returnElt.addChild(high);
+
+ OMElement last = fac.createOMElement("last", ns);
+ last.addChild(fac.createOMText(last, "79.93167957835779"));
+ returnElt.addChild(last);
+
+ OMElement lastTradeTimestamp =
fac.createOMElement("lastTradeTimestamp", ns);
+ lastTradeTimestamp.addChild(fac.createOMText(lastTradeTimestamp, "Thu
Jan 25 17:39:12 IST 2007"));
+ returnElt.addChild(lastTradeTimestamp);
+
+ OMElement low = fac.createOMElement("low", ns);
+ low.addChild(fac.createOMText(low, "9.93167957835779"));
+ returnElt.addChild(low);
+
+ OMElement marketCap = fac.createOMElement("marketCap", ns);
+ marketCap.addChild(fac.createOMText(marketCap, "5.93167957835779"));
+ returnElt.addChild(marketCap);
+
+ OMElement name = fac.createOMElement("name", ns);
+ name.addChild(fac.createOMText(name, "IBM Company"));
+ returnElt.addChild(name);
+
+ OMElement open = fac.createOMElement("open", ns);
+ open.addChild(fac.createOMText(open, "15.93167957835779"));
+ returnElt.addChild(open);
+
+ OMElement peRatio = fac.createOMElement("peRatio", ns);
+ peRatio.addChild(fac.createOMText(peRatio, "24.283806785853777"));
+ returnElt.addChild(peRatio);
+
+ OMElement percentageChange = fac.createOMElement("percentageChange",
ns);
+ percentageChange.addChild(fac.createOMText(percentageChange,
"-2.334460572410184"));
+ returnElt.addChild(percentageChange);
+
+ OMElement prevClose = fac.createOMElement("prevClose", ns);
+ prevClose.addChild(fac.createOMText(prevClose, "-179.58650497565893"));
+ returnElt.addChild(prevClose);
+
+ OMElement symbol = fac.createOMElement("symbol", ns);
+ symbol.addChild(fac.createOMText(symbol, "IBM"));
+ returnElt.addChild(symbol);
+
+ OMElement volume = fac.createOMElement("volume", ns);
+ volume.addChild(fac.createOMText(volume, "7618"));
+ returnElt.addChild(volume);
+
+ getQuoteResponse.addChild(returnElt);
+ return getQuoteResponse;
+ }
+
+ // in-out
+ public OMElement getQuote(OMElement request) {
+ //System.out.println(new Date() + " FastStockQuoteService ::
Generating quote for : " + request.getSymbol());
+ //return new GetQuoteResponse(request.getSymbol());
+ return response;
+ }
+
+ // in only
+ /*public void placeOrder(OMElement order) {
+ System.out.println(new Date() + " FastStockQuoteService :: Accepted
order for : " +
+ order.getQuantity() + " stocks of " + order.getSymbol() +
+ " at $ " + order.getPrice());
+ }*/
+}
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuote.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuote.java?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuote.java
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuote.java
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,38 @@
+/*
+ * 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 GetQuote {
+ String symbol;
+
+ public GetQuote() {
+ }
+
+ public GetQuote(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+}
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuoteResponse.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuoteResponse.java?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuoteResponse.java
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/GetQuoteResponse.java
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,177 @@
+/*
+ * 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 java.util.Date;
+
+public class GetQuoteResponse {
+ String symbol;
+ double last;
+ String lastTradeTimestamp;
+ double change;
+ double open;
+ double high;
+ double low;
+ int volume;
+ double marketCap;
+ double prevClose;
+ double percentageChange;
+ double earnings;
+ double peRatio;
+ String name;
+
+ public GetQuoteResponse() {
+ }
+
+ public GetQuoteResponse(String symbol) {
+ this.symbol = symbol;
+ this.last = getRandom(100, 0.9, true);
+ this.lastTradeTimestamp = new Date().toString();
+ this.change = getRandom(3, 0.5, false);
+ 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, true);
+ this.marketCap = getRandom(10E6, 5.0, false);
+ this.prevClose = getRandom(last, 0.15, false);
+ this.percentageChange = change / prevClose * 100;
+ this.earnings = getRandom(10, 0.4, false);
+ this.peRatio = getRandom(20, 0.30, false);
+ this.name = symbol + " Company";
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public double getLast() {
+ return last;
+ }
+
+ public void setLast(double last) {
+ this.last = last;
+ }
+
+ public String getLastTradeTimestamp() {
+ return lastTradeTimestamp;
+ }
+
+ public void setLastTradeTimestamp(String lastTradeTimestamp) {
+ this.lastTradeTimestamp = lastTradeTimestamp;
+ }
+
+ public double getChange() {
+ return change;
+ }
+
+ public void setChange(double change) {
+ this.change = change;
+ }
+
+ public double getOpen() {
+ return open;
+ }
+
+ public void setOpen(double open) {
+ this.open = open;
+ }
+
+ public double getHigh() {
+ return high;
+ }
+
+ public void setHigh(double high) {
+ this.high = high;
+ }
+
+ public double getLow() {
+ return low;
+ }
+
+ public void setLow(double low) {
+ this.low = low;
+ }
+
+ public int getVolume() {
+ return volume;
+ }
+
+ public void setVolume(int volume) {
+ this.volume = volume;
+ }
+
+ public double getMarketCap() {
+ return marketCap;
+ }
+
+ public void setMarketCap(double marketCap) {
+ this.marketCap = marketCap;
+ }
+
+ public double getPrevClose() {
+ return prevClose;
+ }
+
+ public void setPrevClose(double prevClose) {
+ this.prevClose = prevClose;
+ }
+
+ public double getPercentageChange() {
+ return percentageChange;
+ }
+
+ public void setPercentageChange(double percentageChange) {
+ this.percentageChange = percentageChange;
+ }
+
+ public double getEarnings() {
+ return earnings;
+ }
+
+ public void setEarnings(double earnings) {
+ this.earnings = earnings;
+ }
+
+ public double getPeRatio() {
+ return peRatio;
+ }
+
+ public void setPeRatio(double peRatio) {
+ this.peRatio = peRatio;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ private static double getRandom(double base, double varience, boolean
onlypositive) {
+ double rand = Math.random();
+ return (base + ((rand > 0.5 ? 1 : -1) * varience * base * rand))
+ * (onlypositive ? 1 : (rand > 0.5 ? 1 : -1));
+ }
+
+}
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/PlaceOrder.java
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/PlaceOrder.java?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/PlaceOrder.java
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/src/samples/services/PlaceOrder.java
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,49 @@
+/*
+ * 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 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;
+ }
+}
Added:
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/FastStockQuoteService.wsdl
URL:
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/FastStockQuoteService.wsdl?view=auto&rev=499861
==============================================================================
---
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/FastStockQuoteService.wsdl
(added)
+++
webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/wsdl/FastStockQuoteService.wsdl
Thu Jan 25 09:26:07 2007
@@ -0,0 +1,120 @@
+<!--
+ ~ 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.
+ -->
+
+<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="FastStockQuoteServicePortType">
+ <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="FastStockQuoteServiceSOAP11Binding"
type="axis2:FastStockQuoteServicePortType">
+ <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="FastStockQuoteService">
+ <wsdl:port name="FastStockQuoteServiceSOAP11port"
binding="axis2:FastStockQuoteServiceSOAP11Binding">
+ <soap:address
location="http://localhost:8080/axis2/services/FastStockQuoteService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]