You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by pz...@apache.org on 2006/01/16 12:43:55 UTC
svn commit: r369443 - in /incubator/synapse/trunk/java: ./
src/samples/userguide/ test/org/apache/axis2/
Author: pzf
Date: Mon Jan 16 03:43:39 2006
New Revision: 369443
URL: http://svn.apache.org/viewcvs?rev=369443&view=rev
Log:
Fixed sample clients to use new ability to disable addressing
Added:
incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingModuleEngagementTest.java
- copied, changed from r368626, incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingMoudleEngagementTest.java
Removed:
incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingMoudleEngagementTest.java
Modified:
incubator/synapse/trunk/java/project.xml
incubator/synapse/trunk/java/src/samples/userguide/ProxyStockQuoteClient.java
incubator/synapse/trunk/java/src/samples/userguide/StockQuoteClient.java
incubator/synapse/trunk/java/src/samples/userguide/StockQuoteXMLHandler.java
Modified: incubator/synapse/trunk/java/project.xml
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/project.xml?rev=369443&r1=369442&r2=369443&view=diff
==============================================================================
--- incubator/synapse/trunk/java/project.xml (original)
+++ incubator/synapse/trunk/java/project.xml Mon Jan 16 03:43:39 2006
@@ -22,8 +22,6 @@
implementation of a highly scalable and distributed service mediation
framework based on Web services specifications.</description>
- the project home page
- todo: need to setup uri, issueTracker, site, and dist dir
<url>http://ws.apache.org/synapse/</url>
<issueTrackingUrl>http://issues.apache.org/jira/browse/Synapse</issueTrackingUrl>
<siteAddress>ws.apache.org</siteAddress>
@@ -63,10 +61,10 @@
<organization>Sonic Software</organization>
</developer>
<developer>
- <name>Glen Daniels</name>
- <id>gdaniels</id>
- <email>gdaniels@apache.org</email>
- <organization>Sonic Software</organization>
+ <name>Anthony Elder</name>
+ <id>ant</id>
+ <email>antelder@apache.org</email>
+ <organization>IBM</organization>
</developer>
<developer>
<name> P. Vikas Roonwal</name>
@@ -150,7 +148,6 @@
<properties>
<module>true</module>
</properties>
- <url>http://dist.codehaus.org/stax/jars/</url>
</dependency>
<dependency>
<groupId>${stax.impl.groupid}</groupId>
@@ -200,7 +197,7 @@
<module>true</module>
</properties>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>xmlbeans</groupId>
<artifactId>xbean</artifactId>
<version>${xbean.version}</version>
@@ -208,39 +205,39 @@
<properties>
<module>true</module>
</properties>
- </dependency>
- <dependency>
+ </dependency-->
+ <!--dependency>
<groupId>wss4j</groupId>
<artifactId>wss4j</artifactId>
<version>${wss4j.version}</version>
<properties>
<module>true</module>
</properties>
- </dependency>
- <dependency>
+ </dependency-->
+ <!--dependency>
<groupId>xml-security</groupId>
<artifactId>xmlsec</artifactId>
<version>${xmlsec.version}</version>
<properties>
<module>true</module>
</properties>
- </dependency>
- <dependency>
+ </dependency-->
+ <!--dependency>
<groupId>bouncycastle</groupId>
<artifactId>bcprov</artifactId>
<version>${bcprov.version}</version>
<properties>
<module>true</module>
</properties>
- </dependency>
- <dependency>
+ </dependency-->
+ <!--dependency>
<groupId>opensaml</groupId>
<artifactId>opensaml</artifactId>
<version>${opensaml.version}</version>
<properties>
<module>true</module>
</properties>
- </dependency>
+ </dependency-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -249,14 +246,14 @@
<classloader>root</classloader>
</properties>
</dependency>
- <dependency>
+ <!--dependency>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
<version>${xerces.version}</version>
<properties>
<module>true</module>
</properties>
- </dependency>
+ </dependency-->
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
Modified: incubator/synapse/trunk/java/src/samples/userguide/ProxyStockQuoteClient.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/samples/userguide/ProxyStockQuoteClient.java?rev=369443&r1=369442&r2=369443&view=diff
==============================================================================
--- incubator/synapse/trunk/java/src/samples/userguide/ProxyStockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/src/samples/userguide/ProxyStockQuoteClient.java Mon Jan 16 03:43:39 2006
@@ -4,6 +4,7 @@
import javax.xml.namespace.QName;
+import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
@@ -86,10 +87,10 @@
options.setAction("http://www.webserviceX.NET/GetQuote");
// create a lightweight Axis Config with no addressing to
// demonstrate "dumb" SOAP
+ options.setProperty(Constants.Configuration.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, new Boolean(true));
+
+ ServiceClient serviceClient = new ServiceClient();
- ServiceClient serviceClient = StockQuoteXMLHandler
- .createServiceClient();
- // make the ServiceClient
serviceClient.setOptions(options);
Modified: incubator/synapse/trunk/java/src/samples/userguide/StockQuoteClient.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/samples/userguide/StockQuoteClient.java?rev=369443&r1=369442&r2=369443&view=diff
==============================================================================
--- incubator/synapse/trunk/java/src/samples/userguide/StockQuoteClient.java (original)
+++ incubator/synapse/trunk/java/src/samples/userguide/StockQuoteClient.java Mon Jan 16 03:43:39 2006
@@ -1,31 +1,14 @@
package samples.userguide;
-<<<<<<< .mine
-
-
-
-=======
-import org.apache.axis2.Constants;
->>>>>>> .r369437
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.context.MessageContextConstants;
-<<<<<<< .mine
import org.apache.axis2.om.OMElement;
-=======
-import org.apache.axis2.om.*;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.transport.http.HttpTransportProperties;
-import org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties;
->>>>>>> .r369437
-
-import javax.xml.namespace.QName;
public class StockQuoteClient {
-<<<<<<< .mine
/**
* @param args
* <p>
@@ -36,16 +19,6 @@
*
*/
public static void main(String[] args) {
-=======
- /**
- * @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) {
->>>>>>> .r369437
if (args.length > 0 && args[0].substring(0, 1).equals("-")) {
System.out
@@ -76,108 +49,36 @@
if (args.length > 2)
turl = args[2];
-<<<<<<< .mine
try {
-=======
- try {
->>>>>>> .r369437
-
-<<<<<<< .mine
// step 1 - create a request payload
OMElement getQuote = StockQuoteXMLHandler
.createRequestPayload(symb);
-=======
- // step 1 - create a request payload
- OMElement getQuote = StockQuoteXMLHandler
- .createRequestPayload(symb);
->>>>>>> .r369437
-
-<<<<<<< .mine
// step 2 - set up the call object
-=======
- // step 2 - set up the call object
->>>>>>> .r369437
-
-<<<<<<< .mine
// the wsa:To
- EndpointReference targetEPR = new EndpointReference(xurl);
-=======
- // the wsa:To
- EndpointReference targetEPR = new EndpointReference(xurl);
->>>>>>> .r369437
-
-<<<<<<< .mine
+
+
Options options = new Options();
- options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
+ EndpointReference targetEPR = new EndpointReference(xurl);
options.setTo(targetEPR);
-=======
- Options options = new Options();
- //options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
- options.setTo(targetEPR);
->>>>>>> .r369437
-
-<<<<<<< .mine
+
+ options.setProperty(MessageContextConstants.TRANSPORT_URL, turl);
+
options.setAction("http://www.webserviceX.NET/GetQuote");
- options.setSoapAction("http://www.webserviceX.NET/GetQuote");
-=======
->>>>>>> .r369437
-
-<<<<<<< .mine
- // options.setProperty(MessageContextConstants.CHUNKED,
- // Constants.VALUE_FALSE);
+
+ //options.setSoapAction("http://www.webserviceX.NET/GetQuote");
+
ServiceClient serviceClient = new ServiceClient();
-=======
- options.setAction("http://www.webserviceX.NET/GetQuote");
- options.setSoapAction("http://www.webserviceX.NET/GetQuote");
->>>>>>> .r369437
-
-<<<<<<< .mine
serviceClient.setOptions(options);
-=======
- // options.setProperty(MessageContextConstants.CHUNKED, Constants.VALUE_FALSE);
- ServiceClient serviceClient = new ServiceClient();
->>>>>>> .r369437
-
-<<<<<<< .mine
// step 3 - Blocking invocation
OMElement result = serviceClient.sendReceive(getQuote);
// System.out.println(result);
-=======
- serviceClient.setOptions(options);
->>>>>>> .r369437
-
-<<<<<<< .mine
+ serviceClient.setOptions(options);
// step 4 - parse result
-=======
- // step 3 - Blocking invocation
- OMElement result = serviceClient.sendReceive(new QName("getQuote"),
- getQuote);
- // System.out.println(result);
->>>>>>> .r369437
-
-<<<<<<< .mine
System.out.println("Stock price = $"
+ StockQuoteXMLHandler.parseResponse(result));
-=======
- // step 4 - parse result
->>>>>>> .r369437
-
-<<<<<<< .mine
} catch (Exception e) {
e.printStackTrace();
}
-=======
- System.out.println("Stock price = $"
- + StockQuoteXMLHandler.parseResponse(result));
->>>>>>> .r369437
-
-<<<<<<< .mine
}
}
-=======
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}>>>>>>> .r369437
Modified: incubator/synapse/trunk/java/src/samples/userguide/StockQuoteXMLHandler.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/samples/userguide/StockQuoteXMLHandler.java?rev=369443&r1=369442&r2=369443&view=diff
==============================================================================
--- incubator/synapse/trunk/java/src/samples/userguide/StockQuoteXMLHandler.java (original)
+++ incubator/synapse/trunk/java/src/samples/userguide/StockQuoteXMLHandler.java Mon Jan 16 03:43:39 2006
@@ -5,23 +5,14 @@
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.OutInAxisOperation;
-import org.apache.axis2.description.TransportOutDescription;
-import org.apache.axis2.engine.AxisConfiguration;
+
import org.apache.axis2.om.OMAbstractFactory;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMFactory;
import org.apache.axis2.om.OMNamespace;
import org.apache.axis2.om.OMText;
import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
-import org.apache.axis2.transport.http.CommonsHTTPTransportSender;
+
public class StockQuoteXMLHandler {
@@ -61,28 +52,6 @@
}
- public static ServiceClient createServiceClient() throws AxisFault {
- AxisConfiguration ac = new AxisConfiguration();
- ConfigurationContext cc = new ConfigurationContext(ac);
- AxisServiceGroup asg = new AxisServiceGroup(ac);
- AxisService as = new AxisService("AnonymousService");
- asg.addService(as);
-
- AxisOperation axisOperationTemplate = new OutInAxisOperation(
- new QName("getQuote"));
- as.addOperation(axisOperationTemplate);
- cc.getAxisConfiguration().addService(as);
- TransportOutDescription tod = new TransportOutDescription(
- new QName(Constants.TRANSPORT_HTTP));
-
- tod.setSender(new CommonsHTTPTransportSender());
- ac.addTransportOut(tod);
- // make the ServiceClient
-
-
- ServiceClient serviceClient = new ServiceClient(cc, as);
- return serviceClient;
- }
}
Copied: incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingModuleEngagementTest.java (from r368626, incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingMoudleEngagementTest.java)
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingModuleEngagementTest.java?p2=incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingModuleEngagementTest.java&p1=incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingMoudleEngagementTest.java&r1=368626&r2=369443&rev=369443&view=diff
==============================================================================
--- incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingMoudleEngagementTest.java (original)
+++ incubator/synapse/trunk/java/test/org/apache/axis2/MultipleAddressingModuleEngagementTest.java Mon Jan 16 03:43:39 2006
@@ -26,7 +26,7 @@
*
*/
-public class MultipleAddressingMoudleEngagementTest extends TestCase {
+public class MultipleAddressingModuleEngagementTest extends TestCase {
private MessageContext msgCtx;
private SynapseEnvironment env;
private OMElement config;
---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org