You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/06/27 18:46:04 UTC
svn commit: r551228 [5/23] - in /webservices/axis2/branches/java/jaxws21: ./
etc/ modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/schema/writer/ modules...
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java Wed Jun 27 09:45:37 2007
@@ -41,6 +41,7 @@
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -72,7 +73,7 @@
public static Test suite() {
return getTestSetup2(new TestSuite(EchoRawMTOMTest.class),
- Constants.TESTING_PATH + "MTOM-enabledRepository");
+ TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "MTOM-enabledRepository"));
}
protected void setUp() throws Exception {
@@ -93,7 +94,7 @@
OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
OMElement rpcWrapEle = fac.createOMElement("echoOMElement", omNs);
OMElement data = fac.createOMElement("data", omNs);
- FileDataSource fileDataSource = new FileDataSource("test-resources/mtom/test.jpg");
+ FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
expectedDH = new DataHandler(fileDataSource);
expectedTextData = new OMTextImpl(expectedDH, true, fac);
data.addChild(expectedTextData);
@@ -128,7 +129,7 @@
};
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
- "target/test-resources/integrationRepo", null);
+ TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
sender.setOptions(options);
@@ -155,7 +156,7 @@
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
- "target/test-resources/integrationRepo", null);
+ TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
@@ -185,7 +186,7 @@
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
- "target/test-resources/integrationRepo", null);
+ TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.engageModule(new QName("addressing"));
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java Wed Jun 27 09:45:37 2007
@@ -41,6 +41,7 @@
import org.apache.axis2.engine.Echo;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -124,7 +125,7 @@
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
- "target/test-resources/integrationRepo", null);
+ TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(clientOptions);
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/MessageSaveAndRestoreWithMTOMTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/MessageSaveAndRestoreWithMTOMTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/MessageSaveAndRestoreWithMTOMTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/mtom/MessageSaveAndRestoreWithMTOMTest.java Wed Jun 27 09:45:37 2007
@@ -43,6 +43,7 @@
import org.apache.axis2.handlers.AbstractHandler;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.phaseresolver.PhaseMetadata;
import org.apache.axis2.util.Utils;
@@ -81,7 +82,7 @@
public static Test suite() {
return getTestSetup2(new TestSuite(MessageSaveAndRestoreWithMTOMTest.class),
- Constants.TESTING_PATH + "MTOM-enabledRepository");
+ TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "MTOM-enabledRepository"));
}
protected void setUp() throws Exception {
@@ -135,7 +136,7 @@
options.setTimeOutInMilliSeconds(50000);
ConfigurationContext configurationContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem("target/test-resources/integrationRepo",
+ .createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
null);
ServiceClient sender = new ServiceClient(configurationContext, null);
@@ -159,7 +160,7 @@
OMElement rpcWrapperElement = omFactory.createOMElement("echoOMElement", omNamespace);
OMElement data = omFactory.createOMElement("data", omNamespace);
- FileDataSource fileDataSource = new FileDataSource("test-resources/mtom/test.jpg");
+ FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
DataHandler expectedDataHandler = new DataHandler(fileDataSource);
expectedTextData = new OMTextImpl(expectedDataHandler, true, omFactory);
data.addChild(expectedTextData);
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java Wed Jun 27 09:45:37 2007
@@ -16,8 +16,17 @@
package org.apache.axis2.rpc;
+import java.io.ByteArrayInputStream;
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
import junit.framework.Test;
import junit.framework.TestSuite;
+
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
@@ -40,62 +49,23 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.DefaultObjectSupplier;
+import org.apache.axis2.integration.RPCLocalTestCase;
import org.apache.axis2.integration.UtilServer;
-import org.apache.axis2.integration.UtilServerBasedTestCase;
import org.apache.axis2.rpc.client.RPCServiceClient;
import org.apache.axis2.wsdl.WSDLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-
-public class MultirefTest extends UtilServerBasedTestCase {
-
- protected EndpointReference targetEPR =
- new EndpointReference("http://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis2/services/EchoXMLService/concat");
- protected QName serviceName = new QName("EchoXMLService");
- protected QName operationName = new QName(NAMESPACE, "concat");
- protected QName transportName = new QName(NAMESPACE,
- "NullTransport");
-
- protected AxisConfiguration engineRegistry;
- protected MessageContext mc;
- protected ServiceContext serviceContext;
- protected AxisService service;
+public class MultirefTest extends RPCLocalTestCase {
protected boolean finish = false;
public static final String NAMESPACE = "http://rpc.axis2.apache.org/xsd";
- public static Test suite() {
- return getTestSetup(new TestSuite(MultirefTest.class));
- }
-
- protected void tearDown() throws Exception {
- UtilServer.unDeployService(serviceName);
- UtilServer.unDeployClientService();
- }
-
- private void configureSystem(String opName) throws AxisFault {
- targetEPR =
- new EndpointReference("http://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis2/services/EchoXMLService/" + opName);
- String className = "org.apache.axis2.rpc.RPCServiceClass";
- operationName = new QName("http://rpc.axis2.apache.org/xsd", opName, "req");
- AxisService service = AxisService.createService(
- className, UtilServer.getConfigurationContext().getAxisConfiguration());
- service.setName("EchoXMLService");
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- UtilServer.deployService(service);
- }
-
+ protected void setUp() throws Exception {
+ super.setUp();
+ deployClassAsService("EchoXMLService", RPCServiceClass.class);
+ }
+
public void testMulitref1() throws AxisFault {
- configureSystem("echoString");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoString");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -112,18 +82,9 @@
ref.setText("hello Axis2");
envelope.getBody().addChild(ref);
- Options options = new Options();
-
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -139,7 +100,7 @@
}
public void testadd() throws AxisFault {
- configureSystem("add");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "add");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -166,17 +127,9 @@
ref2.setText("10");
envelope.getBody().addChild(ref2);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -192,7 +145,7 @@
}
public void testaddSameRef() throws AxisFault {
- configureSystem("add");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "add");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -214,17 +167,9 @@
ref.setText("10");
envelope.getBody().addChild(ref);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -239,7 +184,7 @@
public void testaddError() {
try {
- configureSystem("add");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "add");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -266,17 +211,9 @@
ref2.setText("10");
envelope.getBody().addChild(ref2);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();;
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();;
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -296,7 +233,7 @@
public void testMulitrefBean() throws Exception {
- configureSystem("editBean");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "editBean");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -328,17 +265,9 @@
OMElement om4 = getOMElement(ref4, fac);
envelope.getBody().addChild(om4);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -358,7 +287,7 @@
public void testbeanOM() throws Exception {
- configureSystem("beanOM");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "beanOM");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -390,17 +319,9 @@
OMElement om4 = getOMElement(ref4, fac);
envelope.getBody().addChild(om4);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();;
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();;
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -420,7 +341,7 @@
public void testomrefs() throws Exception {
- configureSystem("omrefs");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "omrefs");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -453,17 +374,10 @@
String ref4 = "<reference id=\"4\">Colombo3</reference>";
OMElement om4 = getOMElement(ref4, fac);
envelope.getBody().addChild(om4);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();;
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+
+ MessageContext reqMessageContext = new MessageContext();;
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -495,7 +409,7 @@
public void testechoEmployee() throws Exception {
- configureSystem("echoEmployee");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoEmployee");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -523,16 +437,9 @@
"</reference>";
envelope.getBody().addChild(getOMElement(str, fac));
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
@@ -550,7 +457,7 @@
public void testMulitrefArray() throws AxisFault {
- configureSystem("handleArrayList");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "handleArrayList");
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(NAMESPACE, "my");
@@ -589,18 +496,9 @@
}
envelope.getBody().addChild(staxOMBuilder.getDocumentElement());
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
-
- ConfigurationContext configContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient rpcClient = new RPCServiceClient(configContext, null);
- rpcClient.setOptions(options);
- MessageContext reqMessageContext = configContext.createMessageContext();
- OperationClient opClinet = rpcClient.createClient(ServiceClient.ANON_OUT_IN_OP);
- opClinet.setOptions(options);
+ MessageContext reqMessageContext = new MessageContext();
+ OperationClient opClinet = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
+
reqMessageContext.setEnvelope(envelope);
opClinet.addMessageContext(reqMessageContext);
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java Wed Jun 27 09:45:37 2007
@@ -16,101 +16,41 @@
*/
package org.apache.axis2.rpc;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import java.io.ByteArrayInputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Options;
-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.databinding.utils.BeanUtil;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.DefaultObjectSupplier;
-import org.apache.axis2.integration.UtilServer;
-import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.RPCLocalTestCase;
import org.apache.axis2.rpc.client.RPCServiceClient;
-import org.apache.axis2.rpc.receivers.RPCMessageReceiver;
-import org.apache.axis2.wsdl.WSDLConstants;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-public class RPCCallTest extends UtilServerBasedTestCase {
+public class RPCCallTest extends RPCLocalTestCase {
private SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
// 0123456789 0 123456789
-
- protected EndpointReference targetEPR;
- protected QName serviceName = new QName("EchoXMLService");
- protected QName operationName = new QName("http://org.apache.axis2/xsd", "concat");
- protected QName transportName = new QName("http://org.apache.axis2/xsd",
- "NullTransport");
-
- protected AxisConfiguration engineRegistry;
- protected MessageContext mc;
- protected ServiceContext serviceContext;
- protected AxisService service;
-
protected boolean finish = false;
- public RPCCallTest() {
- super(RPCCallTest.class.getName());
- }
-
- public RPCCallTest(String testName) {
- super(testName);
- }
-
- public static Test suite() {
- return getTestSetup(new TestSuite(RPCCallTest.class));
- }
-
-
protected void setUp() throws Exception {
- String className = "org.apache.axis2.rpc.RPCServiceClass";
- UtilServer.start();
- service = AxisService.createService(
- className, UtilServer.getConfigurationContext().getAxisConfiguration());
- service.setName("EchoXMLService");
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
-
- UtilServer.deployService(service);
- }
-
- protected void tearDown() throws Exception {
- UtilServer.unDeployService(serviceName);
- UtilServer.unDeployClientService();
- }
+ super.setUp();
+ deployClassAsService("EchoXMLService", RPCServiceClass.class);
+ }
public void testEditBean() throws AxisFault {
- configureSystem("editBean");
-
- Options options = new Options();
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
- options.setTo(targetEPR);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "editBean");
MyBean bean = new MyBean();
bean.setAge(100);
@@ -126,36 +66,15 @@
args.add(bean);
args.add("159");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "editBean", "req"), args.toArray());
MyBean resBean = (MyBean)BeanUtil.deserialize(MyBean.class, response.getFirstElement(),
new DefaultObjectSupplier(), null);
assertNotNull(resBean);
assertEquals(resBean.getAge(), 159);
}
- private void configureSystem(String opName) {
- targetEPR =
- new EndpointReference("http://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis2/services/EchoXMLService/" + opName);
- operationName = new QName("http://rpc.axis2.apache.org/xsd", opName, "req");
- AxisOperation axisOp = new InOutAxisOperation(operationName);
- axisOp.setMessageReceiver(new RPCMessageReceiver());
- axisOp.setStyle(WSDLConstants.STYLE_RPC);
- service.addOperation(axisOp);
- }
-
public void testEchoBean() throws AxisFault {
- configureSystem("echoBean");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoBean");
MyBean bean = new MyBean();
bean.setAge(100);
@@ -170,7 +89,7 @@
args.add(bean);
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoBean", "req"), args.toArray());
MyBean resBean = (MyBean)BeanUtil.deserialize(MyBean.class,
response.getFirstElement(),
new DefaultObjectSupplier(), null);
@@ -180,16 +99,7 @@
}
public void testechoMail() throws AxisFault {
- configureSystem("echoMail");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoMail");
Mail mail = new Mail();
mail.setBody("My Body");
@@ -203,7 +113,7 @@
args.add(mail);
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoMail", "req"), args.toArray());
Mail resBean = (Mail)BeanUtil.deserialize(Mail.class, response.getFirstElement(),
new DefaultObjectSupplier(), null);
// MyBean resBean =(MyBean) new BeanSerializer(MyBean.class,response).deserilze();
@@ -213,149 +123,79 @@
public void testEchoString() throws AxisFault {
- configureSystem("echoString");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoString");
ArrayList args = new ArrayList();
args.add("foo");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoString", "req"), args.toArray());
assertEquals(response.getFirstElement().getText(), "foo");
}
public void testEchoInt() throws AxisFault {
- configureSystem("echoInt");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoInt");
ArrayList args = new ArrayList();
args.add("100");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoInt", "req"), args.toArray());
assertEquals(Integer.parseInt(response.getFirstElement().getText()), 100);
}
public void testAdd() throws AxisFault {
- configureSystem("add");
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "add");
+
ArrayList args = new ArrayList();
args.add("100");
args.add("200");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "add", "req"), args.toArray());
assertEquals(Integer.parseInt(response.getFirstElement().getText()), 300);
}
public void testByteArray() throws AxisFault {
- configureSystem("testByteArray");
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "testByteArray");
+
ArrayList args = new ArrayList();
String hello = "hello";
args.add(hello.getBytes());
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "testByteArray", "req"), args.toArray());
assertEquals(response.getFirstElement().getText(), hello);
}
//
public void testDivide() throws AxisFault {
- configureSystem("divide");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
-
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "divide");
ArrayList args = new ArrayList();
args.add("10");
args.add("0");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "divide", "req"), args.toArray());
assertEquals(response.getFirstElement().getText(), "INF");
}
public void testEchoBool() throws AxisFault {
- configureSystem("echoBool");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoBool");
ArrayList args = new ArrayList();
args.add("true");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoBool", "req"), args.toArray());
assertEquals(Boolean.valueOf(response.getFirstElement().getText()).booleanValue(), true);
}
public void testEchoByte() throws AxisFault {
- configureSystem("echoByte");
-
- Options options = new Options();
-
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoByte");
ArrayList args = new ArrayList();
args.add("1");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoByte", "req"), args.toArray());
assertEquals(Byte.parseByte(response.getFirstElement().getText()), 1);
}
public void testCompany() throws AxisFault {
- configureSystem("echoCompany");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoCompany");
Company com = new Company();
com.setName("MyCompany");
@@ -380,21 +220,12 @@
com.setPersons(ps);
ArrayList args = new ArrayList();
args.add(com);
- sender.invokeBlocking(operationName, args.toArray());
+ sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoCompany", "req"), args.toArray());
}
public void testtestCompany() throws AxisFault {
- configureSystem("testCompanyArray");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "testCompanyArray");
Company com = new Company();
com.setName("MyCompany");
@@ -425,21 +256,12 @@
ArrayList req = new ArrayList();
req.add(args.toArray());
- OMElement value = sender.invokeBlocking(operationName, req.toArray());
+ OMElement value = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "testCompanyArray", "req"), req.toArray());
assertEquals("4", value.getFirstElement().getText());
}
public void testCompanyArray() throws AxisFault {
- configureSystem("CompanyArray");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "CompanyArray");
Company com = new Company();
com.setName("MyCompany");
@@ -475,7 +297,7 @@
resobj.add(Company.class);
resobj.add(Company.class);
resobj.add(Company.class);
- Object [] value = sender.invokeBlocking(operationName, req.toArray(),
+ Object [] value = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "CompanyArray", "req"), req.toArray(),
(Class[])resobj.toArray(new Class[resobj.size()]));
assertEquals(4, value.length);
assertEquals(((Company)value[0]).getName(), "MyCompany");
@@ -483,56 +305,29 @@
public void testEchoOM() throws AxisFault {
- configureSystem("echoOM");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoOM");
ArrayList args = new ArrayList();
args.add("1");
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoOM", "req"), args.toArray());
assertEquals(Byte.parseByte(response.getFirstElement().getFirstElement().getText()), 1);
}
public void testCalender() throws AxisFault {
zulu.setTimeZone(TimeZone.getTimeZone("GMT"));
- configureSystem("echoCalander");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoCalander");
ArrayList args = new ArrayList();
Date date = Calendar.getInstance().getTime();
args.add(zulu.format(date));
- OMElement response = sender.invokeBlocking(operationName, args.toArray());
+ OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoCalander", "req"), args.toArray());
assertEquals(response.getFirstElement().getText(), zulu.format(date));
}
////////////////////////////////////////////////// Invoking by Passing Return types //////////
public void testechoBean2() throws AxisFault {
- configureSystem("echoBean");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoBean");
MyBean bean = new MyBean();
bean.setAge(100);
@@ -549,7 +344,7 @@
ArrayList ret = new ArrayList();
ret.add(MyBean.class);
- Object [] response = sender.invokeBlocking(operationName, args.toArray(),
+ Object [] response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoBean", "req"), args.toArray(),
(Class[])ret.toArray(new Class[ret.size()]));
MyBean resBean = (MyBean)response[0];
assertNotNull(resBean);
@@ -557,16 +352,7 @@
}
public void testechoInt2() throws AxisFault {
- configureSystem("echoInt");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "echoInt");
ArrayList args = new ArrayList();
args.add("100");
@@ -574,7 +360,7 @@
ArrayList ret = new ArrayList();
ret.add(Integer.class);
- Object [] response = sender.invokeBlocking(operationName, args.toArray(),
+ Object [] response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "echoInt", "req"), args.toArray(),
(Class[])ret.toArray(new Class[ret.size()]));
assertEquals(((Integer)response[0]).intValue(), 100);
}
@@ -604,40 +390,22 @@
// }
public void testStringArray() throws AxisFault {
- configureSystem("handleStringArray");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "handleStringArray");
ArrayList args = new ArrayList();
String [] values = new String[] { "abc", "cde", "efg" };
args.add(values);
ArrayList ret = new ArrayList();
ret.add(Boolean.class);
- Object [] objs = sender.invokeBlocking(operationName, args.toArray(),
+ Object [] objs = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "handleStringArray", "req"), args.toArray(),
(Class[])ret.toArray(new Class[ret.size()]));
assertNotNull(objs);
assertEquals(Boolean.TRUE, Boolean.valueOf(objs[0].toString()));
}
public void testmultiArrays() throws AxisFault {
- configureSystem("multiArrays");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
-
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "multiArrays");
+
ArrayList args = new ArrayList();
String [] values = new String[] { "abc", "cde", "efg" };
args.add(values);
@@ -650,52 +418,35 @@
ArrayList ret = new ArrayList();
ret.add(Integer.class);
- Object [] objs = sender.invokeBlocking(operationName, args.toArray(),
+ Object [] objs = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "multiArrays", "req"), args.toArray(),
(Class[])ret.toArray(new Class[ret.size()]));
assertNotNull(objs);
assertEquals(19, Integer.parseInt(objs[0].toString()));
}
public void testmulReturn() throws AxisFault {
- configureSystem("mulReturn");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "mulReturn");
ArrayList args = new ArrayList();
args.add("foo");
- OMElement element = sender.invokeBlocking(operationName, args.toArray());
+ OMElement element = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org/xsd", "mulReturn", "req"), args.toArray());
System.out.println("element = " + element);
// assertEquals(response.getFirstElement().getText(), "foo");
}
public void testhandleArrayList() throws Exception {
- configureSystem("handleArrayList");
-
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "handleArrayList");
OMElement elem = sender.sendReceive(getPayload());
assertEquals(elem.getFirstElement().getText(), "abcdefghiklm10");
}
public void testomElementArray() throws Exception {
- configureSystem("omElementArray");
+ RPCServiceClient sender = getRPCClient("EchoXMLService", "omElementArray");
+
String str = "<req:omElementArray xmlns:req=\"http://rpc.axis2.apache.org/xsd\">\n" +
" <arg0><abc>vaue1</abc></arg0>\n" +
" <arg0><abc>vaue2</abc></arg0>\n" +
@@ -708,14 +459,6 @@
OMFactory fac = OMAbstractFactory.getOMFactory();
staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
- Options options = new Options();
- options.setTo(targetEPR);
- options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
-
- ConfigurationContext configContext =
- ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
- RPCServiceClient sender = new RPCServiceClient(configContext, null);
- sender.setOptions(options);
OMElement elem = sender.sendReceive(staxOMBuilder.getDocumentElement());
assertEquals("4", elem.getFirstElement().getText());
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileCacheTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileCacheTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileCacheTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileCacheTest.java Wed Jun 27 09:45:37 2007
@@ -21,6 +21,7 @@
import org.apache.axis2.Constants;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.util.Utils;
public class EchoRawSwAFileCacheTest extends EchoRawSwATest {
@@ -38,7 +39,7 @@
public static Test suite() {
return getTestSetup2(new TestSuite(EchoRawSwAFileCacheTest.class),
- Constants.TESTING_PATH + "SwA-fileCache-enabledRepository");
+ TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "SwA-fileCache-enabledRepository"));
}
protected void setUp() throws Exception {
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileInputTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileInputTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileInputTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwAFileInputTest.java Wed Jun 27 09:45:37 2007
@@ -25,6 +25,7 @@
import org.apache.axis2.description.Parameter;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.receivers.RawXMLINOutMessageReceiver;
import org.apache.axis2.wsdl.WSDLConstants;
@@ -53,7 +54,7 @@
public static Test suite() {
return getTestSetup2(new TestSuite(EchoRawSwAFileInputTest.class),
- Constants.TESTING_PATH + "MTOM-enabledRepository");
+ TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "MTOM-enabledRepository"));
}
protected void setUp() throws Exception {
@@ -78,7 +79,7 @@
Socket socket = new Socket("127.0.0.1", 5555);
OutputStream outStream = socket.getOutputStream();
socket.getInputStream();
- InputStream requestMsgInStream = new FileInputStream("test-resources/swa/swainput.bin");
+ InputStream requestMsgInStream = new FileInputStream(TestingUtils.prefixBaseDirectory("test-resources/swa/swainput.bin"));
int data;
while ((data = requestMsgInStream.read()) != -1) {
outStream.write(data);
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwATest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwATest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwATest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/swa/EchoRawSwATest.java Wed Jun 27 09:45:37 2007
@@ -37,6 +37,7 @@
import org.apache.axis2.engine.util.TestConstants;
import org.apache.axis2.integration.UtilServer;
import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.util.Utils;
import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.commons.logging.Log;
@@ -64,7 +65,7 @@
public static Test suite() {
return getTestSetup2(new TestSuite(EchoRawSwATest.class),
- Constants.TESTING_PATH + "SwA-enabledRepository");
+ TestingUtils.prefixBaseDirectory(Constants.TESTING_PATH + "SwA-enabledRepository"));
}
protected void setUp() throws Exception {
@@ -107,7 +108,7 @@
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
- "target/test-resources/integrationRepo", null);
+ TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
@@ -115,7 +116,7 @@
MessageContext mc = new MessageContext();
mc.setEnvelope(createEnvelope());
- FileDataSource fileDataSource = new FileDataSource("test-resources/mtom/test.jpg");
+ FileDataSource fileDataSource = new FileDataSource(TestingUtils.prefixBaseDirectory("test-resources/mtom/test.jpg"));
DataHandler dataHandler = new DataHandler(fileDataSource);
mc.addAttachment("FirstAttachment", dataHandler);
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/apache/axis2/transport/DualChannelRequestResponseRawXMLTest.java Wed Jun 27 09:45:37 2007
@@ -39,6 +39,7 @@
import org.apache.axis2.engine.Echo;
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.integration.TestingUtils;
import org.apache.axis2.mail.UtilsMailServer;
import org.apache.axis2.transport.mail.Constants;
import org.apache.axis2.transport.mail.server.MailServer;
@@ -100,8 +101,8 @@
Utils.createSimpleService(serviceName,
Echo.class.getName(),
operationName);
- UtilServer.start(org.apache.axis2.Constants.TESTING_PATH +
- "mail-transport-server-enabledRepository");
+ UtilServer.start(TestingUtils.prefixBaseDirectory(org.apache.axis2.Constants.TESTING_PATH +
+ "mail-transport-server-enabledRepository"));
UtilServer.deployService(service);
mailServer =
new MailServer(Constants.POP_SERVER_PORT,
Modified: webservices/axis2/branches/java/jaxws21/modules/integration/test/org/tempuri/BaseDataTypesTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/integration/test/org/tempuri/BaseDataTypesTest.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/integration/test/org/tempuri/BaseDataTypesTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/integration/test/org/tempuri/BaseDataTypesTest.java Wed Jun 27 09:45:37 2007
@@ -1,6 +1,7 @@
package org.tempuri;
import org.apache.ws.java2wsdl.Java2WSDLBuilder;
+import org.apache.axis2.integration.TestingUtils;
import org.custommonkey.xmlunit.XMLTestCase;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.Diff;
@@ -28,7 +29,7 @@
public class BaseDataTypesTest extends XMLTestCase {
- private String wsdlLocation = System.getProperty("basedir", ".") + "/" + "test-resources/BaseDataTypes.wsdl";
+ private String wsdlLocation = TestingUtils.prefixBaseDirectory("test-resources/BaseDataTypes.wsdl");
public void test1() throws Exception {
XMLUnit.setIgnoreWhitespace(true);
Modified: webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLBuilder.java Wed Jun 27 09:45:37 2007
@@ -1,12 +1,7 @@
package org.apache.ws.java2wsdl;
import org.apache.axiom.om.OMElement;
-import org.apache.axis2.description.java2wsdl.Java2WSDLConstants;
-import org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator;
-import org.apache.axis2.description.java2wsdl.NamespaceGenerator;
-import org.apache.axis2.description.java2wsdl.DefaultNamespaceGenerator;
-import org.apache.axis2.description.java2wsdl.Java2WSDLUtils;
-import org.apache.axis2.description.java2wsdl.SchemaGenerator;
+import org.apache.axis2.description.java2wsdl.*;
import org.apache.axis2.description.WSDL2Constants;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.description.AxisService2WSDL11;
@@ -70,6 +65,7 @@
private boolean pretty = true;
private String wsdlVersion = WSDL_VERSION_1;
private String schemaGenClassName = null;
+ private boolean generateDocLitBare =false;
public String getSchemaTargetNamespace() throws Exception {
if ( schemaTargetNamespace == null ) {
@@ -151,11 +147,15 @@
this.wsdlPrefix = wsdlPrefix;
}
- /**
- * @param out
- * @param className
- * @param classLoader
- */
+
+ public boolean isGenerateDocLitBare() {
+ return generateDocLitBare;
+ }
+
+ public void setGenerateDocLitBare(boolean generateDocLitBare) {
+ this.generateDocLitBare = generateDocLitBare;
+ }
+
public Java2WSDLBuilder(OutputStream out, String className, ClassLoader classLoader) {
this.out = out;
this.className = className;
@@ -163,11 +163,7 @@
}
- /**
- * Externally visible generator method
- *
- * @throws Exception
- */
+
public void generateWSDL() throws Exception {
SchemaGenerator schemaGenerator = resolveSchemaGen(classLoader,
className,
@@ -203,13 +199,16 @@
WSDL2Constants.MEP_URI_IN_OUT,
inOutmessageReceiver);
ConfigurationContext configCtx = ConfigurationContextFactory.createDefaultConfigurationContext();
+ AxisService service = new AxisService ();
+ schemaGenerator.setAxisService(service);
AxisService axisService = AxisService.createService(className,
serviceName == null ? Java2WSDLUtils.getSimpleClassName(className) : serviceName,
configCtx.getAxisConfiguration(),
messageReciverMap,
targetNamespace == null ? Java2WSDLUtils.namespaceFromClassName(className, classLoader, resolveNSGen()).toString() : targetNamespace,
classLoader,
- schemaGenerator);
+ schemaGenerator,service);
+ schemaGenerator.setAxisService(axisService);
axisService.setTargetNamespacePrefix(targetNamespacePrefix);
axisService.setSchemaTargetNamespace(getSchemaTargetNamespace());
axisService.setSchematargetNamespacePrefix(getSchemaTargetNamespacePrefix());
@@ -293,7 +292,7 @@
}
private NamespaceGenerator resolveNSGen() {
- NamespaceGenerator nsGen = null;
+ NamespaceGenerator nsGen ;
if(this.nsGenClassName == null){
nsGen = new DefaultNamespaceGenerator();
} else {
@@ -309,9 +308,18 @@
private SchemaGenerator resolveSchemaGen(ClassLoader loader, String className,
String schematargetNamespace,
String schematargetNamespacePrefix) throws Exception {
- SchemaGenerator schemaGen = null;
+ SchemaGenerator schemaGen ;
if(this.schemaGenClassName == null){
- schemaGen = new DefaultSchemaGenerator(loader, className, schematargetNamespace, schematargetNamespacePrefix);
+ if (generateDocLitBare) {
+ schemaGen = new DocLitBareSchemaGenerator(
+ loader, className, schematargetNamespace,
+ schematargetNamespacePrefix,null);
+ } else {
+ schemaGen = new DefaultSchemaGenerator(
+ loader, className, schematargetNamespace,
+ schematargetNamespacePrefix,null);
+ }
+
} else {
try {
Class clazz = Class.forName(this.schemaGenClassName);
@@ -320,7 +328,16 @@
schemaGen = (SchemaGenerator) constructor.newInstance(
new Object[]{loader, className, schematargetNamespace, schematargetNamespacePrefix});
} catch ( Exception e ) {
- schemaGen = new DefaultSchemaGenerator(loader, className, schematargetNamespace, schematargetNamespacePrefix);
+ if (generateDocLitBare) {
+ schemaGen = new DocLitBareSchemaGenerator(
+ loader, className, schematargetNamespace,
+ schematargetNamespacePrefix,null);
+ } else {
+ schemaGen = new DefaultSchemaGenerator(
+ loader, className, schematargetNamespace,
+ schematargetNamespacePrefix,null);
+ }
+
}
}
return schemaGen;
Modified: webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLCodegenEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLCodegenEngine.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLCodegenEngine.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/java2wsdl/src/org/apache/ws/java2wsdl/Java2WSDLCodegenEngine.java Wed Jun 27 09:45:37 2007
@@ -214,13 +214,15 @@
java2WsdlBuilder.setWSDLVersion(Java2WSDLConstants.WSDL_VERSION_2);
} //ignore the other cases - they'll be taken as 1.1
}
+
+ option = loadOption(Java2WSDLConstants.DOC_LIT_BARE,
+ Java2WSDLConstants.DOC_LIT_BARE_LONG,
+ optionsMap);
+ if (option != null) {
+ java2WsdlBuilder.setGenerateDocLitBare(true);
+ }
}
- /**
- * @param shortOption
- * @param longOption
- * @param options
- */
private Java2WSDLCommandLineOption loadOption(String shortOption, String longOption, Map options) {
//short option gets precedence
Java2WSDLCommandLineOption option = null;
@@ -250,7 +252,7 @@
if (option != null)
{
ArrayList optionValues = option.getOptionValues();
- String anOptionValue = "";
+ String anOptionValue ;
for ( int count = 0 ; count < optionValues.size() ; ++count )
{
anOptionValue = ((String)optionValues.get(count)).trim();
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxbri/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxbri/project.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxbri/project.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxbri/project.xml Wed Jun 27 09:45:37 2007
@@ -98,6 +98,15 @@
<artifactId>jaxb-api</artifactId>
<version>${jaxbapi.version}</version>
</dependency>
+<dependency>
+ <groupId>annogen</groupId>
+ <artifactId>annogen</artifactId>
+ <version>${annogen.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+
</dependencies>
<build>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/JaxbSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/JaxbSchemaGenerator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/JaxbSchemaGenerator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxbri/src/org/apache/axis2/jaxbri/JaxbSchemaGenerator.java Wed Jun 27 09:45:37 2007
@@ -51,7 +51,7 @@
String schematargetNamespace,
String schematargetNamespacePrefix)
throws Exception {
- super(loader, className, schematargetNamespace, schematargetNamespacePrefix);
+ super(loader, className, schematargetNamespace, schematargetNamespacePrefix,null);
}
public Collection generateSchema() throws Exception {
@@ -117,7 +117,7 @@
return itr.next();
}
- private List<Class<?>> processMethods(Method[] declaredMethods) throws Exception {
+ protected List<Class<?>> processMethods(Method[] declaredMethods) throws Exception {
List<Class<?>> list = new ArrayList<Class<?>>();
for (int i = 0; i < declaredMethods.length; i++) {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/maven.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/maven.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/maven.xml Wed Jun 27 09:45:37 2007
@@ -260,6 +260,14 @@
<arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/rpclitenum.wsdl"/>
</java>
+ <ant:echo>Generating java from rpclitstringarray.wsdl</ant:echo>
+ <java classname="com.sun.tools.xjc.Driver" fork="true">
+ <jvmarg line="${maven.junit.jvmargs2}"/>
+ <classpath refid="maven.dependency.classpath"/>
+ <classpath location="${compiled.classes.dir}"/>
+ <arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/rpclitstringarray.wsdl"/>
+ </java>
+
<ant:echo>Generating java from StringList.wsdl</ant:echo>
<java classname="com.sun.tools.xjc.Driver" fork="true">
<jvmarg line="${maven.junit.jvmargs2}"/>
@@ -581,10 +589,28 @@
</ant:fileset>
</ant:copy>
+ <!--
+ AddNumbersHandlerService is a bit of a special service. The files refered to by
+ the HandlerChain annotation(s) must live in a place relative to the class or interface
+ that carries the annotation. maven does not automagically copy non-class file resources,
+ so we have to copy them explicitly to their relevent locations.
+
+ The real problem, however, is that we don't have good separation of our server-side samples
+ from the client side. This means we have a mix-mashed classpath we have to deal with. For
+ this AddNumbersHandler case, it will use the classpath at target/test-classes, not
+ target/test-classes/services/AddNumbersHandlerService, so we need to make sure the
+ files refered to by the HandlerChain annotation(s) are in the classpath location, not
+ the desired server-side location. We need to fix our test config.
+ -->
+
<ant:copy toDir="target/test-classes/services/AddNumbersHandlerService/">
<ant:fileset dir="target/test-classes">
<ant:include name="org/apache/axis2/jaxws/sample/addnumbershandler/**"/>
</ant:fileset>
+ <!-- copy the AddNumbersHandlers.xml file to the server where it won't be found until we fix our test config. -->
+ <ant:fileset dir="test">
+ <ant:include name="org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlers.xml"/>
+ </ant:fileset>
<ant:fileset dir="test/org/apache/axis2/jaxws/sample/addnumbershandler">
<ant:include name="META-INF/**"/>
</ant:fileset>
@@ -593,6 +619,24 @@
</ant:fileset>
</ant:copy>
+ <!-- delete the impl class so we don't accidentally pick it up from the wrong place in the classpath
+ Although this does not fix the problem of looking in the wrong place for the file refered by @HandlerChain -->
+ <ant:delete file="target/test-classes/org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlerPortTypeImpl.class"/>
+
+ <!-- We have to explicitly copy the xml file refered to by the client interface HandlerChain annotation -->
+ <ant:copy toDir="target/test-classes/">
+ <ant:fileset dir="test">
+ <ant:include name="org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersClientHandlers.xml"/>
+ </ant:fileset>
+ </ant:copy>
+
+ <ant:copy toDir="target/test-classes/">
+ <ant:fileset dir="test">
+ <ant:include name="org/apache/axis2/jaxws/sample/addnumbershandler/AddNumbersHandlers.xml"/>
+ </ant:fileset>
+ </ant:copy>
+
+
<ant:copy toDir="target/test-classes/services/GreeterService/">
<ant:fileset dir="target/test-classes">
<ant:include name="org/apache/axis2/jaxws/sample/dlwmin/**"/>
@@ -728,7 +772,18 @@
<ant:include name="org/apache/axis2/jaxws/server/**"/>
</ant:fileset>
</ant:copy>
-
+ <ant:copy toDir="target/test-classes/services/RPCLitStringArrayService/">
+ <ant:fileset dir="target/test-classes">
+ <ant:include name="org/apache/axis2/jaxws/rpclit/stringarray/**"/>
+ <ant:include name="org/test/rpclit/stringarray/**"/>
+ </ant:fileset>
+ <ant:fileset dir="test/org/apache/axis2/jaxws/rpclit/stringarray/">
+ <ant:include name="META-INF/**"/>
+ </ant:fileset>
+ <ant:fileset dir="target/classes">
+ <ant:include name="org/apache/axis2/jaxws/server/**"/>
+ </ant:fileset>
+ </ant:copy>
</postGoal>
@@ -737,7 +792,6 @@
<jar destfile="target/jaxws-api-${jaxws.version}.jar">
<ant:fileset dir="target/classes">
<ant:exclude name="com/ibm/webservices/**"/>
- <ant:exclude name="META-INF/services/**"/>
</ant:fileset>
</jar>
<jar destfile="target/jaxws-impl-${jaxws.version}.jar">
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/pom.xml Wed Jun 27 09:45:37 2007
@@ -27,6 +27,10 @@
<name>Apache Axis 2.0 - JAXWS</name>
<description>Axis2 JAXWS Implementation</description>
<dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.0_spec</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
@@ -41,6 +45,12 @@
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-saaj-api</artifactId>
<version>${version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-javamail_1.4_spec</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
@@ -340,6 +350,12 @@
<classpath location="${compiled.classes.dir}"/>
<arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/AddNumbersHandler.wsdl"/>
</java>
+ <echo>Generating java from rpclitstringarray.wsdl</echo>
+ <java classname="com.sun.tools.xjc.Driver" fork="true">
+ <classpath refid="maven.runtime.classpath"/>
+ <classpath location="${compiled.classes.dir}"/>
+ <arg line="-d ${schema.generated.src.dir} -quiet -wsdl ${wsdl.source.dir}/rpclitstringarray.wsdl"/>
+ </java>
</tasks>
</configuration>
<goals>
@@ -753,6 +769,18 @@
<include name="org/apache/axis2/jaxws/server/**"/>
</fileset>
</copy>
+ <copy toDir="target/test-classes/services/RPCLitStringArrayService/">
+ <fileset dir="target/test-classes">
+ <include name="org/apache/axis2/jaxws/rpclit/stringarray/**"/>
+ <include name="org/test/rpclit/stringarray/**"/>
+ </fileset>
+ <fileset dir="test/org/apache/axis2/jaxws/rpclit/stringarray/">
+ <include name="META-INF/**"/>
+ </fileset>
+ <fileset dir="target/classes">
+ <include name="org/apache/axis2/jaxws/server/**"/>
+ </fileset>
+ </copy>
<copy toDir="target/test-classes/">
<fileset dir="test-resources/">
<include name="**/*.properties"/>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/project.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/project.xml?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/project.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/project.xml Wed Jun 27 09:45:37 2007
@@ -88,9 +88,6 @@
</resources>
<unitTest>
- <excludes>
- <exclude>**/JAXWSTest.java</exclude>
- </excludes>
<includes>
<include>**/*Test.java</include>
</includes>
@@ -137,6 +134,11 @@
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxbapi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.0_spec</artifactId>
+ <version>${geronimo.spec.annotation.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom</groupId>
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java Wed Jun 27 09:45:37 2007
@@ -24,7 +24,6 @@
import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactory;
import org.apache.axis2.jaxws.addressing.util.EndpointReferenceConverter;
import org.apache.axis2.jaxws.binding.BindingUtils;
-import org.apache.axis2.jaxws.binding.SOAPBinding;
import org.apache.axis2.jaxws.client.PropertyValidator;
import org.apache.axis2.jaxws.core.InvocationContext;
import org.apache.axis2.jaxws.core.MessageContext;
@@ -65,7 +64,7 @@
//TODO: Is this the best place for this code?
protected String addressingNamespace;
- private Binding binding; // force subclasses to use the lazy getter
+ private Binding binding = null;
private EndpointReferenceFactory eprFactory =
(EndpointReferenceFactory) FactoryRegistry.getFactory(EndpointReferenceFactory.class);
@@ -100,6 +99,19 @@
if (endpointAddress != null && !"".equals(endpointAddress)) {
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);
}
+
+ // JAXWS 9.2.1.1 requires that we go ahead and create the binding object
+ // so we can also set the handlerchain
+ if (binding == null) {
+ binding = BindingUtils.createBinding(endpointDesc);
+
+ // TODO should we allow the ServiceDelegate to figure out the default handlerresolver? Probably yes, since a client app may look for one there.
+ HandlerResolver handlerResolver =
+ serviceDelegate.getHandlerResolver() != null ? serviceDelegate.getHandlerResolver()
+ : new HandlerResolverImpl(endpointDesc);
+ binding.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
+ }
+
}
public ServiceDelegate getServiceDelegate() {
@@ -111,20 +123,6 @@
}
public Binding getBinding() {
-
- // TODO support HTTP binding when available
-
- // The default Binding is the SOAPBinding
- if (binding == null) {
- binding = new SOAPBinding(endpointDesc);
- // TODO should we allow the ServiceDelegate to figure out the
- // default handlerresolver? Probably yes, since a client app may
- // look for one there.
- HandlerResolver handlerResolver = serviceDelegate.getHandlerResolver() != null ? serviceDelegate
- .getHandlerResolver()
- : new HandlerResolverImpl(endpointDesc);
- binding.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
- }
return binding;
}
@@ -302,6 +300,9 @@
@Override
public synchronized Object put(String key, Object value) {
+ // super.put rightly throws a NullPointerException if key or value is null, so don't continue if that's the case
+ if (value == null)
+ return null;
if (PropertyValidator.validate(key, value)) {
return super.put(key, value);
} else {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/BindingImpl.java Wed Jun 27 09:45:37 2007
@@ -53,7 +53,11 @@
public BindingImpl(EndpointDescription endpointDesc) {
this.endpointDesc = endpointDesc;
- this.bindingId = endpointDesc.getBindingType();
+ // client
+ this.bindingId = endpointDesc.getClientBindingID();
+ if (this.bindingId == null)
+ // server
+ this.bindingId = endpointDesc.getBindingType();
}
public List<Handler> getHandlerChain() {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/binding/SOAPBinding.java Wed Jun 27 09:45:37 2007
@@ -28,7 +28,8 @@
import javax.xml.soap.SOAPFactory;
import javax.xml.ws.WebServiceException;
-import java.net.URI;
+import java.util.AbstractSet;
+import java.util.HashSet;
import java.util.Set;
/**
@@ -95,6 +96,9 @@
* @see javax.xml.ws.soap.SOAPBinding#getRoles()
*/
public Set<String> getRoles() {
+ // do not allow null roles, per the JAX-WS CTS
+ if (roles == null)
+ roles = new HashSet<String>();
return roles;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/PropertyMigrator.java Wed Jun 27 09:45:37 2007
@@ -31,13 +31,12 @@
public void migratePropertiesFromMessageContext(Map<String, Object> userContext,
MessageContext messageContext) {
-
+ userContext.putAll(messageContext.getProperties());
}
public void migratePropertiesToMessageContext(Map<String, Object> userContext,
MessageContext messageContext) {
- // Copy all of the properties from the request context into the MessageContext
- messageContext.getProperties().putAll(userContext);
+ messageContext.setProperties(userContext);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java?view=diff&rev=551228&r1=551227&r2=551228
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/client/async/AsyncResponse.java Wed Jun 27 09:45:37 2007
@@ -205,7 +205,10 @@
// TODO: IMPORTANT: this is the right call here, but beware that the messagecontext may be turned into
// a fault context with a fault message. We need to check for this and, if necessary, make an exception and throw it.
// Invoke inbound handlers.
- HandlerInvokerUtils.invokeInboundHandlers(response, response.getInvocationContext().getHandlers(), response.getEndpointDescription(), HandlerChainProcessor.MEP.RESPONSE, false);
+ HandlerInvokerUtils.invokeInboundHandlers(response.getMEPContext(),
+ response.getInvocationContext().getHandlers(),
+ HandlerChainProcessor.MEP.RESPONSE,
+ false);
// TODO: Check the type of the object to make sure it corresponds with
// the parameterized generic type.
@@ -249,7 +252,11 @@
// If it is the case that the message is null, there's no sense running through the handlers.
if (faultMessageContext.getMessage() != null)
// Invoke inbound handlers.
- HandlerInvokerUtils.invokeInboundHandlers(faultMessageContext, faultMessageContext.getInvocationContext().getHandlers(), faultMessageContext.getEndpointDescription(), HandlerChainProcessor.MEP.RESPONSE, false);
+ HandlerInvokerUtils.invokeInboundHandlers(faultMessageContext.getMEPContext(),
+ faultMessageContext.getInvocationContext()
+ .getHandlers(),
+ HandlerChainProcessor.MEP.RESPONSE,
+ false);
Throwable t = getFaultResponse(faultMessageContext);
if (t != null) {
return t;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org