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/05/31 10:53:10 UTC
svn commit: r410469 - in /incubator/synapse/trunk/java: etc/
modules/core/conf/ modules/core/src/org/apache/synapse/config/
modules/core/src/org/apache/synapse/config/xml/
modules/core/src/org/apache/synapse/core/axis2/ repository/conf/sample/
Author: asankha
Date: Wed May 31 01:53:10 2006
New Revision: 410469
URL: http://svn.apache.org/viewvc?rev=410469&view=rev
Log:
Checkin support for simple proxy services
Added:
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/core/src/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java
incubator/synapse/trunk/java/repository/conf/sample/sample_proxy_1.wsdl
incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml
Modified:
incubator/synapse/trunk/java/etc/project.properties
incubator/synapse/trunk/java/modules/core/conf/log4j.properties
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/SynapseConfiguration.java
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/Constants.java
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
Modified: incubator/synapse/trunk/java/etc/project.properties
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/etc/project.properties?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/etc/project.properties (original)
+++ incubator/synapse/trunk/java/etc/project.properties Wed May 31 01:53:10 2006
@@ -40,7 +40,7 @@
ant.version=1.6.5
axis.wsdl4j.version=1.2
wsdl4j.version=1.5.2
-axis2.version=1.0
+axis2.version=SNAPSHOT
axiom.version=1.0
policy.version=1.0.1
Modified: incubator/synapse/trunk/java/modules/core/conf/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/conf/log4j.properties?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/conf/log4j.properties (original)
+++ incubator/synapse/trunk/java/modules/core/conf/log4j.properties Wed May 31 01:53:10 2006
@@ -2,7 +2,7 @@
# Set the level to DEBUG if you want to log all SlideExceptions (some of them aren't errors)
#log4j.category.org.apache.axis2=INFO
-log4j.category.org.apache.synapse=INFO
+log4j.category.org.apache.synapse=DEBUG
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/SynapseConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/SynapseConfiguration.java?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/SynapseConfiguration.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/SynapseConfiguration.java Wed May 31 01:53:10 2006
@@ -16,9 +16,9 @@
package org.apache.synapse.config;
import org.apache.synapse.api.Mediator;
+import org.apache.synapse.core.axis2.ProxyService;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
/**
* The SynapseConfiguration holds the global configuration for a Synapse
@@ -34,6 +34,9 @@
/** Holds named endpoints (which results into absolute EPRs) for reuse */
private Map namedEndpoints = new HashMap();
+ /** Holds names Proxy services deployed through Synapse */
+ private Map proxyServices = new HashMap();
+
/** Holds global (system-wide) properties that apply to the synapse instance and every message */
private Map globalProps = new HashMap();
@@ -110,6 +113,28 @@
*/
public Endpoint getNamedEndpoint(String name) {
return (Endpoint) namedEndpoints.get(name);
+ }
+
+ /**
+ * Add a Proxy service to the configuration
+ * @param name the name of the Proxy service
+ * @param proxy the Proxy service instance
+ */
+ public void addProxyService(String name, ProxyService proxy) {
+ proxyServices.put(name, proxy);
+ }
+
+ /**
+ * Get the Proxy service with the given name
+ * @param name the name being looked up
+ * @return the Proxy service
+ */
+ public ProxyService getProxyService(String name) {
+ return (ProxyService) proxyServices.get(name);
+ }
+
+ public Collection getProxyServices() {
+ return proxyServices.values();
}
}
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/Constants.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/Constants.java?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/Constants.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/Constants.java Wed May 31 01:53:10 2006
@@ -26,6 +26,8 @@
public static final QName ENDPOINT_ELT = new QName(Constants.SYNAPSE_NAMESPACE, "endpoint");
public static final QName PROPERTY_ELT = new QName(Constants.SYNAPSE_NAMESPACE, "set-property");
public static final QName RULES_ELT = new QName(Constants.SYNAPSE_NAMESPACE, "rules");
+ public static final QName PROXIES_ELT = new QName(Constants.SYNAPSE_NAMESPACE, "proxies");
+ public static final QName PROXY_ELT = new QName(Constants.SYNAPSE_NAMESPACE, "proxy");
public static final String SYNAPSE_NAMESPACE = org.apache.synapse.Constants.SYNAPSE_NAMESPACE;
public static final String NULL_NAMESPACE = "";
Added: 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=410469&view=auto
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java (added)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/ProxyServiceFactory.java Wed May 31 01:53:10 2006
@@ -0,0 +1,149 @@
+/*
+* 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 org.apache.synapse.config.xml;
+
+import org.apache.synapse.core.axis2.ProxyService;
+import org.apache.synapse.SynapseException;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.net.MalformedURLException;
+
+/**
+ * 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"/>?
+ * <wsdl url="url">?
+ * <schema url="url">*
+ * <policy url="url">*
+ * </proxy>
+ */
+public class ProxyServiceFactory {
+
+ private static final Log log = LogFactory.getLog(ProxyServiceFactory.class);
+
+ public static ProxyService createProxy(OMElement elem) {
+
+ ProxyService proxy = new ProxyService();
+
+ OMAttribute name = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "name"));
+ if (name == null) {
+ handleException("The 'name' attribute is required for a Proxy service definition");
+ } else {
+ proxy.setName(name.getAttributeValue());
+ }
+
+ OMAttribute desc = elem.getAttribute(new QName(Constants.NULL_NAMESPACE, "description"));
+ if (desc != null) {
+ 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);
+ }
+ }
+
+ // 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());
+ }
+ }
+
+ // read definition of the target of this proxy service. The target could be an 'endpoint'
+ // or a named sequence. If none of these are specified, the messages would be mediated
+ // by the Synapse main mediator
+ OMElement target = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "target"));
+ if (target != null) {
+ OMAttribute sequence = target.getAttribute(new QName(Constants.NULL_NAMESPACE, "sequence"));
+ if (sequence != null) {
+ proxy.setTargetSequence(sequence.getAttributeValue());
+ }
+ OMAttribute tgtEndpt = target.getAttribute(new QName(Constants.NULL_NAMESPACE, "endpoint"));
+ if (tgtEndpt != null) {
+ proxy.setTargetEndpoint(tgtEndpt.getAttributeValue());
+ }
+ }
+
+ // 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) {
+ OMAttribute wsdlurl = wsdl.getAttribute(new QName(Constants.NULL_NAMESPACE, "url"));
+ if (wsdlurl == null) {
+ handleException("The 'url' attribute is required for the base WSDL definition");
+ } else {
+ String wUrl = wsdlurl.getAttributeValue();
+ try {
+ proxy.setWsdl(new URL(wUrl));
+ } catch (MalformedURLException e) {
+ 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"));
+ //OMElement policy = elem.getFirstChildWithName(new QName(Constants.SYNAPSE_NAMESPACE, "policy"));
+
+ return proxy;
+ }
+
+ private static void handleException(String msg) {
+ log.error(msg);
+ throw new SynapseException(msg);
+ }
+
+ private static void handleException(String msg, Exception e) {
+ log.error(msg, e);
+ throw new SynapseException(msg, e);
+ }
+
+}
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/XMLConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/XMLConfigurationBuilder.java?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/XMLConfigurationBuilder.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/config/xml/XMLConfigurationBuilder.java Wed May 31 01:53:10 2006
@@ -20,6 +20,7 @@
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.synapse.SynapseException;
+import org.apache.synapse.core.axis2.ProxyService;
import org.apache.synapse.config.SynapseConfiguration;
import org.apache.synapse.config.Endpoint;
import org.apache.synapse.mediators.base.SequenceMediator;
@@ -78,11 +79,27 @@
}
}
- OMElement elem = root.getFirstChildWithName(Constants.RULES_ELT);
- if (elem == null) {
+ OMElement proxies = root.getFirstChildWithName(Constants.PROXIES_ELT);
+ if (proxies != null) {
+ Iterator iter = proxies.getChildren();
+ while (iter.hasNext()) {
+ Object o = iter.next();
+ if (o instanceof OMElement) {
+ OMElement elt = (OMElement) o;
+ if (Constants.PROXY_ELT.equals(elt.getQName())) {
+ ProxyService proxy = ProxyServiceFactory.createProxy(elt);
+ proxy.buildAxisService();
+ config.addProxyService(proxy.getName(), proxy);
+ }
+ }
+ }
+ }
+
+ OMElement rules = root.getFirstChildWithName(Constants.RULES_ELT);
+ if (rules == null) {
handleException("A valid Synapse configuration MUST specify the main mediator using the <rules> element");
} else {
- SynapseMediator sm = (SynapseMediator) MediatorFactoryFinder.getInstance().getMediator(elem);
+ SynapseMediator sm = (SynapseMediator) MediatorFactoryFinder.getInstance().getMediator(rules);
if (sm.getList().isEmpty()) {
handleException("Invalid configuration, the main mediator specified by the <rules> element is empty");
} else {
Added: 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=410469&view=auto
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java (added)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyService.java Wed May 31 01:53:10 2006
@@ -0,0 +1,228 @@
+/*
+* 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 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.synapse.SynapseException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.net.URL;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+/**
+ * <proxy name="string" type="wsdl|jms|rest" [description="string"]>
+ * <endpoint protocols="(http|https|jms)+|all" uri="uri">
+ * <target sequence="name" | endpoint="name"/>?
+ * <wsdl url="url">?
+ * <schema url="url">*
+ * <policy url="url">*
+ * </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";
+
+ private String name;
+ private int type = WSDL_TYPE; // default
+ 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 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
+
+ /** The URL for the base WSDL */
+ private URL wsdl;
+ /** The URLs for any supplied schemas */
+ private URL[] schemas;
+ /** The URLs for any supplied policies */
+ private URL[] policies;
+
+ 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);
+ }
+
+ // 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);
+ }
+
+ Iterator iter = proxyService.getOperations();
+ while (iter.hasNext()) {
+ AxisOperation op = (AxisOperation) iter.next();
+ op.setMessageReceiver(msgRcvr);
+ }
+
+ return proxyService;
+ }
+
+ } catch (IOException e) {
+ handleException("Error opening input stream to WSDL at URL : " + wsdl, e);
+ }
+ } else {
+ // TODO
+ throw new UnsupportedOperationException("Only WSDL Proxy services are supported");
+ }
+ return null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void setType(int type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getEndpointProtocols() {
+ return endpointProtocols;
+ }
+
+ public void setEndpointProtocols(String endpointProtocols) {
+ this.endpointProtocols = endpointProtocols;
+ }
+
+ public String getEndpointURI() {
+ return endpointURI;
+ }
+
+ public void setEndpointURI(String endpointURI) {
+ this.endpointURI = endpointURI;
+ }
+
+ public String getTargetEndpoint() {
+ return targetEndpoint;
+ }
+
+ public void setTargetEndpoint(String targetEndpoint) {
+ this.targetEndpoint = targetEndpoint;
+ }
+
+ public String getTargetSequence() {
+ return targetSequence;
+ }
+
+ public void setTargetSequence(String targetSequence) {
+ this.targetSequence = targetSequence;
+ }
+
+ public URL getWsdl() {
+ return wsdl;
+ }
+
+ public void setWsdl(URL wsdl) {
+ this.wsdl = wsdl;
+ }
+
+ public URL[] getSchemas() {
+ return schemas;
+ }
+
+ public void setSchemas(URL[] schemas) {
+ this.schemas = schemas;
+ }
+
+ public URL[] getPolicies() {
+ return policies;
+ }
+
+ public void setPolicies(URL[] policies) {
+ this.policies = policies;
+ }
+
+ private static void handleException(String msg) {
+ log.error(msg);
+ throw new SynapseException(msg);
+ }
+
+ private static void handleException(String msg, Exception e) {
+ log.error(msg, e);
+ throw new SynapseException(msg, e);
+ }
+}
Added: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java?rev=410469&view=auto
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java (added)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java Wed May 31 01:53:10 2006
@@ -0,0 +1,155 @@
+/*
+ * 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 org.apache.synapse.core.axis2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.config.Endpoint;
+import org.apache.synapse.api.Mediator;
+
+/**
+ * This is the MessageReceiver set to act on behalf of Proxy services.
+ */
+public class ProxyServiceMessageReceiver extends SynapseMessageReceiver {
+
+ private static final Log log = LogFactory.getLog(ProxyServiceMessageReceiver.class);
+
+ /** The name of the Proxy Service */
+ private String name = null;
+
+ /**
+ * A target endpoint name requests Synapse to directly forward this message to the
+ * endpoint definition with the given name. If a target endpoint or sequence is not
+ * specified, the default main mediator would be used for mediation.
+ */
+ private String targetEndpoint = null;
+ /**
+ * A target sequence name specifies to Synapse to use the given named sequence for
+ * message mediation. If a target endpoint or sequence is not specified, the default
+ * main mediator would be used for mediation.
+ */
+ private String targetSequence = null;
+
+ public void receive(org.apache.axis2.context.MessageContext mc) throws AxisFault {
+
+ log.debug("Proxy Service " + name + " received a new message...");
+ log.debug("Message To: " + (mc.getTo() != null ?
+ mc.getTo().getAddress() : "null"));
+ log.debug("SOAPAction: " + (mc.getWSAAction() != null ?
+ mc.getWSAAction() : "null"));
+ log.debug("Body : \n" + mc.getEnvelope());
+
+ MessageContext synCtx = Axis2MessageContextFinder.getSynapseMessageContext(mc);
+
+ // if a target endpoint is specified, directly forward to that
+ if (targetEndpoint != null) {
+ Endpoint endpoint = synCtx.getConfiguration().getNamedEndpoint(targetEndpoint);
+ if (endpoint == null) {
+ // what else can/should we do instead of just logging the message as an error?
+ log.error("The endpoint named '" + targetEndpoint + "' is not defined. Dropping current message");
+ } else {
+ synCtx.setTo(new EndpointReference(endpoint.getAddress().toString()));
+ log.debug("Forwarding message directly to the endpoint named : " + targetEndpoint);
+
+ org.apache.axis2.context.MessageContext axisInMsgContext =
+ ((Axis2MessageContext) synCtx).getAxis2MessageContext();
+ org.apache.axis2.context.MessageContext axisOutMsgContext =
+ Axis2FlexibleMEPClient.send(axisInMsgContext);
+
+ axisOutMsgContext.setServerSide(true);
+ axisOutMsgContext.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_OUT,
+ axisInMsgContext.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_OUT));
+
+ axisOutMsgContext.setTransportIn(axisInMsgContext.getTransportIn());
+
+ // 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
+ axisOutMsgContext.getEnvelope().build();
+
+ AxisEngine ae = new AxisEngine(axisOutMsgContext.getConfigurationContext());
+ try {
+ axisOutMsgContext.setProperty(org.apache.synapse.Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
+ // check for addressing is alredy engaged for this message.
+ // if engage we should use the address enable Configuraion context.
+ ae.send(axisOutMsgContext);
+
+ } catch (AxisFault e) {
+ log.error("Axis fault encountered while forwarding message to endpoint : " + targetEndpoint, e);
+ }
+ }
+
+ // if a named sequence is specified, use it for message mediation
+ } else if (targetSequence != null) {
+ Mediator mediator = synCtx.getConfiguration().getNamedMediator(targetSequence);
+ if (mediator == null) {
+ // what else can/should we do instead of just logging the message as an error?
+ log.error("The mediator named '" + targetSequence + "' is not defined. Dropping current message");
+ } else {
+ log.debug("Using sequence named : " + targetSequence + " for message mediation");
+ mediator.mediate(synCtx);
+ }
+
+ // else default to the Synapse main mediator
+ } else {
+ log.debug("Using default 'main' mediator for message mediation");
+ synCtx.getEnvironment().injectMessage(synCtx);
+ }
+
+ // Response handling mechanism for 200/202 and 5XX
+ // if smc.isResponse = true then the response will be handled with 200 OK
+ // else, response will be 202 OK without an http body
+ // if smc.isFaultRespose = true then the response is a fault with 500 Internal Server Error
+
+ if (synCtx.isResponse()) {
+ mc.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
+ }
+ if (synCtx.isFaultResponse()) {
+ // todo: is there a better way to inject faultSoapEnv to the Axis2 Transport
+ throw new AxisFault("Synapse Encountered an Error - See Log for More Details");
+ }
+ }
+
+ /**
+ * Specify a named target endpoint for direct message forwarding
+ * @param targetEndpoint the name of the target endpoint to be used
+ */
+ public void setTargetEndpoint(String targetEndpoint) {
+ this.targetEndpoint = targetEndpoint;
+ }
+
+ /**
+ * Specify a named target sequence to be used for message mediation
+ * @param targetSequence the name of the target sequence to be used
+ */
+ public void setTargetSequence(String targetSequence) {
+ this.targetSequence = targetSequence;
+ }
+
+ /**
+ * Set the name of the corresponding proxy service
+ * @param name the proxy service name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Modified: incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java?rev=410469&r1=410468&r2=410469&view=diff
==============================================================================
--- incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java (original)
+++ incubator/synapse/trunk/java/modules/core/src/org/apache/synapse/core/axis2/SynapseModule.java Wed May 31 01:53:10 2006
@@ -28,6 +28,7 @@
import org.apache.synapse.SynapseException;
import javax.xml.namespace.QName;
+import java.util.Iterator;
public class SynapseModule implements Module, Constants {
@@ -85,9 +86,14 @@
"'to the Axis2 configuration : " + e.getMessage(), e);
}
- log.info("Synapse Environment initialized...");
-
+ log.info("Initializing Proxy services...");
+ Iterator iter = synCfg.getProxyServices().iterator();
+ while (iter.hasNext()) {
+ ProxyService proxy = (ProxyService) iter.next();
+ axisCfg.addService(proxy.buildAxisService());
+ }
+ log.info("Synapse Environment initialized...");
}
public void engageNotify(AxisDescription axisDescription) throws AxisFault {
Added: incubator/synapse/trunk/java/repository/conf/sample/sample_proxy_1.wsdl
URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/sample_proxy_1.wsdl?rev=410469&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/sample_proxy_1.wsdl (added)
+++ incubator/synapse/trunk/java/repository/conf/sample/sample_proxy_1.wsdl Wed May 31 01:53:10 2006
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://ws.invesbot.com/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://ws.invesbot.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <s:schema elementFormDefault="qualified" targetNamespace="http://ws.invesbot.com/">
+ <s:element name="GetQuotes">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="symbols" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetQuotesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetQuotesResult">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetQuote">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="symbol" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetQuoteResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetQuoteResult">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetMarketIndex">
+ <s:complexType />
+ </s:element>
+ <s:element name="GetMarketIndexResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetMarketIndexResult">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetECNQuotes">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="symbols" type="s:string" />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ <s:element name="GetECNQuotesResponse">
+ <s:complexType>
+ <s:sequence>
+ <s:element minOccurs="0" maxOccurs="1" name="GetECNQuotesResult">
+ <s:complexType mixed="true">
+ <s:sequence>
+ <s:any />
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:sequence>
+ </s:complexType>
+ </s:element>
+ </s:schema>
+ </wsdl:types>
+ <wsdl:message name="GetQuotesSoapIn">
+ <wsdl:part name="parameters" element="tns:GetQuotes" />
+ </wsdl:message>
+ <wsdl:message name="GetQuotesSoapOut">
+ <wsdl:part name="parameters" element="tns:GetQuotesResponse" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteSoapIn">
+ <wsdl:part name="parameters" element="tns:GetQuote" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteSoapOut">
+ <wsdl:part name="parameters" element="tns:GetQuoteResponse" />
+ </wsdl:message>
+ <wsdl:message name="GetMarketIndexSoapIn">
+ <wsdl:part name="parameters" element="tns:GetMarketIndex" />
+ </wsdl:message>
+ <wsdl:message name="GetMarketIndexSoapOut">
+ <wsdl:part name="parameters" element="tns:GetMarketIndexResponse" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesSoapIn">
+ <wsdl:part name="parameters" element="tns:GetECNQuotes" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesSoapOut">
+ <wsdl:part name="parameters" element="tns:GetECNQuotesResponse" />
+ </wsdl:message>
+ <wsdl:message name="GetQuotesHttpGetIn">
+ <wsdl:part name="symbols" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetQuotesHttpGetOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpGetIn">
+ <wsdl:part name="symbol" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpGetOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetMarketIndexHttpGetIn" />
+ <wsdl:message name="GetMarketIndexHttpGetOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesHttpGetIn">
+ <wsdl:part name="symbols" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesHttpGetOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetQuotesHttpPostIn">
+ <wsdl:part name="symbols" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetQuotesHttpPostOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpPostIn">
+ <wsdl:part name="symbol" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetQuoteHttpPostOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetMarketIndexHttpPostIn" />
+ <wsdl:message name="GetMarketIndexHttpPostOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesHttpPostIn">
+ <wsdl:part name="symbols" type="s:string" />
+ </wsdl:message>
+ <wsdl:message name="GetECNQuotesHttpPostOut">
+ <wsdl:part name="Body" />
+ </wsdl:message>
+ <wsdl:portType name="StockQuotesSoap">
+ <wsdl:operation name="GetQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Quotes delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuotesSoapIn" />
+ <wsdl:output message="tns:GetQuotesSoapOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter one symbol, quote delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuoteSoapIn" />
+ <wsdl:output message="tns:GetQuoteSoapOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Dow, Nasdaq, S&P500 index.</wsdl:documentation>
+ <wsdl:input message="tns:GetMarketIndexSoapIn" />
+ <wsdl:output message="tns:GetMarketIndexSoapOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Real-Time ECN quote.</wsdl:documentation>
+ <wsdl:input message="tns:GetECNQuotesSoapIn" />
+ <wsdl:output message="tns:GetECNQuotesSoapOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StockQuotesHttpGet">
+ <wsdl:operation name="GetQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Quotes delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuotesHttpGetIn" />
+ <wsdl:output message="tns:GetQuotesHttpGetOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter one symbol, quote delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuoteHttpGetIn" />
+ <wsdl:output message="tns:GetQuoteHttpGetOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Dow, Nasdaq, S&P500 index.</wsdl:documentation>
+ <wsdl:input message="tns:GetMarketIndexHttpGetIn" />
+ <wsdl:output message="tns:GetMarketIndexHttpGetOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Real-Time ECN quote.</wsdl:documentation>
+ <wsdl:input message="tns:GetECNQuotesHttpGetIn" />
+ <wsdl:output message="tns:GetECNQuotesHttpGetOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="StockQuotesHttpPost">
+ <wsdl:operation name="GetQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Quotes delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuotesHttpPostIn" />
+ <wsdl:output message="tns:GetQuotesHttpPostOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter one symbol, quote delayed in 20 minutes.</wsdl:documentation>
+ <wsdl:input message="tns:GetQuoteHttpPostIn" />
+ <wsdl:output message="tns:GetQuoteHttpPostOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Get Dow, Nasdaq, S&P500 index.</wsdl:documentation>
+ <wsdl:input message="tns:GetMarketIndexHttpPostIn" />
+ <wsdl:output message="tns:GetMarketIndexHttpPostOut" />
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Enter symbols, seperated by space, Real-Time ECN quote.</wsdl:documentation>
+ <wsdl:input message="tns:GetECNQuotesHttpPostIn" />
+ <wsdl:output message="tns:GetECNQuotesHttpPostOut" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StockQuotesSoap" type="tns:StockQuotesSoap">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="GetQuotes">
+ <soap:operation soapAction="http://ws.invesbot.com/GetQuotes" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <soap:operation soapAction="http://ws.invesbot.com/GetQuote" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <soap:operation soapAction="http://ws.invesbot.com/GetMarketIndex" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <soap:operation soapAction="http://ws.invesbot.com/GetECNQuotes" 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="StockQuotesSoap12" type="tns:StockQuotesSoap">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="GetQuotes">
+ <soap12:operation soapAction="http://ws.invesbot.com/GetQuotes" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <soap12:operation soapAction="http://ws.invesbot.com/GetQuote" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <soap12:operation soapAction="http://ws.invesbot.com/GetMarketIndex" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <soap12:operation soapAction="http://ws.invesbot.com/GetECNQuotes" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="StockQuotesHttpGet" type="tns:StockQuotesHttpGet">
+ <http:binding verb="GET" />
+ <wsdl:operation name="GetQuotes">
+ <http:operation location="/GetQuotes" />
+ <wsdl:input>
+ <http:urlEncoded />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <http:operation location="/GetQuote" />
+ <wsdl:input>
+ <http:urlEncoded />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <http:operation location="/GetMarketIndex" />
+ <wsdl:input>
+ <http:urlEncoded />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <http:operation location="/GetECNQuotes" />
+ <wsdl:input>
+ <http:urlEncoded />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="StockQuotesHttpPost" type="tns:StockQuotesHttpPost">
+ <http:binding verb="POST" />
+ <wsdl:operation name="GetQuotes">
+ <http:operation location="/GetQuotes" />
+ <wsdl:input>
+ <mime:content type="application/x-www-form-urlencoded" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetQuote">
+ <http:operation location="/GetQuote" />
+ <wsdl:input>
+ <mime:content type="application/x-www-form-urlencoded" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetMarketIndex">
+ <http:operation location="/GetMarketIndex" />
+ <wsdl:input>
+ <mime:content type="application/x-www-form-urlencoded" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="GetECNQuotes">
+ <http:operation location="/GetECNQuotes" />
+ <wsdl:input>
+ <mime:content type="application/x-www-form-urlencoded" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content part="Body" type="text/xml" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="StockQuotes">
+ <wsdl:port name="StockQuotesSoap" binding="tns:StockQuotesSoap">
+ <soap:address location="http://ws.invesbot.com/stockquotes.asmx" />
+ </wsdl:port>
+ <wsdl:port name="StockQuotesSoap12" binding="tns:StockQuotesSoap12">
+ <soap12:address location="http://ws.invesbot.com/stockquotes.asmx" />
+ </wsdl:port>
+ <wsdl:port name="StockQuotesHttpGet" binding="tns:StockQuotesHttpGet">
+ <http:address location="http://ws.invesbot.com/stockquotes.asmx" />
+ </wsdl:port>
+ <wsdl:port name="StockQuotesHttpPost" binding="tns:StockQuotesHttpPost">
+ <http:address location="http://ws.invesbot.com/stockquotes.asmx" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
Added: 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=410469&view=auto
==============================================================================
--- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml (added)
+++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml Wed May 31 01:53:10 2006
@@ -0,0 +1,42 @@
+<synapse xmlns="http://ws.apache.org/ns/synapse">
+
+ <definitions>
+ <sequence name="stockquote">
+ <log level="custom">
+ <property name="sequence" value="*** Custom 'stockquote'Sequence ***"/>
+ </log>
+ <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+ <send/>
+ </sequence>
+
+ <endpoint name="invesbot" address="http://ws.invesbot.com/stockquotes.asmx"/>
+ </definitions>
+
+ <proxies>
+ <proxy name="InvesbotSequenceProxy" type="wsdl" description="This uses the stockquote named sequence for mediation">
+ <endpoint protocol="http" uri="/MyfirstProxy"/>
+ <target sequence="stockquote"/>
+ <wsdl url="file:synapse_repository/conf/sample/sample_proxy_1.wsdl"/>
+ </proxy>
+
+ <proxy name="InvesbotForwardProxy" type="wsdl" description="This simply forwards all messages to the investbot endpoint">
+ <endpoint protocol="http" uri="/MyfirstProxy"/>
+ <target endpoint="invesbot"/>
+ <wsdl url="file:synapse_repository/conf/sample/sample_proxy_1.wsdl"/>
+ </proxy>
+
+ <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>
+ </proxies>
+
+ <rules>
+ <log level="custom">
+ <property name="sequence" value="*** Default Main mediator Sequence ***"/>
+ </log>
+ <header name="To" value="http://ws.invesbot.com/stockquotes.asmx"/>
+ <send/>
+ </rules>
+
+</synapse>
\ 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