You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/12/30 07:44:44 UTC
svn commit: r360004 - in /webservices/axis2/trunk/java/modules:
core/src/org/apache/axis2/client/ integration/itest/org/apache/axis2/rest/
integration/itest/test/interop/mtom/
integration/src/test/interop/sun/round4/complex/
integration/src/test/intero...
Author: deepal
Date: Thu Dec 29 22:43:33 2005
New Revision: 360004
URL: http://svn.apache.org/viewcvs?rev=360004&view=rev
Log:
integrating ServiceClient into few test cases and samples
Modified:
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java
webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java
webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java
webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestMultipleTest.java
webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestSingleTest.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/complex/EchoBlockingClient.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/simple/EchoBlockingClient.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/complex/EchoBlockingClient.java
webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/simple/EchoBlockingClient.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/profiling/ContextMemoryHandlingUtil.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
webservices/axis2/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java
webservices/axis2/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java
webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/client/MTOMClientModel.java
webservices/axis2/trunk/java/modules/samples/src/sample/mtom/interop/client/InteropClientModel.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/RESTClient.java
webservices/axis2/trunk/java/modules/samples/src/userguide/clients/TCPClient.java
webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/client/STSClient.java
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/client/ServiceClient.java Thu Dec 29 22:43:33 2005
@@ -502,6 +502,11 @@
}
}
+ public void engageModule(QName moduleName) throws AxisFault {
+ //TODO : This is a hack pls implement this in properway
+ configContext.getAxisConfiguration().engageModule(moduleName);
+ }
+
/**
* This class acts as a callback that allows users to wait on the result.
*/
Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/GetTest.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
@@ -59,10 +59,11 @@
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
options.setProperty(Constants.Configuration.ENABLE_REST_THROUGH_GET, Constants.VALUE_TRUE);
- Call call = new Call();
- call.setClientOptions(options);
- //if post is through GET of HTTP
- OMElement response = call.invokeBlocking("webSearch", data);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement response = sender.sendReceive(data);
+
response.serialize(System.out);
}
}
Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/PostTest.java Thu Dec 29 22:43:33 2005
@@ -21,8 +21,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
@@ -67,17 +67,16 @@
StAXOMBuilder builder = new StAXOMBuilder(reader);
OMElement websearch = builder.getDocumentElement();
- Call call = new Call();
-
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
options.setProperty(HTTPConstants.HTTP_CONTENT_TYPE, "application/x-www-form-urlencoded");
- //Blocking invocation
- OMElement result = call.invokeBlocking("echo", websearch);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement result = sender.sendReceive(websearch);
StringWriter writer = new StringWriter();
result.serialize(XMLOutputFactory.newInstance()
Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,10 @@
import junit.framework.TestCase;
import org.apache.axis2.Constants;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.Parameter;
import org.apache.axis2.description.ParameterImpl;
@@ -81,22 +83,23 @@
public void testEchoXMLSync() throws Exception {
OMElement payload = createEnvelope();
-
- Call call = new Call("target/test-resources/integrationRepo");
-
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
- call.setClientOptions(options);
- OMElement result =
- call.invokeBlocking(operationName.getLocalPart(),
- payload);
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement result = sender.sendReceive(payload);
+
result.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(
System.out));
- call.close();
+ sender.finalizeInvoke();
}
}
Modified: webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/org/apache/axis2/rest/RESTGetTest.java Thu Dec 29 22:43:33 2005
@@ -3,8 +3,8 @@
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
@@ -40,18 +40,19 @@
}
StAXOMBuilder builder = new StAXOMBuilder(reader);
OMElement data = builder.getDocumentElement();
-
- Call call = new Call();
-
Options options = new Options();
- call.setClientOptions(options);
options.setTo(new EndpointReference(epr));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
options.setProperty(Constants.Configuration.ENABLE_REST_THROUGH_GET, Constants.VALUE_TRUE);
//if post is through GET of HTTP
- OMElement response = call.invokeBlocking("webSearch", data);
+
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement response = sender.sendReceive(data);
+
response.serialize(System.out);
}
}
Modified: webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestMultipleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestMultipleTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestMultipleTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestMultipleTest.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,10 @@
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.soap.SOAP12Constants;
import test.interop.util.BodyElements;
@@ -43,16 +45,20 @@
}
public void runTest(boolean optimized, int repeat) throws Exception {
- Call call = new Call("target/test-resources/integrationRepo");
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
- OMElement resultElem = call.invokeBlocking("EchoTestMultiple", BodyElements.bodyMultiple(optimized, repeat));
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement resultElem = sender.sendReceive(BodyElements.bodyMultiple(optimized, repeat));
responseAssertion(resultElem);
}
Modified: webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestSingleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestSingleTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestSingleTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/itest/test/interop/mtom/MTOMEchoTestSingleTest.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,10 @@
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.soap.SOAP12Constants;
import test.interop.util.BodyElements;
@@ -40,16 +42,19 @@
}
public void runTest(boolean optimized) throws Exception {
- Call call = new Call("target/test-resources/integrationRepo");
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-
- OMElement resultElem = call.invokeBlocking("EchoTestSingle", BodyElements.bodySingle(optimized));
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement resultElem = sender.sendReceive(BodyElements.bodySingle(optimized));
responseAssertion(resultElem, optimized);
}
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/complex/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/complex/EchoBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/complex/EchoBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/complex/EchoBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
public class EchoBlockingClient {
@@ -31,11 +31,7 @@
EndpointReference targetEPR = new EndpointReference("http://soapinterop.java.sun.com:80/round4/grouph/complexrpcenc");
try {
-
-
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setExceptionToBeThrownOnSOAPFault(false);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
@@ -43,7 +39,11 @@
//Blocking invocation
- firstchild = call.invokeBlocking("", util.getEchoOMElement());
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ firstchild = sender.sendReceive(util.getEchoOMElement());
+
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/simple/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/simple/EchoBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/simple/EchoBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/sun/round4/simple/EchoBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -21,6 +21,7 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
import test.interop.sun.round4.simple.util.SunGroupHClientUtil;
@@ -30,18 +31,17 @@
EndpointReference targetEPR =
new EndpointReference("http://soapinterop.java.sun.com:80/round4/grouph/simplerpcenc");
try {
-
-
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setExceptionToBeThrownOnSOAPFault(false);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapAction(soapAction);
//Blocking invocation
- firstchild = call.invokeBlocking("", util.getEchoOMElement());
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ firstchild = sender.sendReceive(util.getEchoOMElement());
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/util/BodyElements.java Thu Dec 29 22:43:33 2005
@@ -15,11 +15,8 @@
*/
package test.interop.util;
-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.*;
import org.apache.axis2.om.impl.llom.OMTextImpl;
import javax.activation.DataHandler;
@@ -35,7 +32,7 @@
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNS = fac.createOMNamespace("http://example.org/mtom/data", "x");
OMElement data = fac.createOMElement("Data", omNS);
- File file = null;
+ File file;
DataHandler handler = null;
file = new File("modules/integration/itest-resources/mtom/mtom.bin");
if (file.exists()) {
@@ -57,7 +54,7 @@
OMNamespace omNS = fac.createOMNamespace("http://example.org/mtom/data", "x");
OMElement echoTest = fac.createOMElement("EchoTest", omNS);
- File file = null;
+ File file;
DataHandler handler = null;
file = new File("modules/integration/itest-resources/mtom/mtom.bin");
if (file.exists()) {
@@ -68,20 +65,19 @@
handler = new DataHandler(new FileDataSource(file));//
}
}
- for (int i = 0 ; i < repeat ; i++ ) {
- OMElement ele = fac.createOMElement("Data",omNS);
- OMText txt = fac.createText(handler,optimzed);
+ for (int i = 0; i < repeat; i++) {
+ OMElement ele = fac.createOMElement("Data", omNS);
+ OMText txt = fac.createText(handler, optimzed);
ele.addChild(txt);
echoTest.addChild(ele);
- }
+ }
return echoTest;
}
public static OMText getOriginalText(boolean optimized) {
File file = new File("modules/integration/itest-resources/mtom/mtom.bin");
DataHandler handler = new DataHandler(new FileDataSource(file));//
- OMText txt = new OMTextImpl(handler, optimized);
- return txt;
+ return new OMTextImpl(handler, optimized);
}
}
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/complex/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/complex/EchoBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/complex/EchoBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/complex/EchoBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,10 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.om.OMElement;
import test.interop.whitemesa.round4.complex.utils.WhitemesaR4ClientUtil;
@@ -33,12 +35,7 @@
EndpointReference targetEPR = new EndpointReference("http://www.whitemesa.net/interop/r4/fault-rpc-complex");
try {
-
-
- Call call = new Call("target/test-resources/integrationRepo");
-
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setExceptionToBeThrownOnSOAPFault(false);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
@@ -46,7 +43,13 @@
//Blocking invocation
- firstchild = call.invokeBlocking("", util.getEchoOMElement());
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ firstchild = sender.sendReceive(util.getEchoOMElement());
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/simple/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/simple/EchoBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/simple/EchoBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/src/test/interop/whitemesa/round4/simple/EchoBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,10 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.om.OMElement;
import test.interop.whitemesa.round4.simple.utils.WhitemesaR4ClientUtil;
@@ -33,19 +35,20 @@
EndpointReference targetEPR = new EndpointReference("http://www.whitemesa.net:80/interop/r4/fault-rpc");
try {
-
-
- Call call = new Call("target/test-resources/integrationRepo");
-
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setExceptionToBeThrownOnSOAPFault(false);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapAction(soapAction);
//Blocking invocation
- firstchild = call.invokeBlocking("", util.getEchoOMElement());
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ firstchild = sender.sendReceive(util.getEchoOMElement());
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/InvokerThread.java Thu Dec 29 22:43:33 2005
@@ -3,8 +3,10 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.om.OMElement;
@@ -47,22 +49,22 @@
public void run() {
try {
- log.info("Starting Thread number "+ threadNumber + " .............");
- Call call =
- new Call("target/test-resources/integrationRepo");
+ log.info("Starting Thread number " + threadNumber + " .............");
OMElement payload = TestingUtils.createDummyOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.setClientOptions(options);
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(payload);
- OMElement result =
- call.invokeBlocking(operationName.getLocalPart(),
- payload);
TestingUtils.campareWithCreatedOMElement(result);
- call.close();
- log.info("Finishing Thread number "+ threadNumber + " .....");
+ sender.finalizeInvoke();
+ log.info("Finishing Thread number " + threadNumber + " .....");
} catch (AxisFault axisFault) {
thrownException = axisFault;
log.error("Error has occured invoking the service ", axisFault);
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java Thu Dec 29 22:43:33 2005
@@ -34,20 +34,20 @@
public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
OMElement toSend) throws AxisFault {
- AxisOperation axisConfig =
+ AxisOperation axisOperation =
getServiceContext().getAxisService().getOperation(new QName(axisop));
- if (axisConfig == null) {
- axisConfig = new OutInAxisOperation();
- axisConfig.setName(new QName(axisop));
- axisConfig.setRemainingPhasesInFlow(axisOperationTemplate.getRemainingPhasesInFlow());
- axisConfig.setPhasesOutFlow(axisOperationTemplate.getPhasesOutFlow());
- axisConfig.setPhasesInFaultFlow(axisOperationTemplate.getPhasesInFaultFlow());
- axisConfig.setPhasesOutFaultFlow(axisOperationTemplate.getPhasesOutFaultFlow());
- getServiceContext().getAxisService().addOperation(axisConfig);
+ if (axisOperation == null) {
+ axisOperation = new OutInAxisOperation();
+ axisOperation.setName(new QName(axisop));
+ axisOperation.setRemainingPhasesInFlow(axisOperationTemplate.getRemainingPhasesInFlow());
+ axisOperation.setPhasesOutFlow(axisOperationTemplate.getPhasesOutFlow());
+ axisOperation.setPhasesInFaultFlow(axisOperationTemplate.getPhasesInFaultFlow());
+ axisOperation.setPhasesOutFaultFlow(axisOperationTemplate.getPhasesOutFaultFlow());
+ getServiceContext().getAxisService().addOperation(axisOperation);
}
MessageContext msgctx = prepareTheSOAPEnvelope(toSend);
- MessageContext responseContext = super.invokeBlocking(axisConfig,
+ MessageContext responseContext = super.invokeBlocking(axisOperation,
msgctx);
return responseContext.getEnvelope();
}
@@ -55,20 +55,20 @@
public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
SOAPEnvelope reqEnvelope) throws AxisFault {
- AxisOperation axisConfig =
+ AxisOperation axisOperation =
getServiceContext().getAxisService().getOperation(new QName(axisop));
- if (axisConfig == null) {
- axisConfig = new OutInAxisOperation();
- axisConfig.setName(new QName(axisop));
- axisConfig.setRemainingPhasesInFlow(axisOperationTemplate.getRemainingPhasesInFlow());
- axisConfig.setPhasesOutFlow(axisOperationTemplate.getPhasesOutFlow());
- axisConfig.setPhasesInFaultFlow(axisOperationTemplate.getPhasesInFaultFlow());
- axisConfig.setPhasesOutFaultFlow(axisOperationTemplate.getPhasesOutFaultFlow());
- getServiceContext().getAxisService().addOperation(axisConfig);
+ if (axisOperation == null) {
+ axisOperation = new OutInAxisOperation();
+ axisOperation.setName(new QName(axisop));
+ axisOperation.setRemainingPhasesInFlow(axisOperationTemplate.getRemainingPhasesInFlow());
+ axisOperation.setPhasesOutFlow(axisOperationTemplate.getPhasesOutFlow());
+ axisOperation.setPhasesInFaultFlow(axisOperationTemplate.getPhasesInFaultFlow());
+ axisOperation.setPhasesOutFaultFlow(axisOperationTemplate.getPhasesOutFaultFlow());
+ getServiceContext().getAxisService().addOperation(axisOperation);
}
MessageContext msgctx = getMessageContext(reqEnvelope);
- MessageContext responseContext = super.invokeBlocking(axisConfig,
+ MessageContext responseContext = super.invokeBlocking(axisOperation,
msgctx);
return responseContext.getEnvelope();
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/profiling/ContextMemoryHandlingUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/profiling/ContextMemoryHandlingUtil.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/profiling/ContextMemoryHandlingUtil.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/profiling/ContextMemoryHandlingUtil.java Thu Dec 29 22:43:33 2005
@@ -1,8 +1,10 @@
package org.apache.axis2.engine.util.profiling;
import org.apache.axis2.Constants;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.om.OMElement;
@@ -37,21 +39,20 @@
public void runOnce() throws Exception {
OMElement payload = TestingUtils.createDummyOMElement();
-
- Call call =
- new Call("target/test-resources/integrationRepo");
-
Options options = new Options();
- call.setClientOptions(options);
- options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement result = sender.sendReceive(payload);
- OMElement result =
- call.invokeBlocking(operationName.getLocalPart(),
- payload);
TestingUtils.campareWithCreatedOMElement(result);
- call.close();
+ sender.finalizeInvoke();
}
+
public static void main(String[] args) throws Exception {
ContextMemoryHandlingUtil contextMemoryHandlingTest = new ContextMemoryHandlingUtil();
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java Thu Dec 29 22:43:33 2005
@@ -21,6 +21,7 @@
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.context.ConfigurationContext;
@@ -59,15 +60,10 @@
private QName operationName = new QName("echoOMElement");
- private QName transportName = new QName("http://localhost/my",
- "NullTransport");
-
OMElement resultElem = null;
private AxisConfiguration engineRegistry;
- private MessageContext mc;
-
private SOAPEnvelope envelope;
private boolean finish = false;
@@ -103,7 +99,7 @@
envelope = null;
String expected = value;
try {
- if (clientConfigContext ==null) {
+ if (clientConfigContext == null) {
clientConfigContext = UtilsMailServer
.createClientConfigurationContext();
engineRegistry = clientConfigContext.getAxisConfiguration();
@@ -111,23 +107,20 @@
AxisService clientService = new AxisService(
serviceName.getLocalPart());
AxisOperation clientOperation = new OutInAxisOperation(
- );
+ );
clientOperation.setName(operationName);
clientOperation.setMessageReceiver(new MessageReceiver() {
- public void receive(MessageContext messageCtx) throws AxisFault {
+ public void receive(MessageContext messageCtx) {
envelope = messageCtx.getEnvelope();
}
});
engineRegistry.removeService(serviceName.getLocalPart());
clientService.addOperation(clientOperation);
engineRegistry.addService(clientService);
- clientServiceContext = Utils.fillContextInformation(clientOperation, clientService, clientConfigContext);
+ clientServiceContext = Utils.fillContextInformation(clientOperation, clientService, clientConfigContext);
- org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
- clientServiceContext);
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_MAIL);
options.setUseSeparateListener(true);
@@ -142,8 +135,12 @@
finish = true;
}
};
- call.invokeNonBlocking(operationName.getLocalPart(),
- createEnvelope(value), callback);
+ ServiceClient sender = new ServiceClient(clientServiceContext);
+ sender.setCurrentOperationName(operationName);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ sender.sendReceiveNonblocking(createEnvelope(value), callback);
+
int index = 0;
while (!finish) {
Thread.sleep(1000);
@@ -153,8 +150,7 @@
"Async response is taking too long[10s+]. Server is being shut down.");
}
}
- // call.close();
- call = null;
+ // call.close();
assertNotNull("Result is null", resultElem);
String result = ((OMElement) resultElem.getFirstOMChild()
.getNextOMSibling()).getFirstElement().getFirstElement()
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java Thu Dec 29 22:43:33 2005
@@ -23,6 +23,7 @@
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.context.ConfigurationContext;
@@ -118,14 +119,10 @@
ServiceContext serviceContext = new ServiceGroupContext(configContext,
service.getParent()).getServiceContext(service);
- org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
- serviceContext);
-
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_MAIL);
options.setUseSeparateListener(true);
- call.setClientOptions(options);
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
@@ -146,8 +143,12 @@
}
};
- call.invokeNonBlocking(operationName.getLocalPart(), createEnvelope(),
- callback);
+ ServiceClient sender = new ServiceClient(serviceContext);
+ sender.setOptions(options);
+ sender.setCurrentOperationName(operationName);
+ options.setTo(targetEPR);
+ sender.sendReceiveNonblocking(createEnvelope(), callback);
+
int index = 0;
while (!finish) {
Thread.sleep(1000);
@@ -157,7 +158,7 @@
"Server was shutdown as the async response take too long to complete");
}
}
- call.close();
+ sender.finalizeInvoke();
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponseRawXMLTest.java Thu Dec 29 22:43:33 2005
@@ -22,6 +22,7 @@
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.context.ConfigurationContext;
@@ -30,7 +31,6 @@
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.OutInAxisOperation;
-import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.Echo;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.om.OMAbstractFactory;
@@ -57,11 +57,6 @@
private Log log = LogFactory.getLog(getClass());
private QName serviceName = new QName("EchoXMLService");
private QName operationName = new QName("echoOMElement");
- private QName transportName = new QName("http://localhost/my",
- "NullTransport");
-
- private AxisConfiguration engineRegistry;
- private MessageContext mc;
private SOAPEnvelope envelope;
@@ -111,7 +106,7 @@
AxisOperation axisOperation = new OutInAxisOperation();
axisOperation.setName(operationName);
axisOperation.setMessageReceiver(new MessageReceiver() {
- public void receive(MessageContext messageCtx) throws AxisFault {
+ public void receive(MessageContext messageCtx) {
envelope = messageCtx.getEnvelope();
}
});
@@ -120,14 +115,10 @@
ServiceContext serviceContext = Utils.fillContextInformation(axisOperation, service, configContext);
-
- org.apache.axis2.client.Call call = new org.apache.axis2.client.Call(
- serviceContext);
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_MAIL);
options.setUseSeparateListener(true);
- call.setClientOptions(options);
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
try {
@@ -146,10 +137,11 @@
finish = true;
}
};
-
- call.invokeNonBlocking(operationName.getLocalPart(),
- createEnvelope(),
- callback);
+ ServiceClient sender = new ServiceClient(serviceContext);
+ sender.setOptions(options);
+ sender.setCurrentOperationName(operationName);
+ options.setTo(targetEPR);
+ sender.sendReceiveNonblocking(createEnvelope(), callback);
int index = 0;
while (!finish) {
Thread.sleep(1000);
@@ -159,7 +151,7 @@
"Async response is taking too long[10s+]. Server is being shut down.");
}
}
- call.close();
+ sender.finalizeInvoke();
}
}
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java Thu Dec 29 22:43:33 2005
@@ -28,7 +28,6 @@
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.engine.Echo;
import org.apache.axis2.engine.util.TestConstants;
@@ -37,7 +36,6 @@
import org.apache.axis2.om.impl.llom.OMTextImpl;
import org.apache.axis2.soap.SOAP12Constants;
import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.soap.SOAPFactory;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -51,8 +49,6 @@
private Log log = LogFactory.getLog(getClass());
- private ServiceContext serviceContext;
-
private AxisService service;
private OMTextImpl expectedTextData;
@@ -146,15 +142,8 @@
}
public void testEchoXMLSync() throws Exception {
- SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
-
OMElement payload = createEnvelope();
-
- org.apache.axis2.client.Call call =
- new org.apache.axis2.client.Call("target/test-resources/integrationRepo");
-
Options options = new Options();
- call.setClientOptions(options);
options.setProperty(MessageContext.CHARACTER_SET_ENCODING, "UTF-16");
//options.setTimeOutInMilliSeconds(-1);
//options.setProperty(HTTPConstants.SO_TIMEOUT,new Integer(Integer.MAX_VALUE));
@@ -162,10 +151,14 @@
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+ ConfigurationContextFactory factory = new ConfigurationContextFactory();
+ ConfigurationContext configContext =
+ factory.buildConfigurationContext("target/test-resources/integrationRepo");
+ ServiceClient sender = new ServiceClient(configContext);
+ sender.setOptions(options);
+ options.setTo(targetEPR);
+ OMElement result = sender.sendReceive(payload);
- OMElement result = call.invokeBlocking(operationName
- .getLocalPart(),
- payload);
// result.serializeAndConsume(new
// OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
OMElement ele = (OMElement) result.getFirstOMChild();
@@ -177,7 +170,7 @@
// Save the image
DataHandler actualDH;
actualDH = (DataHandler) binaryNode.getDataHandler();
- Image actualObject = new ImageIO().loadImage(actualDH.getDataSource()
+ new ImageIO().loadImage(actualDH.getDataSource()
.getInputStream());
// FileOutputStream imageOutStream = new FileOutputStream("target/testout.jpg");
// new ImageIO().saveImage("image/jpeg", actualObject, imageOutStream);
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
import sample.amazon.amazonSimpleQueueService.OMElementCreator;
@@ -71,14 +71,14 @@
//endpoint uri is hard coded....
String url = "http://webservices.amazon.com/onca/soap?Service=AWSSimpleQueueService";
try {
- Call call = new Call();
-
Options options = new Options();
options.setTo(new EndpointReference(url));
options.setSoapAction("http://soap.amazon.com");
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.setClientOptions(options);
- call.invokeNonBlocking(operation, element, specificCallbackObject);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(element, specificCallbackObject);
+
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
import sample.amazon.amazonSimpleQueueService.OMElementCreator;
@@ -60,14 +60,13 @@
//endpoint uri is hard coded....
String url = "http://webservices.amazon.com/onca/soap?Service=AWSSimpleQueueService";
try {
- Call call = new Call();
-
Options options = new Options();
- call.setClientOptions(options);
options.setSoapAction("http://soap.amazon.com");
options.setTo(new EndpointReference(url));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.invokeNonBlocking(operation, element, specificCallbackObject);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(element, specificCallbackObject);
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
import sample.amazon.amazonSimpleQueueService.OMElementCreator;
@@ -60,15 +60,14 @@
//endpoint uri is hard coded....
String url = "http://webservices.amazon.com/onca/soap?Service=AWSSimpleQueueService";
try {
- Call call = new Call();
-
Options options = new Options();
- call.setClientOptions(options);
options.setSoapAction("http://soap.amazon.com");
options.setTo(new EndpointReference(url));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.invokeNonBlocking(operation, element, specificCallbackObject);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(element, specificCallbackObject);
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
import sample.amazon.amazonSimpleQueueService.OMElementCreator;
@@ -63,9 +63,9 @@
options.setTo(new EndpointReference(url));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- Call call = new Call();
- call.setClientOptions(options);
- call.invokeNonBlocking(operation, element, specificCallbackObject);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(element, specificCallbackObject);
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/search/AsynchronousClient.java Thu Dec 29 22:43:33 2005
@@ -135,7 +135,6 @@
* @throws AxisFault
*/
public static void sendMsg() throws AxisFault {
- search.trim();
prevSearch = search;
Call call = new Call();
URL url = null;
@@ -171,6 +170,7 @@
call.invokeNonBlocking(opdesc,
requestContext,
new ClientCallbackHandler());
+
} catch (AxisFault e1) {
e1.printStackTrace();
} catch (XMLStreamException e) {
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/google/spellcheck/FormModel.java Thu Dec 29 22:43:33 2005
@@ -2,8 +2,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMAbstractFactory;
@@ -63,31 +63,23 @@
public void doAsyncSpellingSuggestion(String word) {
OMElement requestElement = getElement(word);
- Call call = null;
- try {
- call = new Call();
- } catch (AxisFault axisFault) {
- observer.updateError(axisFault.getMessage());
- }
URL url = null;
try {
- url =
- new URL(PROTOCOL,
- PropertyLoader.getGoogleEndpointURL(),
- PropertyLoader.getGoogleEndpointServiceName());
+ url = new URL(PROTOCOL,
+ PropertyLoader.getGoogleEndpointURL(),
+ PropertyLoader.getGoogleEndpointServiceName());
//url=new URL( "http","127.0.0.1",7070,"/search/beta2");
} catch (MalformedURLException e) {
observer.updateError(e.getMessage());
- ;
}
Options options = new Options();
- call.setClientOptions(options);
options.setTo(new EndpointReference(url.toString()));
try {
- call.invokeNonBlocking("doGoogleSpellingSugg",
- requestElement,
- new GoogleCallBack(word));
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(requestElement, new GoogleCallBack(word));
+
} catch (AxisFault axisFault) {
observer.updateError(axisFault.getMessage());
}
@@ -97,12 +89,6 @@
public void doSyncSpellingSuggestion(String word) {
OMElement responseElement = null;
OMElement requestElement = getElement(word);
- Call call = null;
- try {
- call = new Call();
- } catch (AxisFault axisFault) {
- observer.updateError(axisFault.getMessage());
- }
URL url = null;
try {
url =
@@ -115,12 +101,14 @@
}
Options options = new Options();
- call.setClientOptions(options);
+
options.setTo(new EndpointReference(url.toString()));
try {
- responseElement =
- call.invokeBlocking("doGoogleSpellingSugg",
- requestElement);
+
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ responseElement = sender.sendReceive(requestElement);
+
} catch (AxisFault axisFault) {
observer.updateError(axisFault.getMessage());
}
@@ -141,8 +129,6 @@
public String getResponse(SOAPEnvelope responseEnvelope) {
QName qName1 = new QName("urn:GoogleSearch",
"doSpellingSuggestionResponse");
- QName qName2 = new QName("urn:GoogleSearch", "return");
-
SOAPBody body = responseEnvelope.getBody();
if (body.hasFault()) {
@@ -150,7 +136,7 @@
return null;
} else {
OMElement root = body.getFirstChildWithName(qName1);
- OMElement val = null;
+ OMElement val;
if (root != null) {
// val = root.getFirstChildWithName(qName2);
val = root.getFirstElement();
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/client/MTOMClientModel.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/client/MTOMClientModel.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/client/MTOMClientModel.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/mtom/imagetransfer/client/MTOMClientModel.java Thu Dec 29 22:43:33 2005
@@ -20,13 +20,9 @@
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.attachments.utils.ImageDataSource;
import org.apache.axis2.attachments.utils.ImageIO;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
-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.client.ServiceClient;
+import org.apache.axis2.om.*;
import org.apache.axis2.soap.SOAP11Constants;
import javax.activation.DataHandler;
@@ -81,9 +77,6 @@
public OMElement sendFile(String fileName) throws Exception {
OMElement payload = createEnvelope(fileName);
-
- Call call = new Call();
-
Options options = new Options();
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTo(targetEPR);
@@ -91,11 +84,9 @@
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.setClientOptions(options);
- return call.invokeBlocking(operationName
- .getLocalPart(),
- payload);
-
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ return sender.sendReceive(payload);
}
Modified: webservices/axis2/trunk/java/modules/samples/src/sample/mtom/interop/client/InteropClientModel.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/mtom/interop/client/InteropClientModel.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/mtom/interop/client/InteropClientModel.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/mtom/interop/client/InteropClientModel.java Thu Dec 29 22:43:33 2005
@@ -18,13 +18,9 @@
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
-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.client.ServiceClient;
+import org.apache.axis2.om.*;
import org.apache.axis2.soap.SOAP12Constants;
import javax.activation.DataHandler;
@@ -63,7 +59,6 @@
public OMElement testEchoXMLSync(String fileName) throws Exception {
OMElement payload = createEnvelope(fileName);
- Call call = new Call();
Options options = new Options();
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
@@ -71,11 +66,10 @@
// enabling MTOM in the client side
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- call.setClientOptions(options);
- return call.invokeBlocking(operationName
- .getLocalPart(),
- payload);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ return sender.sendReceive(payload);
}
public void setTargetEPR(String targetEPR) {
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/ClientForWebServiceWithModule.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
import javax.xml.stream.XMLOutputFactory;
@@ -33,15 +33,13 @@
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(payload);
- //Blocking invocation
- OMElement result = call.invokeBlocking("echo",
- payload);
StringWriter writer = new StringWriter();
result.serialize(XMLOutputFactory.newInstance()
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -20,8 +20,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
import javax.xml.stream.XMLOutputFactory;
@@ -38,16 +38,14 @@
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
- Call call = new Call();
-
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
//Blocking invocation
- OMElement result = call.invokeBlocking("echo",
- payload);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(payload);
StringWriter writer = new StringWriter();
result.serialize(XMLOutputFactory.newInstance()
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingDualClient.java Thu Dec 29 22:43:33 2005
@@ -19,8 +19,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
import javax.xml.namespace.QName;
@@ -37,21 +37,18 @@
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
-
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
-
//The boolean flag informs the axis2 engine to use two separate transport connection
//to retrieve the response.
- call.engageModule(new QName(Constants.MODULE_ADDRESSING));
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setUseSeparateListener(true);
//Blocking Invocation
- OMElement result = call.invokeBlocking("echo",
- payload);
+ ServiceClient sender = new ServiceClient();
+ sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(payload);
StringWriter writer = new StringWriter();
result.serialize(XMLOutputFactory.newInstance()
@@ -60,7 +57,7 @@
System.out.println(writer.toString());
//Need to close the Client Side Listener.
- call.close();
+ sender.finalizeInvoke();
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java Thu Dec 29 22:43:33 2005
@@ -17,8 +17,8 @@
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMAbstractFactory;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.om.OMFactory;
@@ -44,16 +44,16 @@
}
public static void main(String[] args) throws Exception {
-
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
//Blocking invocation via wsa mapping
options.setAction("urn:sample/echo");
- OMElement result = (OMElement) call.invokeBlocking("echo", getBody());
+
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(getBody());
StringWriter writer = new StringWriter();
result.serialize(writer);
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingClient.java Thu Dec 29 22:43:33 2005
@@ -20,8 +20,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
@@ -40,10 +40,7 @@
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
-
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
@@ -69,7 +66,9 @@
};
//Non-Blocking Invocation
- call.invokeNonBlocking("echo", payload, callback);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(payload, callback);
//Wait till the callback receives the response.
while (!callback.isComplete()) {
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoNonBlockingDualClient.java Thu Dec 29 22:43:33 2005
@@ -20,8 +20,8 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.async.AsyncResult;
import org.apache.axis2.client.async.Callback;
import org.apache.axis2.om.OMElement;
@@ -47,9 +47,6 @@
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setUseSeparateListener(true);
- Call call = new Call();
- call.setClientOptions(options);
-
//Callback to handle the response
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
@@ -72,14 +69,16 @@
};
//Non-Blocking Invocation
- call.invokeNonBlocking("echo", payload, callback);
+ ServiceClient sender = new ServiceClient();
+ sender.setOptions(options);
+ sender.sendReceiveNonblocking(payload, callback);
//Wait till the callback receives the response.
while (!callback.isComplete()) {
Thread.sleep(1000);
}
//Need to close the Client Side Listener.
- call.close();
+ sender.finalizeInvoke();
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/RESTClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/RESTClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/RESTClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/RESTClient.java Thu Dec 29 22:43:33 2005
@@ -19,13 +19,14 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
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 javax.xml.namespace.QName;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
@@ -46,10 +47,10 @@
options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
- Call call = new Call();
- call.setClientOptions(options);
-
- OMElement result = call.invokeBlocking("echo", getPayload());
+ ServiceClient sender = new ServiceClient();
+ sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(getPayload());
try {
XMLStreamWriter writer = XMLOutputFactory.newInstance()
Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/TCPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/TCPClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/TCPClient.java (original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/TCPClient.java Thu Dec 29 22:43:33 2005
@@ -19,13 +19,14 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
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 javax.xml.namespace.QName;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
@@ -40,13 +41,14 @@
public static void main(String[] args) throws AxisFault {
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(new EndpointReference(toEpr));
options.setTransportInProtocol(Constants.TRANSPORT_TCP);
- OMElement result = call.invokeBlocking("echo", getPayload());
+ ServiceClient sender = new ServiceClient();
+ sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(getPayload());
try {
XMLStreamWriter writer = XMLOutputFactory.newInstance()
Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/client/STSClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/client/STSClient.java?rev=360004&r1=360003&r2=360004&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/client/STSClient.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/client/STSClient.java Thu Dec 29 22:43:33 2005
@@ -18,17 +18,18 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Call;
import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.om.OMElement;
import org.apache.axis2.security.handler.WSSHandlerConstants;
import org.apache.axis2.security.handler.config.InflowConfiguration;
import org.apache.axis2.security.handler.config.OutflowConfiguration;
-import org.apache.axis2.security.trust.Constants;
import org.apache.axis2.security.trust.TrustException;
import org.apache.axis2.security.trust.token.RequestSecurityToken;
import org.apache.axis2.security.trust.token.RequestSecurityTokenResponse;
+import javax.xml.namespace.QName;
+
/**
* Client to interact with a given SecurityTokenService
*/
@@ -48,14 +49,16 @@
public RequestSecurityTokenResponse doRequest(RequestSecurityToken rst) throws TrustException {
try {
- Call call = new Call();
Options options = new Options();
- call.setClientOptions(options);
options.setTo(new EndpointReference(this.stsUrl));
options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY, this.outConfig.getProperty());
options.setProperty(WSSHandlerConstants.INFLOW_SECURITY, this.inConfig.getProperty());
- OMElement res = call.invokeBlocking(Constants.LN.REQUEST_SECURITY_TOKEN, this.prepareRequst(rst));
+ ServiceClient sender = new ServiceClient();
+ sender.engageModule(new QName(org.apache.axis2.Constants.MODULE_ADDRESSING));
+ sender.setOptions(options);
+ OMElement res = sender.sendReceive(this.prepareRequst(rst));
+
RequestSecurityTokenResponse rstr = new RequestSecurityTokenResponse(res);
return rstr;
} catch (AxisFault e) {