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 2006/07/04 13:20:10 UTC
svn commit: r418980 - in /incubator/synapse/trunk/java:
modules/core/src/org/apache/synapse/config/xml/
modules/core/src/org/apache/synapse/core/axis2/
modules/samples/scripts/userguide/ modules/samples/src/samples/mediation/
modules/samples/src/sample...
Author: asankha
Date: Tue Jul 4 04:20:09 2006
New Revision: 418980
URL: http://svn.apache.org/viewvc?rev=418980&view=rev
Log:
streamline proxy services
all samples are updated to use the invesbot endpoint
Removed:
incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomQuoteXMLHandler.java
incubator/synapse/trunk/java/modules/samples/src/samples/mediation/ProxyStockQuoteClient.java
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteXMLHandler.java
Modified:
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml
incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java
incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomStockQuoteClient.java
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
incubator/synapse/trunk/java/repository/conf/synapse.xml
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java Tue Jul 4 04:20:09 2006
@@ -30,12 +30,12 @@
/**
* Creates a ProxyService instance using the XML fragment specification
*
- * <proxy name="string" type="wsdl|jms|rest" [description="string"]>
- * <endpoint protocols="(http|https|jms)+|all" uri="uri">
- * <target sequence="name" | endpoint="name"/>?
+ * <proxy name="string" [description="string"] [transports="(http|https|jms)+|all"]>
+ * <target sequence="name" | endpoint="name"/>? // default is main sequence
* <wsdl url="url">?
* <schema url="url">*
* <policy url="url">*
+ * <property name="string" value="string"/>*
* </proxy>
*/
public class ProxyServiceFactory {
@@ -58,39 +58,9 @@
proxy.setDescription(desc.getAttributeValue());
}
- // set the type of the proxy service
- OMAttribute type = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "type"));
- if (type != null) {
- String sType = type.getAttributeValue();
- if ("wsdl".equals(sType)) {
- proxy.setType(ProxyService.WSDL_TYPE);
- } else if ("jms".equals(sType)) {
- proxy.setType(ProxyService.JMS_TYPE);
- } else if ("rest".equals(sType)) {
- proxy.setType(ProxyService.REST_TYPE);
- } else {
- handleException("Unknown proxy type : " + sType);
- }
- } else {
- handleException("The 'type' is a required for proxy service : " + proxy.getName());
- }
-
- // read endpoint definition and set it to the proxy service
- OMElement endpt = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "endpoint"));
- if (endpt == null) {
- handleException("The proxy services endpoint definition is missing for " + proxy.getName());
- } else {
- // read endpoint protocol
- OMAttribute proto = endpt.getAttribute(new QName(Constants.NULL_NAMESPACE, "protocol"));
- if (proto != null) {
- proxy.setEndpointProtocols(proto.getAttributeValue());
- }
-
- // read endpoint uri where the service will be made available
- OMAttribute uri = endpt.getAttribute(new QName(Constants.NULL_NAMESPACE, "uri"));
- if (uri != null) {
- proxy.setEndpointURI(uri.getAttributeValue());
- }
+ OMAttribute trans = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "transports"));
+ if (trans != null) {
+ proxy.setTransports(trans.getAttributeValue());
}
// read definition of the target of this proxy service. The target could be an 'endpoint'
@@ -110,10 +80,7 @@
// read the WSDL, Schemas and Policies and set to the proxy service
OMElement wsdl = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "wsdl"));
- if (wsdl == null && proxy.getType() == ProxyService.WSDL_TYPE) {
- handleException("A WSDL URL is required for a WSDL based proxy service");
-
- } else if (proxy.getType() == ProxyService.WSDL_TYPE) {
+ if (wsdl != null) {
OMAttribute wsdlurl = wsdl.getAttribute(new QName(Constants.NULL_NAMESPACE, "url"));
if (wsdlurl == null) {
handleException("The 'url' attribute is required for the base WSDL definition");
@@ -125,12 +92,6 @@
handleException("Invalid WSDL URL : " + wUrl, e);
}
}
- } else if (proxy.getType() == ProxyService.JMS_TYPE) {
- // TODO
- throw new UnsupportedOperationException("JMS Proxy services are not yet implemented");
- } else if (proxy.getType() == ProxyService.REST_TYPE) {
- // TODO
- throw new UnsupportedOperationException("REST Proxy services are not yet implemented");
}
//OMElement schema = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "schema"));
@@ -151,6 +112,23 @@
}
} else {
handleException("Invalid 'policy' element found under element 'policies'");
+ }
+ }
+
+ Iterator props = elem.getChildrenWithName(new QName(Constants.SYNAPSE_NAMESPACE, "property"));
+ while (props.hasNext()) {
+ Object o = props.next();
+ if (o instanceof OMElement) {
+ OMElement prop = (OMElement) o;
+ OMAttribute pname = prop.getAttribute(new QName(Constants.NULL_NAMESPACE, "name"));
+ OMAttribute value = prop.getAttribute(new QName(Constants.NULL_NAMESPACE, "value"));
+ if (name != null && value != null) {
+ proxy.addProperty(pname.getAttributeValue(), value.getAttributeValue());
+ } else {
+ handleException("Invalid property specified for proxy service : " + name);
+ }
+ } else {
+ handleException("Invalid property specified for proxy service : " + name);
}
}
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java Tue Jul 4 04:20:09 2006
@@ -15,10 +15,9 @@
*/
package org.apache.synapse.core.axis2;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.PolicyInclude;
+import org.apache.axis2.description.*;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.transport.njms.JMSConstants;
import org.apache.synapse.SynapseException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -28,138 +27,148 @@
import java.net.URL;
import java.io.IOException;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import java.util.List;
-import java.util.ArrayList;
+import java.util.*;
/**
- * <proxy name="string" type="wsdl|jms|rest" [description="string"]>
- * <endpoint protocols="(http|https|jms)+|all" uri="uri">
- * <target sequence="name" | endpoint="name"/>?
+ * <proxy name="string" [description="string"] [transports="(http|https|jms)+|all"]>
+ * <target sequence="name" | endpoint="name"/>? // default is main sequence
* <wsdl url="url">?
* <schema url="url">*
* <policy url="url">*
+ * <property name="string" value="string"/>*
* </proxy>
*/
public class ProxyService {
private static final Log log = LogFactory.getLog(ProxyService.class);
-
- public static final int WSDL_TYPE = 1;
- public static final int JMS_TYPE = 2;
- public static final int REST_TYPE = 3;
-
- public static final String PROTO_ALL = "all";
-
+ /** The proxy service name */
private String name;
- private int type = WSDL_TYPE; // default
+ /** The proxy service description */
private String description;
-
- /** The endpoint protocols the proxy service should be available on. This should contain the
- * value 'all' to enable this service on all available transports (i.e. default) or should
- * specify a comma seperated list of Axis2 transports
- */
- private String endpointProtocols = PROTO_ALL; // default
- /** The endpoint URI where the proxy service should be available on */
- private String endpointURI = null;
-
+ /** The transport/s over which this service should be exposed */
+ private String transports;
/** The target endpoint, if assigned */
private String targetEndpoint = null;
/** The target sequence, if assigned */
private String targetSequence = null;
- // if a target endpoint or sequence is not specified, the default Synapse main mediator will be used
+ // if a target endpoint or sequence is not specified,
+ // the default Synapse main mediator will be used
+ /** A list properties */
+ private Map properties = new HashMap();
- /** The URL for the base WSDL */
+ /** The URL for the base WSDL, if specified */
private URL wsdl;
/** The URLs for any supplied schemas */
private URL[] schemas;
/** The URLs for any supplied policies that would apply at the service level */
private List serviceLevelPolicies = new ArrayList();
+ public static final String ALL_TRANSPORTS = "all";
+
public ProxyService() {}
public AxisService buildAxisService() {
- if (type == ProxyService.WSDL_TYPE) {
- try {
- if (wsdl == null) {
- handleException("A WSDL URL is required for a WSDL based proxy service");
- } else if (name == null) {
- handleException("A name is required for a proxy service");
- } else if (endpointURI == null) {
- handleException("The endpoint URI for the proxy service has not been specified");
- } else {
-
- WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
- new WSDL11ToAxisServiceBuilder(wsdl.openStream(), null, null);
- AxisService proxyService = wsdl2AxisServiceBuilder.populateService();
- proxyService.setWsdlfound(true);
-
- // Set the name and description. Currently Axis2 uses the name as the Service name/URI
- proxyService.setName(name);
- proxyService.setServiceDescription(description);
-
- // TODO
- // Axis still does not allow us to set a pre-defined URL for a deployed service
- // proxyService.setEndpointURI(endpointURI);
-
- // set exposed transports http|https|jms|all.. etc
- if (!PROTO_ALL.equals(endpointProtocols)) {
- StringTokenizer st = new StringTokenizer(endpointProtocols, ",");
- String[] transposrts = new String[st.countTokens()];
- for (int i=0; i<transposrts.length; i++) {
- transposrts[i] = st.nextToken();
- }
- proxyService.setExposeTransports(transposrts);
- }
- // if service level policies are specified, apply them
- if (!serviceLevelPolicies.isEmpty()) {
- PolicyReader reader = PolicyFactory.getPolicyReader(PolicyFactory.OM_POLICY_READER);
- Policy svcEffectivePolicy = null;
-
- Iterator iter = serviceLevelPolicies.iterator();
- while (iter.hasNext()) {
- URL policyUrl = (URL) iter.next();
- if (svcEffectivePolicy == null) {
- svcEffectivePolicy = reader.readPolicy(policyUrl.openStream());
- } else {
- svcEffectivePolicy.merge(reader.readPolicy(policyUrl.openStream()));
- }
- }
-
- PolicyInclude policyInclude = new PolicyInclude();
- policyInclude.addPolicyElement(PolicyInclude.SERVICE_POLICY, svcEffectivePolicy);
- proxyService.setPolicyInclude(policyInclude);
- }
+ AxisService proxyService = null;
+ if (wsdl != null) {
+ try {
+ WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder =
+ new WSDL11ToAxisServiceBuilder(wsdl.openStream(), null, null);
+ proxyService = wsdl2AxisServiceBuilder.populateService();
+ proxyService.setWsdlfound(true);
+ } catch (AxisFault af) {
+ handleException("Error building service from WSDL at : " + wsdl, af);
+ } catch (IOException ioe) {
+ handleException("Error reading WSDL from URL : " + wsdl, ioe);
+ }
+ } else {
+ proxyService = new AxisService();
+ }
- // create a custom message receiver for this proxy service to use a given named
- // endpoint or sequence for forwarding/message mediation
- ProxyServiceMessageReceiver msgRcvr = new ProxyServiceMessageReceiver();
- msgRcvr.setName(name);
- if (targetEndpoint != null) {
- msgRcvr.setTargetEndpoint(targetEndpoint);
- } else if (targetSequence != null) {
- msgRcvr.setTargetSequence(targetSequence);
- }
+ // Set the name and description. Currently Axis2 uses the name as the
+ // default Service destination
+ proxyService.setName(name);
+ if (description != null) {
+ proxyService.setServiceDescription(description);
+ }
- Iterator iter = proxyService.getOperations();
- while (iter.hasNext()) {
- AxisOperation op = (AxisOperation) iter.next();
- op.setMessageReceiver(msgRcvr);
- }
+ // process transports and expose over requested transports. If none
+ // is specified, default to all transports using service name as
+ // destination
+ if (transports == null || ALL_TRANSPORTS.equals(transports)) {
+ // default to all transports using service name as destination
+ } else {
+ StringTokenizer st = new StringTokenizer(transports, ", ");
+ String[] transports = new String[st.countTokens()];
+ for (int i=0; i<transports.length; i++) {
+ transports[i] = st.nextToken();
+ }
+ proxyService.setExposeTransports(transports);
+ }
- return proxyService;
+ // process parameters
+ Iterator iter = properties.keySet().iterator();
+ while (iter.hasNext()) {
+ String name = (String) iter.next();
+ String value = (String) properties.get(name);
+ if (JMSConstants.CONFAC_PARAM.equals(name) ||
+ JMSConstants.DEST_PARAM.equals(name)) {
+
+ Parameter p = new Parameter();
+ p.setName(name);
+ p.setValue(value);
+
+ try {
+ proxyService.addParameter(p);
+ } catch (AxisFault af) {
+ handleException("Error setting property : " + name + "" +
+ "to proxy service as a Parameter", af);
}
+ }
+ }
+
+ // if service level policies are specified, apply them
+ if (!serviceLevelPolicies.isEmpty()) {
+ PolicyReader reader = PolicyFactory.getPolicyReader(PolicyFactory.OM_POLICY_READER);
+ Policy svcEffectivePolicy = null;
- } catch (IOException e) {
- handleException("Error opening input stream to WSDL at URL : " + wsdl, e);
+ URL policyUrl = null;
+ try {
+ iter = serviceLevelPolicies.iterator();
+ while (iter.hasNext()) {
+ policyUrl = (URL) iter.next();
+ if (svcEffectivePolicy == null) {
+ svcEffectivePolicy = reader.readPolicy(policyUrl.openStream());
+ } else {
+ svcEffectivePolicy.merge(reader.readPolicy(policyUrl.openStream()));
+ }
+ }
+ } catch (IOException ioe) {
+ handleException("Error reading policy from URL : " + policyUrl, ioe);
}
- } else {
- // TODO
- throw new UnsupportedOperationException("Only WSDL Proxy services are supported");
+
+ PolicyInclude policyInclude = new PolicyInclude();
+ policyInclude.addPolicyElement(PolicyInclude.SERVICE_POLICY, svcEffectivePolicy);
+ proxyService.setPolicyInclude(policyInclude);
+ }
+
+ // create a custom message receiver for this proxy service to use a given named
+ // endpoint or sequence for forwarding/message mediation
+ ProxyServiceMessageReceiver msgRcvr = new ProxyServiceMessageReceiver();
+ msgRcvr.setName(name);
+ if (targetEndpoint != null) {
+ msgRcvr.setTargetEndpoint(targetEndpoint);
+ } else if (targetSequence != null) {
+ msgRcvr.setTargetSequence(targetSequence);
}
- return null;
+
+ iter = proxyService.getOperations();
+ while (iter.hasNext()) {
+ AxisOperation op = (AxisOperation) iter.next();
+ op.setMessageReceiver(msgRcvr);
+ }
+
+ return proxyService;
}
public String getName() {
@@ -170,14 +179,6 @@
this.name = name;
}
- public int getType() {
- return type;
- }
-
- public void setType(int type) {
- this.type = type;
- }
-
public String getDescription() {
return description;
}
@@ -186,20 +187,16 @@
this.description = description;
}
- public String getEndpointProtocols() {
- return endpointProtocols;
- }
-
- public void setEndpointProtocols(String endpointProtocols) {
- this.endpointProtocols = endpointProtocols;
+ public String getTransports() {
+ return transports;
}
- public String getEndpointURI() {
- return endpointURI;
+ public void addProperty(String name, String value) {
+ properties.put(name, value);
}
- public void setEndpointURI(String endpointURI) {
- this.endpointURI = endpointURI;
+ public void setTransports(String transports) {
+ this.transports = transports;
}
public String getTargetEndpoint() {
Modified: incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml (original)
+++ incubator/synapse/trunk/java/modules/samples/scripts/userguide/build.xml Tue Jul 4 04:20:09 2006
@@ -14,53 +14,56 @@
ant compile
build the samples
- These samples make stock quotes to www.webservicex.net or ws.invesbot.com mediated by Synapse
+ These samples make stockquote requests to ws.invesbot.com mediated through Synapse
ant stockquote
Use the smart client - Synapse in WS-Addressing router mode
examples:
ant stockquote
- ant stockquote -Dsymbol=IBM -Durl=http://www.webservicex.net/stockquote.asmx -Dsynapseurl=http://localhost
- -Drepository=client_repo"
+ ant stockquote [-Dsymbol=IBM] [-Durl=http://ws.invesbot.com/stockquotes.asmx]
+ [-Dsynapseurl=http://localhost:8080] [-Drepository=client_repo]
ant proxystockquote
- Use the http proxy client - Synapse in "transparent mode"
+ Use the http proxy client - Synapse in "transparent mode" using HTTP proxy
examples:
ant proxystockquote
- ant proxystockquote -Dsymbol=IBM -Durl=http://www.webservicex.net/stockquote.asmx -Dsynapseurl=http://localhost
- -Drepository=client_repo"
+ ant proxystockquote [-Dsymbol=IBM] [-Durl=http://ws.invesbot.com/stockquotes.asmx]
+ [-Dsynapseurl=http://localhost:8080]
ant dumbstockquote
- Use the dumb soap client - Synapse in "gateway" mode
+ Use the dumb soap client - Synapse in "gateway" mode, and transport set to virtual
+ url interpreted by Synapse
examples:
ant dumbstockquote
- ant dumbstockquote [-Dsymbol=IBM] [-Durl=http://www.webservicex.net/stockquote.asmx]
+ ant dumbstockquote [-Dsymbol=IBM] [-Dgatewayurl=http://localhost:8080/StockQuote]
ant customquote
- Use custom stock quote request
+ Use custom stock quote request and transform (XSLT) between schemas
examples:
ant customquote
- ant customquote [-Dsymbol=IBM] [-Dinvestbot_url=http://ws.invesbot.com/stockquotes.asmx] [-Dgatewayurl=http://localhost:8080/StockQuote]
+ ant customquote [-Dsymbol=IBM] [-Durl=http://ws.invesbot.com/stockquotes.asmx]
+ [-Dsynapseurl=http://localhost:8080]
ant advancedquote
- Use validating custom quote requests
+ Use validating custom quote requests, and also validate against XSD
examples:
ant advancedquote
- ant advancedquote [-Dinvestbot_url=http://ws.invesbot.com/stockquotes.asmx] [-Dgatewayurl=http://localhost:8080/StockQuote]
- ant advancedquote [-Dinvestbot_url=http://ws.invesbot.com/stockquotes.asmx] [-Dgatewayurl=http://localhost:8080/StockQuote]
- ant advancedquote [-Dinvestbot_url=http://ws.invesbot.com/stockquotes.asmx] [-Dgatewayurl=http://localhost:8080/StockQuote]
+ ant advancedquote [-Durl=http://ws.invesbot.com/stockquotes.asmx]
+ [-Dsynapseurl=http://localhost:8080]
ant simplequote
Use a simple quote using WS-A addressing to demonstrate the Custom server (programmatic configuration creation)
examples:
ant simplequote
- ant simplequote [-Dsymbol=IBM] [-Dinvestbot_url=http://ws.invesbot.com/stockquotes.asmx] [-Dgatewayurl=http://localhost:8080/StockQuote] [-Drepository=client_repo]
+ ant simplequote [-Dsymbol=IBM]
+ [-Durl=http://ws.invesbot.com/stockquotes.asmx]
+ [-Dsynapseurl=http://localhost:8080] [-Drepository=client_repo]
ant proxyquote
Use Proxy services to query stock prices. (Must be used with the sample configuration # 3)
@@ -75,8 +78,7 @@
</target>
<property name="symbol" value="IBM"/>
- <property name="webservicex_url" value="http://www.webservicex.net/stockquote.asmx"/>
- <property name="investbot_url" value="http://ws.invesbot.com/stockquotes.asmx"/>
+ <property name="url" value="http://ws.invesbot.com/stockquotes.asmx"/>
<property name="synapseurl" value="http://localhost:8080"/>
<property name="gatewayurl" value="http://localhost:8080/StockQuote"/>
<property name="repository" value="client_repo"/>
@@ -101,7 +103,7 @@
<java classname="samples.userguide.StockQuoteClient"
classpathref="javac.classpath" fork="true">
<arg value="${symbol}"/>
- <arg value="${webservicex_url}"/>
+ <arg value="${url}"/>
<arg value="${synapseurl}"/>
<arg value="${repository}"/>
</java>
@@ -111,9 +113,8 @@
<java classname="samples.userguide.ProxyStockQuoteClient"
classpathref="javac.classpath" fork="true">
<arg value="${symbol}"/>
- <arg value="${webservicex_url}"/>
+ <arg value="${url}"/>
<arg value="${synapseurl}"/>
- <arg value="${repository}"/>
</java>
</target>
@@ -122,7 +123,6 @@
classpathref="javac.classpath" fork="true">
<arg value="${symbol}"/>
<arg value="${gatewayurl}"/>
- <arg value="${repository}"/>
</java>
</target>
@@ -130,16 +130,16 @@
<java classname="samples.mediation.CustomStockQuoteClient"
classpathref="javac.classpath" fork="true">
<arg value="${symbol}"/>
- <arg value="${investbot_url}"/>
- <arg value="${gatewayurl}"/>
+ <arg value="${url}"/>
+ <arg value="${synapseurl}"/>
</java>
</target>
<target name="advancedquote" depends="compile">
<java classname="samples.mediation.AdvancedQuoteClient"
classpathref="javac.classpath" fork="true">
- <arg value="${investbot_url}"/>
- <arg value="${gatewayurl}"/>
+ <arg value="${url}"/>
+ <arg value="${synapseurl}"/>
</java>
</target>
@@ -147,8 +147,8 @@
<java classname="samples.config.SimpleStockQuoteClient"
classpathref="javac.classpath" fork="true">
<arg value="${symbol}"/>
- <arg value="${investbot_url}"/>
- <arg value="${gatewayurl}"/>
+ <arg value="${url}"/>
+ <arg value="${synapseurl}"/>
<arg value="${repository}"/>
</java>
</target>
Modified: incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java (original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java Tue Jul 4 04:20:09 2006
@@ -21,84 +21,22 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.AxisFault;
+import samples.common.Util;
public class AdvancedQuoteClient {
public static void main(String[] args) {
- String xurl = "http://ws.invesbot.com/stockquotes.asmx";
- String turl = "http://localhost:8080/StockQuote";
+ String xurl = "http://ws.invesbot.com/stockquotes.asmx";
+ String turl = "http://localhost:8080/StockQuote";
+ String sAction = "http://ws.invesbot.com/GetQuote";
if (args.length > 0) xurl = args[0];
if (args.length > 1) turl = args[1];
- testStandardQuote("IBM", xurl, turl);
- testAdvancedQuote("SUN", xurl, turl);
- testErroneousQuote("MSFT", xurl, turl);
- }
-
- private static void testAdvancedQuote(String symbol, String xurl, String turl) {
- try {
- OMElement getQuote = CustomQuoteXMLHandler.createCustomRequestPayload(symbol);
-
- Options options = new Options();
- options.setTo(new EndpointReference(xurl));
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setAction("http://ws.invesbot.com/GetQuote");
-
- ServiceClient serviceClient = new ServiceClient();
- serviceClient.setOptions(options);
-
- OMElement result = serviceClient.sendReceive(getQuote);
- System.out.println("Custom :: Stock price = $" + CustomQuoteXMLHandler.parseCustomResponsePayload(result.getFirstElement()));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private static void testErroneousQuote(String symbol, String xurl, String turl) {
- try {
- OMElement getQuote = CustomQuoteXMLHandler.createErroneousRequestPayload(symbol);
-
- Options options = new Options();
- options.setTo(new EndpointReference(xurl));
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setAction("http://ws.invesbot.com/GetQuote");
-
- ServiceClient serviceClient = new ServiceClient();
- serviceClient.setOptions(options);
-
- OMElement result = serviceClient.sendReceive(getQuote);
- System.out.println("Error :: Stock price = $" + CustomQuoteXMLHandler.parseCustomResponsePayload(result.getFirstElement()));
-
- } catch (Exception e) {
- if (e instanceof AxisFault) {
- System.out.println("Fault : " + ((AxisFault)e).getFaultElements());
- } else {
- e.printStackTrace();
- }
- }
- }
-
- private static void testStandardQuote(String symbol, String xurl, String turl) {
- try {
- OMElement getQuote = CustomQuoteXMLHandler.createStandardRequestPayload(symbol);
-
- Options options = new Options();
- options.setTo(new EndpointReference(xurl));
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setAction("http://ws.invesbot.com/GetQuote");
-
- ServiceClient serviceClient = new ServiceClient();
- serviceClient.setOptions(options);
-
- OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
- System.out.println("Standard :: Stock price = $" + CustomQuoteXMLHandler.parseStandardResponsePayload(result));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
+ Util.testStandardQuote("IBM", sAction, xurl, turl);
+ Util.testAdvancedQuote("SUN", sAction, xurl, turl);
+ Util.testErroneousQuote("MSFT", sAction, xurl, turl);
}
}
Modified: incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomStockQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomStockQuoteClient.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomStockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/mediation/CustomStockQuoteClient.java Tue Jul 4 04:20:09 2006
@@ -20,6 +20,7 @@
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.MessageContextConstants;
import org.apache.axiom.om.OMElement;
+import samples.common.Util;
public class CustomStockQuoteClient {
@@ -27,54 +28,14 @@
String symbol = "IBM";
String xurl = "http://ws.invesbot.com/stockquotes.asmx";
- String turl = "http://localhost:8080/StockQuote";
+ String turl = "http://localhost:8080";
+ String sAction= "http://ws.invesbot.com/GetQuote";
if (args.length > 0) symbol = args[0];
if (args.length > 1) xurl = args[1];
if (args.length > 2) turl = args[2];
- testStandardQuote(symbol, xurl, turl);
- testCustomQuote(symbol, xurl, turl);
+ Util.testStandardQuote(symbol, sAction, xurl, turl);
+ Util.testCustomQuote(symbol, sAction, xurl, turl);
}
-
- private static void testCustomQuote(String symbol, String xurl, String turl) {
- try {
- OMElement getQuote = CustomQuoteXMLHandler.createCustomRequestPayload(symbol);
-
- Options options = new Options();
- options.setTo(new EndpointReference(xurl));
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setAction("http://ws.invesbot.com/GetQuote");
-
- ServiceClient serviceClient = new ServiceClient();
- serviceClient.setOptions(options);
-
- OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
- System.out.println("Custom :: Stock price = $" + CustomQuoteXMLHandler.parseCustomResponsePayload(result));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private static void testStandardQuote(String symbol, String xurl, String turl) {
- try {
- OMElement getQuote = CustomQuoteXMLHandler.createStandardRequestPayload(symbol);
-
- Options options = new Options();
- options.setTo(new EndpointReference(xurl));
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setAction("http://ws.invesbot.com/GetQuote");
-
- ServiceClient serviceClient = new ServiceClient();
- serviceClient.setOptions(options);
-
- OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
- System.out.println("Standard :: Stock price = $" + CustomQuoteXMLHandler.parseStandardResponsePayload(result));
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
}
Modified: incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/userguide/DumbStockQuoteClient.java Tue Jul 4 04:20:09 2006
@@ -1,86 +1,60 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
package samples.userguide;
-
-
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.addressing.EndpointReference;
-
+import org.apache.axiom.om.OMElement;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
-import org.apache.axiom.om.OMElement;
+import org.apache.axis2.context.MessageContextConstants;
+import samples.common.InvesbotHandler;
+/**
+ * A simple example showing a dumb client.. the client just sets the transport
+ * to a Synapse server, which will determine and use the correct EPR for the
+ * message and send out.
+ */
public class DumbStockQuoteClient {
- /**
- * <p/>
- * This is a fairly static test client for Synapse. It makes a StockQuote
- * request to XMethods stockquote service. There is no EPR and there is no
- * proxy config. It's sort of a Gateway case. It relies on a Synapse config
- * that will look at the URL or message and send it to the right place
- */
public static void main(String[] args) {
- if (args.length > 0 && args[0].substring(0, 1).equals("-")) {
- System.out
- .println("This client demonstrates Synapse as a gateway\n"
- + "Usage: DumbStockQuoteClient Symbol SynapseURL");
- System.out
- .println(
- "\nDefault values: IBM http://localhost:8080/StockQuote"
- +
- "\nAll examples depend on using the sample synapse.xml");
- System.exit(0);
- }
+ String symbol = "IBM";
+ String turl = "http://localhost:8080/StockQuote";
+ String sAction = "http://ws.invesbot.com/GetQuote";
- String symb = "IBM";
- String url = "http://localhost:8080/StockQuote";
+ if (args.length > 0) symbol = args[0];
+ if (args.length > 1) turl = args[1];
- if (args.length > 0)
- symb = args[0];
- if (args.length > 1)
- url = args[1];
- boolean repository = false;
- if (args.length > 2) repository = true;
try {
- ServiceClient serviceClient;
- if (repository) {
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[2],null);
- serviceClient = new ServiceClient(configContext, null);
- } else {
- serviceClient = new ServiceClient();
- }
-
- // step 1 - create a request payload
- OMElement getQuote = StockQuoteXMLHandler
- .createRequestPayload(symb);
-
- // step 2 - set up the call object
-
- // the wsa:To
- EndpointReference targetEPR = new EndpointReference(url);
+ OMElement getQuote = InvesbotHandler.createStandardRequestPayload(symbol);
Options options = new Options();
- options.setTo(targetEPR);
+ if (turl != null)
+ options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
+ options.setAction(sAction);
- options.setAction("http://www.webserviceX.NET/GetQuote");
-
+ ServiceClient serviceClient = new ServiceClient();
serviceClient.setOptions(options);
- // step 3 - Blocking invocation
- OMElement result = serviceClient.sendReceive(getQuote);
- // System.out.println(result);
-
- // step 4 - parse result
- System.out.println("Stock price = $"
- + StockQuoteXMLHandler.parseResponse(result));
+ OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
+ System.out.println("Standard :: Stock price = $" +
+ InvesbotHandler.parseStandardResponsePayload(result));
} catch (Exception e) {
e.printStackTrace();
}
-
}
}
Modified: incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/userguide/ProxyStockQuoteClient.java Tue Jul 4 04:20:09 2006
@@ -5,12 +5,16 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContextConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.axiom.om.OMElement;
+import samples.common.InvesbotHandler;
+
+import javax.xml.namespace.QName;
public class ProxyStockQuoteClient {
@@ -26,97 +30,47 @@
*/
public static void main(String[] args) {
- if (args.length > 0 && args[0].substring(0, 1).equals("-")) {
- System.out
- .println("This client demonstrates Synapse as a proxy\n"
- +
- "Usage: ProxyStockQuoteClient Symbol StockQuoteURL ProxyURL");
- System.out
- .println(
- "\nDefault values: IBM http://www.webservicex.net/stockquote.asmx http://localhost:8080");
- System.out
- .println(
- "\nThe XMethods URL will be used in the <wsa:To> header");
- System.out.println("The Proxy URL will be used as an HTTP proxy");
- System.out
- .println(
- "\nTo demonstrate Synapse virtual URLs, set the URL to http://stockquote\n"
- +
- "\nTo demonstrate content-based behaviour, set the Symbol to MSFT\n"
- +
- "\nAll examples depend on using the sample synapse.xml");
- System.exit(0);
- }
-
- String symb = "IBM";
- String xurl = "http://www.webservicex.net/stockquote.asmx";
- String purl = "http://localhost:8080";
-
- if (args.length > 0)
- symb = args[0];
- if (args.length > 1)
- xurl = args[1];
- if (args.length > 2)
- purl = args[2];
-
- boolean repository = false;
- if (args.length > 3) repository = true;
+ String symbol = "IBM";
+ String xurl = "http://ws.invesbot.com/stockquotes.asmx";
+ String purl = "http://localhost:8080";
+ String sAction= "http://ws.invesbot.com/GetQuote";
+
+ if (args.length > 0) symbol = args[0];
+ if (args.length > 1) xurl = args[1];
+ if (args.length > 2) purl = args[2];
try {
- ServiceClient serviceClient;
- if (repository) {
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[3],null);
- serviceClient = new ServiceClient(configContext, null);
- } else {
- serviceClient = new ServiceClient();
- }
-
- // step 1 - create a request payload
- OMElement getQuote = StockQuoteXMLHandler
- .createRequestPayload(symb);
-
- // step 2 - set up the call object
-
- // the wsa:To
- EndpointReference targetEPR = new EndpointReference(xurl);
+ OMElement getQuote = InvesbotHandler.createStandardRequestPayload(symbol);
Options options = new Options();
- options.setTo(targetEPR);
+ if (xurl != null)
+ options.setTo(new EndpointReference(xurl));
+ options.setAction(sAction);
- URL url = new URL(purl);
+ ServiceClient serviceClient = new ServiceClient();
// engage HTTP Proxy
-
HttpTransportProperties httpProps = new HttpTransportProperties();
HttpTransportProperties.ProxyProperties proxyProperties =
- httpProps.new ProxyProperties();
+ httpProps.new ProxyProperties();
+ URL url = new URL(purl);
proxyProperties.setProxyName(url.getHost());
proxyProperties.setProxyPort(url.getPort());
proxyProperties.setUserName("");
proxyProperties.setPassWord("");
proxyProperties.setDomain("");
-
options.setProperty(HTTPConstants.PROXY, proxyProperties);
- options.setAction("http://www.webserviceX.NET/GetQuote");
-
serviceClient.setOptions(options);
- // step 3 - Blocking invocation
- OMElement result = serviceClient.sendReceive(getQuote);
- // System.out.println(result);
-
- // step 4 - parse result
-
- System.out.println("Stock price = $"
- + StockQuoteXMLHandler.parseResponse(result));
+ OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
+ System.out.println("Standard :: Stock price = $" +
+ InvesbotHandler.parseStandardResponsePayload(result));
} catch (Exception e) {
e.printStackTrace();
}
-
}
}
Modified: incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/modules/samples/src/samples/userguide/StockQuoteClient.java Tue Jul 4 04:20:09 2006
@@ -1,108 +1,62 @@
package samples.userguide;
+import org.apache.axiom.om.OMElement;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.MessageContextConstants;
-import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axiom.om.OMElement;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContextConstants;
import javax.xml.namespace.QName;
+import samples.common.InvesbotHandler;
+/**
+ * The EPR to the actual service is set, but the transport is set to
+ * the Synapse url.
+ */
public class StockQuoteClient {
- /**
- * @param args <p/>
- * This is a fairly static test client for Synapse. It makes a
- * StockQuote request to WebServiceX stockquote service. The EPR
- * it is sent to is for WebServiceX, but the actual transport URL
- * is designed to go to the Synapse listener.
- */
public static void main(String[] args) {
- if (args.length > 0 && args[0].substring(0, 1).equals("-")) {
- System.out
- .println(
- "Usage: StockQuoteClient Symbol StockQuoteURL TransportURL");
- System.out
- .println(
- "\nDefault values: IBM http://www.webservicex.net/stockquote.asmx http://localhost:8080");
- System.out
- .println(
- "\nThe XMethods URL will be used in the <wsa:To> header");
- System.out
- .println(
- "The Transport URL will be used as the actual address to send to");
- System.out
- .println(
- "\nTo bypass Synapse, set the transport URL to the WebServiceX URL: \n"
- +
- "e.g. StockQuoteClient IBM http://www.webservicex.net/stockquote.asmx http://www.webservicex.net/stockquote.asmx \n"
- +
- "\nTo demonstrate Synapse virtual URLs, set the URL to http://stockquote\n"
- +
- "\nTo demonstrate content-based behaviour, set the Symbol to MSFT\n"
- +
- "\nAll examples depend on using the sample synapse.xml");
- System.exit(0);
- }
-
- String symb = "IBM";
- String xurl = "http://www.webservicex.net/stockquote.asmx";
- String turl = "http://localhost:8080";
-
-
- if (args.length > 0)
- symb = args[0];
- if (args.length > 1)
- xurl = args[1];
- if (args.length > 2)
- turl = args[2];
-
- boolean repository = false;
- if (args.length > 3) repository = true;
+ String symbol = "IBM";
+ String xurl = "http://ws.invesbot.com/stockquotes.asmx";
+ String turl = "http://localhost:8080";
+ String sAction = "http://ws.invesbot.com/GetQuote";
+ String repo = "client_repo";
+
+ if (args.length > 0) symbol = args[0];
+ if (args.length > 1) xurl = args[1];
+ if (args.length > 2) turl = args[2];
+ if (args.length > 3) repo = args[3];
try {
- // step 1 - create a request payload
- OMElement getQuote = StockQuoteXMLHandler
- .createRequestPayload(symb);
-
+ OMElement getQuote = InvesbotHandler.createStandardRequestPayload(symbol);
- ServiceClient serviceClient;
- if (repository) {
+ Options options = new Options();
+ if (xurl != null)
+ options.setTo(new EndpointReference(xurl));
+ if (turl != null)
+ options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
+ options.setAction(sAction);
+ ServiceClient serviceClient = null;
+ if (repo != null) {
ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(args[3],null);
+ ConfigurationContextFactory.
+ createConfigurationContextFromFileSystem(repo, null);
serviceClient = new ServiceClient(configContext, null);
} else {
serviceClient = new ServiceClient();
}
-
- Options options = new Options();
- EndpointReference targetEPR = new EndpointReference(xurl);
- options.setTo(targetEPR);
-
- // step 2 - set up the call object
- // the wsa:To
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
-
- options.setAction("http://www.webserviceX.NET/GetQuote");
-
- //options.setSoapAction("http://www.webserviceX.NET/GetQuote");
-
- //Engage Addressing on outgoing message.
serviceClient.engageModule(new QName("addressing"));
-
- serviceClient.setOptions(options);
- // step 3 - Blocking invocation
- OMElement result = serviceClient.sendReceive(getQuote);
- // System.out.println(result);
serviceClient.setOptions(options);
- // step 4 - parse result
- System.out.println("Stock price = $"
- + StockQuoteXMLHandler.parseResponse(result));
+
+ OMElement result = serviceClient.sendReceive(getQuote).getFirstElement();
+ System.out.println("Standard :: Stock price = $" +
+ InvesbotHandler.parseStandardResponsePayload(result));
+
} catch (Exception e) {
e.printStackTrace();
}
Modified: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_0.xml Tue Jul 4 04:20:09 2006
@@ -4,10 +4,10 @@
<sequence name="stockquote">
<!-- set the To address to the real endpoint -->
- <header name="To" value="http://www.webservicex.net/stockquote.asmx"/>
+ <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
<!-- check if the symbol is MSFT -->
- <filter xpath="//*[wsx:symbol='MSFT']" xmlns:wsx="http://www.webserviceX.NET/">
+ <filter xpath="//*[wsx:symbol='MSFT']" xmlns:wsx="http://ws.invesbot.com/">
<!-- if it is throw a fault -->
<makefault>
<code value="tns:Receiver" xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
@@ -28,7 +28,7 @@
</filter>
<!-- check if the URL matches the virtual url - either the proxy or ws-add case -->
- <filter source="get-property('To')" regex="http://stockquote.*">
+ <filter source="get-property('To')" regex="http://.*stockquotes.*">
<sequence ref="stockquote"/>
</filter>
Modified: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml Tue Jul 4 04:20:09 2006
@@ -17,6 +17,7 @@
</definitions>
<proxies>
+ <!--
<proxy name="InvesbotSequenceProxy" type="wsdl" description="This uses the stockquote named sequence for mediation">
<endpoint protocol="http" uri="/MyfirstProxy"/>
<target sequence="stockquote"/>
@@ -33,6 +34,14 @@
<proxy name="InvesbotDefaultProxy" type="wsdl" description="This simply forwards all messages to the investbot endpoint">
<endpoint protocol="http" uri="/MyfirstProxy"/>
<wsdl url="file:synapse_repository/conf/sample/sample_proxy_1.wsdl"/>
+ </proxy>
+-->
+ <proxy name="JMSInvesbotSequenceProxy" transports="jms" description="This uses the stockquote named sequence for mediation">
+ <target sequence="stockquote"/>
+ <!--<wsdl url="file:synapse_repository/conf/sample/sample_proxy_1.wsdl"/>
+ <policy url="file:synapse_repository/conf/sample/sample_policy_1.xml"/>-->
+ <parameter name="transport.jms.ConnectionFactory" locked="true">myTopicConnectionFactory</parameter>
+ <parameter name="transport.jms.Destination" locked="true">dynamicTopics/something.TestTopic</parameter>
</proxy>
</proxies>
Modified: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_4.xml Tue Jul 4 04:20:09 2006
@@ -3,6 +3,9 @@
<definitions>
<endpoint name="WsSecurity10_scenario_1" useWSA="true" useWSSec="true" useWSRM="false" address="http://localhost:9090/ssj/pingservice/Ping1">
+ <enableRM/> alias for
+ <wsrmp:RMAssertion optional="true"/>
+
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken</items>
Modified: incubator/synapse/trunk/java/repository/conf/synapse.xml
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/synapse.xml?rev=418980&r1=418979&r2=418980&view=diff
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/synapse.xml (original)
+++ incubator/synapse/trunk/java/repository/conf/synapse.xml Tue Jul 4 04:20:09 2006
@@ -4,10 +4,10 @@
<sequence name="stockquote">
<!-- set the To address to the real endpoint -->
- <header name="To" value="http://www.webservicex.net/stockquote.asmx"/>
+ <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
<!-- check if the symbol is MSFT -->
- <filter xpath="//*[wsx:symbol='MSFT']" xmlns:wsx="http://www.webserviceX.NET/">
+ <filter xpath="//*[wsx:symbol='MSFT']" xmlns:wsx="http://ws.invesbot.com/">
<!-- if it is throw a fault -->
<makefault>
<code value="tns:Receiver" xmlns:tns="http://www.w3.org/2003/05/soap-envelope"/>
@@ -28,7 +28,7 @@
</filter>
<!-- check if the URL matches the virtual url - either the proxy or ws-add case -->
- <filter source="get-property('To')" regex="http://stockquote.*">
+ <filter source="get-property('To')" regex="http://.*stockquotes.*">
<sequence ref="stockquote"/>
</filter>
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org