index int64 0 0 | repo_id stringlengths 9 205 | file_path stringlengths 31 246 | content stringlengths 1 12.2M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | Create_ds/axis-axis1-java/test/wsdl/interop4 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupi/Round4XSDTestTestCase.java | /**
* Round4XSDTestTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupi;
import java.net.URL;
import java.util.Arrays;
import java.util.TimeZone;
public class Round4XSDTestTestCase extends junit.framework.TestCase {
public static URL url = null;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
url = new URL(args[0]);
} else {
url = new URL(new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoapAddress());
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(Round4XSDTestTestCase.class));
} // main
public Round4XSDTestTestCase(java.lang.String name) throws Exception {
super(name);
if (url == null) {
url = new URL(new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoapAddress());
}
}
public void test1Round4XSDTestSoapEchoVoid() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
jre.printStackTrace();
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.echoVoid();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test2Round4XSDTestSoapEchoInteger() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
int value = binding.echoInteger(1500);
assertEquals(value, 1500);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test3Round4XSDTestSoapEchoFloat() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
float value = binding.echoFloat(1500);
assertEquals(1500, value, 0.001F);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test4Round4XSDTestSoapEchoString() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.lang.String value = null;
value = binding.echoString(new java.lang.String("Hello World"));
assertEquals("Hello World", value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test5Round4XSDTestSoapEchoBase64() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
byte[] input = new byte[] {0xC, 0xA, 0xF, 0xE, 0xB, 0xA, 0xB, 0xE};
byte[] value = null;
value = binding.echoBase64(input);
assertTrue("Array values do not match", Arrays.equals(input, value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test6Round4XSDTestSoapEchoDate() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.util.Calendar input = java.util.Calendar.getInstance();
input.setTimeZone(TimeZone.getTimeZone("GMT"));
java.util.Calendar value = null;
value = binding.echoDate(input);
value.setTimeZone(TimeZone.getTimeZone("GMT"));
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test7Round4XSDTestSoapEchoComplexType() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.SOAPComplexType input = new test.wsdl.interop4.groupi.xsd.SOAPComplexType();
input.setVarFloat(1024);
input.setVarInt(2048);
input.setVarString("Hello World");
test.wsdl.interop4.groupi.xsd.SOAPComplexType value = binding.echoComplexType(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test8Round4XSDTestSoapEchoIntegerMultiOccurs() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.ArrayOfInt input = new test.wsdl.interop4.groupi.ArrayOfInt();
int[] input2 = new int[3];
input2[0] = 512;
input2[1] = 1024;
input2[2] = 2048;
input.set_int(input2);
int[] value = null;
value = binding.echoIntegerMultiOccurs(input);
assertEquals(input2.length, value.length);
for(int i=0;i<input2.length;i++) {
assertEquals("EchoIntegerMultiOccurs: Array values don't match", input2[i], value[i]);
}
assertTrue("Array values don't match", Arrays.equals(input2, value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test9Round4XSDTestSoapEchoFloatMultiOccurs() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.ArrayOfFloat input = new test.wsdl.interop4.groupi.ArrayOfFloat();
float[] input2 = new float[3];
input2[0] = 512;
input2[1] = 1024;
input2[2] = 2048;
input.set_float(input2);
float[] value = null;
value = binding.echoFloatMultiOccurs(input);
assertTrue("Array values don't match", Arrays.equals(input2, value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test10Round4XSDTestSoapEchoStringMultiOccurs() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.ArrayOfString input = new test.wsdl.interop4.groupi.ArrayOfString();
String[] input2 = new String[3];
input2[0] = "512";
input2[1] = "1024";
input2[2] = "2048";
input.setString(input2);
java.lang.String[] value = null;
value = binding.echoStringMultiOccurs(input);
assertTrue("Array values don't match", Arrays.equals(input2, value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test11Round4XSDTestSoapEchoComplexTypeMultiOccurs() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.ArrayOfSOAPComplexType input = new test.wsdl.interop4.groupi.xsd.ArrayOfSOAPComplexType();
input.setSOAPComplexType(new test.wsdl.interop4.groupi.xsd.SOAPComplexType[1]);
test.wsdl.interop4.groupi.xsd.SOAPComplexType input2 = new test.wsdl.interop4.groupi.xsd.SOAPComplexType();
input2.setVarFloat(1024);
input2.setVarInt(2048);
input2.setVarString("Hello World");
input.setSOAPComplexType(0,input2);
test.wsdl.interop4.groupi.xsd.SOAPComplexType[] value = null;
value = binding.echoComplexTypeMultiOccurs(input);
assertTrue("Array values don't match", Arrays.equals(input.getSOAPComplexType(), value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test12Round4XSDTestSoapEchoDecimal() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.math.BigDecimal input = new java.math.BigDecimal(512);
java.math.BigDecimal value = null;
value = binding.echoDecimal(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test13Round4XSDTestSoapEchoBoolean() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
boolean value = false;
value = binding.echoBoolean(true);
assertTrue("boolean value is not TRUE", value == true);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test14Round4XSDTestSoapEchoHexBinary() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
byte[] input = new byte[] {0xC, 0xA, 0xF, 0xE, 0xB, 0xA, 0xB, 0xE};
byte[] value = null;
value = binding.echoHexBinary(input);
assertTrue("Array values don't match", Arrays.equals(input, value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test15Round4XSDTestSoapEchoComplexTypeAsSimpleTypes() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.SOAPComplexType input = new test.wsdl.interop4.groupi.xsd.SOAPComplexType();
input.setVarFloat(1024);
input.setVarInt(2048);
input.setVarString("Hello World");
javax.xml.rpc.holders.StringHolder value1 = new javax.xml.rpc.holders.StringHolder();
javax.xml.rpc.holders.IntHolder value2 = new javax.xml.rpc.holders.IntHolder();
javax.xml.rpc.holders.FloatHolder value3 = new javax.xml.rpc.holders.FloatHolder();
binding.echoComplexTypeAsSimpleTypes(input, value1, value2, value3);
assertEquals(input.getVarString(), value1.value);
assertEquals(input.getVarInt(), value2.value);
assertEquals(input.getVarFloat(), value3.value, 0.01F);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test16Round4XSDTestSoapEchoSimpleTypesAsComplexType() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.SOAPComplexType value = null;
value = binding.echoSimpleTypesAsComplexType(new java.lang.String("Hello World"), 1024, 2048);
assertEquals(value.getVarString(), "Hello World");
assertEquals(value.getVarInt(), 1024);
assertEquals(value.getVarFloat(), 2048, 0.01F);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test17Round4XSDTestSoapEchoNestedComplexType() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.SOAPComplexTypeComplexType input = new test.wsdl.interop4.groupi.xsd.SOAPComplexTypeComplexType();
input.setVarFloat(512);
input.setVarInt(1024);
input.setVarString("Hello World");
test.wsdl.interop4.groupi.xsd.SOAPComplexType input2 = new test.wsdl.interop4.groupi.xsd.SOAPComplexType();
input2.setVarFloat(1024);
input2.setVarInt(2048);
input2.setVarString("Hello World");
input.setVarComplexType(input2);
test.wsdl.interop4.groupi.xsd.SOAPComplexTypeComplexType value = null;
value = binding.echoNestedComplexType(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test18Round4XSDTestSoapEchoNestedMultiOccurs() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.SOAPMultiOccursComplexType input = new test.wsdl.interop4.groupi.xsd.SOAPMultiOccursComplexType();
input.setVarFloat(512);
input.setVarInt(1024);
input.setVarString("H W");
test.wsdl.interop4.groupi.xsd.ArrayOfString varMultiOccurs = new test.wsdl.interop4.groupi.xsd.ArrayOfString();
varMultiOccurs.setString(new String[]{"A","B","C"});
input.setVarMultiOccurs(varMultiOccurs);
test.wsdl.interop4.groupi.xsd.SOAPMultiOccursComplexType value = null;
value = binding.echoNestedMultiOccurs(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test19Round4XSDTestSoapEchoChoice() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
//TODO: What does this do?
test.wsdl.interop4.groupi.xsd.ChoiceComplexType input = new test.wsdl.interop4.groupi.xsd.ChoiceComplexType();
input.setName0("Hello");
//input.setName1("World");
test.wsdl.interop4.groupi.xsd.ChoiceComplexType value = null;
value = binding.echoChoice(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test20Round4XSDTestSoapEchoEnum() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.xsd.Enum input = test.wsdl.interop4.groupi.xsd.Enum.BitOne;
test.wsdl.interop4.groupi.xsd.Enum value = null;
value = binding.echoEnum(input);
assertEquals(input, value);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test21Round4XSDTestSoapRetAnyType() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.lang.Object input = new java.lang.String("Hello World");
java.lang.Object value = null;
value = binding.echoAnyType(input);
assertEquals(value, input);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test22Round4XSDTestSoapRetAny() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.interop4.groupi.EchoAnyElementInputAny input = new test.wsdl.interop4.groupi.EchoAnyElementInputAny();
org.apache.axis.message.MessageElement [] _any = new org.apache.axis.message.MessageElement [1];
_any[0] = new org.apache.axis.message.MessageElement("hello", "world");
input.set_any(_any);
test.wsdl.interop4.groupi.EchoAnyElementResponseReturn value = null;
value = binding.echoAnyElement(input);
assertEquals(value.get_any()[0].getQName(), _any[0].getQName());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test23Round4XSDTestSoapEchoVoidSoapHeader() {
test.wsdl.interop4.groupi.Round4XSDTestSoap binding;
try {
binding = new test.wsdl.interop4.groupi.Round4XSDTestLocator().getRound4XSDTestSoap(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Round4XSDTestSoapStub stub = (Round4XSDTestSoapStub) binding;
String namespace = url.toString();
stub.setHeader(namespace, "test1", "header1");
stub.setHeader(namespace, "test2", "header2");
binding.echoVoidSoapHeader();
assertEquals(stub.getHeader(namespace, "test1").getObjectValue(), "header1");
assertEquals(stub.getHeader(namespace, "test2").getObjectValue(), "header2");
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
}
| 6,500 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupi/Round4XSDTestSoapImpl.java | /**
* Round4XSDTestSoapImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupi;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPHeaderElement;
import java.util.Vector;
public class Round4XSDTestSoapImpl implements test.wsdl.interop4.groupi.Round4XSDTestSoap{
public void echoVoid() throws java.rmi.RemoteException {
return;
}
public int echoInteger(int inputInteger) throws java.rmi.RemoteException {
return inputInteger;
}
public float echoFloat(float inputFloat) throws java.rmi.RemoteException {
return inputFloat;
}
public java.lang.String echoString(java.lang.String inputString) throws java.rmi.RemoteException {
return inputString;
}
public byte[] echoBase64(byte[] inputBase64) throws java.rmi.RemoteException {
return inputBase64;
}
public java.util.Calendar echoDate(java.util.Calendar inputDate) throws java.rmi.RemoteException {
return inputDate;
}
public test.wsdl.interop4.groupi.xsd.SOAPComplexType echoComplexType(test.wsdl.interop4.groupi.xsd.SOAPComplexType inputComplexType) throws java.rmi.RemoteException {
return inputComplexType;
}
public int[] echoIntegerMultiOccurs(test.wsdl.interop4.groupi.ArrayOfInt inputIntegerMultiOccurs) throws java.rmi.RemoteException {
return inputIntegerMultiOccurs.get_int();
}
public float[] echoFloatMultiOccurs(test.wsdl.interop4.groupi.ArrayOfFloat inputFloatMultiOccurs) throws java.rmi.RemoteException {
return inputFloatMultiOccurs.get_float();
}
public java.lang.String[] echoStringMultiOccurs(test.wsdl.interop4.groupi.ArrayOfString inputStringMultiOccurs) throws java.rmi.RemoteException {
return inputStringMultiOccurs.getString();
}
public test.wsdl.interop4.groupi.xsd.SOAPComplexType[] echoComplexTypeMultiOccurs(test.wsdl.interop4.groupi.xsd.ArrayOfSOAPComplexType inputComplexTypeMultiOccurs) throws java.rmi.RemoteException {
return inputComplexTypeMultiOccurs.getSOAPComplexType();
}
public java.math.BigDecimal echoDecimal(java.math.BigDecimal inputDecimal) throws java.rmi.RemoteException {
return inputDecimal;
}
public boolean echoBoolean(boolean inputBoolean) throws java.rmi.RemoteException {
return inputBoolean;
}
public byte[] echoHexBinary(byte[] inputHexBinary) throws java.rmi.RemoteException {
return inputHexBinary;
}
public void echoComplexTypeAsSimpleTypes(test.wsdl.interop4.groupi.xsd.SOAPComplexType inputComplexType, javax.xml.rpc.holders.StringHolder outputString, javax.xml.rpc.holders.IntHolder outputInteger, javax.xml.rpc.holders.FloatHolder outputFloat) throws java.rmi.RemoteException {
outputString.value = new java.lang.String(inputComplexType.getVarString());
outputInteger.value = inputComplexType.getVarInt();
outputFloat.value = inputComplexType.getVarFloat();
}
public test.wsdl.interop4.groupi.xsd.SOAPComplexType echoSimpleTypesAsComplexType(java.lang.String inputString, int inputInteger, float inputFloat) throws java.rmi.RemoteException {
test.wsdl.interop4.groupi.xsd.SOAPComplexType output = new test.wsdl.interop4.groupi.xsd.SOAPComplexType();
output.setVarFloat(inputFloat);
output.setVarInt(inputInteger);
output.setVarString(inputString);
return output;
}
public test.wsdl.interop4.groupi.xsd.SOAPComplexTypeComplexType echoNestedComplexType(test.wsdl.interop4.groupi.xsd.SOAPComplexTypeComplexType inputComplexType) throws java.rmi.RemoteException {
return inputComplexType;
}
public test.wsdl.interop4.groupi.xsd.SOAPMultiOccursComplexType echoNestedMultiOccurs(test.wsdl.interop4.groupi.xsd.SOAPMultiOccursComplexType inputComplexType) throws java.rmi.RemoteException {
return inputComplexType;
}
public test.wsdl.interop4.groupi.xsd.ChoiceComplexType echoChoice(test.wsdl.interop4.groupi.xsd.ChoiceComplexType inputChoice) throws java.rmi.RemoteException {
return inputChoice;
}
public test.wsdl.interop4.groupi.xsd.Enum echoEnum(test.wsdl.interop4.groupi.xsd.Enum inputEnum) throws java.rmi.RemoteException {
return inputEnum;
}
public java.lang.Object echoAnyType(java.lang.Object inputAnyType) throws java.rmi.RemoteException {
return inputAnyType;
}
public test.wsdl.interop4.groupi.EchoAnyElementResponseReturn echoAnyElement(test.wsdl.interop4.groupi.EchoAnyElementInputAny inputAny) throws java.rmi.RemoteException {
test.wsdl.interop4.groupi.EchoAnyElementResponseReturn output = new test.wsdl.interop4.groupi.EchoAnyElementResponseReturn();
output.set_any(inputAny.get_any());
return output;
}
public void echoVoidSoapHeader() throws java.rmi.RemoteException {
MessageContext context = MessageContext.getCurrentContext();
Message request = context.getRequestMessage();
Message response = context.getResponseMessage();
Vector headers = request.getSOAPEnvelope().getHeaders();
for (int i=0;i<headers.size();i++) {
SOAPHeaderElement header = (SOAPHeaderElement)headers.get(i);
response.getSOAPEnvelope().addHeader(header);
}
}
}
| 6,501 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/complexDocLit/ComplexDocLitBindingImpl.java | /**
* ComplexDocLitBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.complexDocLit;
public class ComplexDocLitBindingImpl implements ComplexDocLitPortType{
public EchoSOAPStructFaultResponse echoSOAPStructFault(SOAPStruct param) throws java.rmi.RemoteException, SOAPStructFault {
throw new SOAPStructFault(param);
}
public EchoBaseStructFaultResponse echoBaseStructFault(BaseStruct param) throws java.rmi.RemoteException, BaseStruct {
throw param;
}
public EchoExtendedStructFaultResponse echoExtendedStructFault(ExtendedStruct param) throws java.rmi.RemoteException, ExtendedStruct {
throw param;
}
public EchoMultipleFaults1Response echoMultipleFaults1(EchoMultipleFaults1Request param) throws java.rmi.RemoteException, BaseStruct, SOAPStructFault {
if (param.getWhichFault() == 2) {
throw param.getParam2();
}
throw new SOAPStructFault(param.getParam1());
}
public EchoMultipleFaults2Response echoMultipleFaults2(EchoMultipleFaults2Request param) throws java.rmi.RemoteException, MoreExtendedStruct, ExtendedStruct, BaseStruct {
if (param.getWhichFault() == 2) {
throw param.getParam2();
} else if (param.getWhichFault() == 3) {
throw param.getParam3();
}
throw param.getParam1();
}
}
| 6,502 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/complexDocLit/ComplexDocLitServiceTestCase.java | /**
* ComplexDocLitServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.complexDocLit;
import java.net.URL;
public class ComplexDocLitServiceTestCase extends junit.framework.TestCase {
public static URL url = null;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
url = new URL(args[0]);
} else {
url = new URL(new ComplexDocLitServiceLocator().getComplexDocLitPortAddress());
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(ComplexDocLitServiceTestCase.class));
} // main
public ComplexDocLitServiceTestCase(java.lang.String name) throws Exception {
super(name);
if (url == null) {
url = new URL(new ComplexDocLitServiceLocator().getComplexDocLitPortAddress());
}
}
/* FIXME: RUNTIME WSDL broken.
public void testComplexDocLitPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.interop4.groupH.complexDocLit.ComplexDocLitServiceLocator().getComplexDocLitPortAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.interop4.groupH.complexDocLit.ComplexDocLitServiceLocator().getServiceName());
assertTrue(service != null);
}
*/
public void test1ComplexDocLitPortEchoSOAPStructFault() throws Exception {
ComplexDocLitPortType binding;
try {
binding = new ComplexDocLitServiceLocator().getComplexDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
SOAPStruct soapStruct = new SOAPStruct();
soapStruct.setVarFloat(1.1F);
soapStruct.setVarInt(3);
soapStruct.setVarString("Fault test");
try {
binding.echoSOAPStructFault(soapStruct);
}
catch (SOAPStructFault e1) {
assertEquals("SOAPStruct values not equal",
soapStruct, e1.getSoapStruct());
return;
}
fail("Should have caught exception!");
}
public void test2ComplexDocLitPortEchoBaseStructFault() throws Exception {
ComplexDocLitPortType binding;
try {
binding = new ComplexDocLitServiceLocator().getComplexDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
short s = 30;
SOAPStruct soapStruct = new SOAPStruct();
soapStruct.setVarFloat(1.1F);
soapStruct.setVarInt(3);
soapStruct.setVarString("Fault test");
BaseStruct param = new BaseStruct(soapStruct, s);
try {
binding.echoBaseStructFault(param);
}
catch (BaseStruct e1) {
assertEquals("BaseStruct values not equal", param, e1);
return;
}
fail("Should have caught exception!");
}
public void test3ComplexDocLitPortEchoExtendedStructFault() throws Exception {
ComplexDocLitPortType binding;
try {
binding = new ComplexDocLitServiceLocator().getComplexDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
ExtendedStruct extended = new ExtendedStruct();
SOAPStruct soapStruct = new SOAPStruct();
soapStruct.setVarFloat(1.1F);
soapStruct.setVarInt(3);
soapStruct.setVarString("Fault test");
extended.setIntMessage(1);
extended.setAnotherIntMessage(2);
extended.setStructMessage(soapStruct);
extended.setShortMessage((short)5);
extended.setStringMessage("This is an ExtendedStruct");
try {
binding.echoExtendedStructFault(extended);
}
catch (ExtendedStruct e1) {
assertEquals("ExtendedStruct values not equal", extended, e1);
return;
}
fail("Should have caught exception!");
}
public void test4ComplexDocLitPortEchoMultipleFaults1() throws Exception {
ComplexDocLitPortType binding;
try {
binding = new ComplexDocLitServiceLocator().getComplexDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
BaseStruct base = new BaseStruct();
base.setShortMessage((short)4);
SOAPStruct soapStruct = new SOAPStruct();
soapStruct.setVarFloat(1.1F);
soapStruct.setVarInt(3);
soapStruct.setVarString("Fault test");
base.setStructMessage(soapStruct);
SOAPStruct struct = new SOAPStruct();
struct.setVarFloat(1.1F);
struct.setVarInt(5);
struct.setVarString("Twas a dark and stormy night...");
for (int i = 1; i < 3; i++) {
try {
EchoMultipleFaults1Request param =
new EchoMultipleFaults1Request();
param.setWhichFault(i);
param.setParam1(struct);
param.setParam2(base);
binding.echoMultipleFaults1(param);
}
catch (BaseStruct e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 2, i);
assertEquals("Bad data echoed", base, e1);
continue;
}
catch (SOAPStructFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 1, i);
assertEquals("Bad data echoed", struct, e2.getSoapStruct());
continue;
}
fail("Should have caught exception!");
}
}
public void test5ComplexDocLitPortEchoMultipleFaults2() throws Exception {
ComplexDocLitPortType binding;
try {
binding = new ComplexDocLitServiceLocator().getComplexDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
SOAPStruct struct = new SOAPStruct();
struct.setVarFloat(1.1F);
struct.setVarInt(5);
struct.setVarString("Twas a dark and stormy night...");
// Test operation
BaseStruct base = new BaseStruct();
base.setShortMessage((short)4);
base.setStructMessage(struct);
ExtendedStruct extended = new ExtendedStruct();
extended.setIntMessage(1);
extended.setAnotherIntMessage(2);
extended.setShortMessage((short)5);
extended.setStringMessage("This is an ExtendedStruct");
extended.setStructMessage(struct);
MoreExtendedStruct moreExtended = new MoreExtendedStruct();
moreExtended.setBooleanMessage(true);
moreExtended.setIntMessage(2);
moreExtended.setAnotherIntMessage(3);
moreExtended.setShortMessage((short)9);
moreExtended.setStringMessage("This is a MoreExtendedStruct");
moreExtended.setStructMessage(struct);
// Test operation multiple times
for (int i = 1; i < 4; i++) {
try {
EchoMultipleFaults2Request param =
new EchoMultipleFaults2Request();
param.setWhichFault(i);
param.setParam1(base);
param.setParam2(extended);
param.setParam3(moreExtended);
binding.echoMultipleFaults2(param);
}
catch (MoreExtendedStruct e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 3, i);
assertEquals("Bad data echoed", moreExtended, e3);
continue;
}
catch (ExtendedStruct e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals("Bad data echoed", extended, e2);
continue;
}
catch (BaseStruct e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
assertEquals("Bad data echoed", base, e1);
continue;
}
fail("Should have caught exception!");
}
}
}
| 6,503 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/simpleDocLit/SimpleDocLitBindingImpl.java | /**
* SimpleDocLitBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.simpleDocLit;
public class SimpleDocLitBindingImpl implements test.wsdl.interop4.groupH.simpleDocLit.SimpleDocLitPortType{
public test.wsdl.interop4.groupH.simpleDocLit.EchoEmptyFaultResponse echoEmptyFault(test.wsdl.interop4.groupH.simpleDocLit.EchoEmptyFaultRequest param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.EmptyPart {
throw new EmptyPart();
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoStringFaultResponse echoStringFault(String param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.StringFault {
throw new StringFault(param);
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoIntArrayFaultResponse echoIntArrayFault(test.wsdl.interop4.groupH.simpleDocLit.ArrayOfInt param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.ArrayOfInt {
throw param;
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults1Response echoMultipleFaults1(test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults1Request param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.ArrayOfFloat, test.wsdl.interop4.groupH.simpleDocLit.StringFault, test.wsdl.interop4.groupH.simpleDocLit.EmptyPart {
switch (param.getWhichFault()) {
case 2:
throw new StringFault(param.getParam1());
case 3:
throw new ArrayOfFloat(param.getParam2().getValue());
default:
throw new EmptyPart();
}
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults2Response echoMultipleFaults2(test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults2Request param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.ArrayOfString, test.wsdl.interop4.groupH.simpleDocLit.FloatFault, test.wsdl.interop4.groupH.simpleDocLit.StringFault {
switch (param.getWhichFault()) {
case 2:
throw new StringFault(param.getParam1());
case 3:
throw new ArrayOfString(param.getParam3().getValue());
default:
throw new FloatFault(param.getParam2());
}
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults3Response echoMultipleFaults3(test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults3Request param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.String2Fault, test.wsdl.interop4.groupH.simpleDocLit.StringFault {
switch (param.getWhichFault()) {
case 2:
throw new String2Fault(param.getParam2());
default:
throw new StringFault(param.getParam1());
}
}
public test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults4Response echoMultipleFaults4(test.wsdl.interop4.groupH.simpleDocLit.EchoMultipleFaults4Request param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleDocLit.EnumFault, test.wsdl.interop4.groupH.simpleDocLit.IntFault {
switch (param.getWhichFault()) {
case 2:
throw new EnumFault(param.getParam2());
default:
throw new IntFault(param.getParam1());
}
}
}
| 6,504 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/simpleDocLit/SimpleDocLitServiceTestCase.java | /**
* SimpleDocLitServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.simpleDocLit;
import java.net.URL;
public class SimpleDocLitServiceTestCase extends junit.framework.TestCase {
public static URL url = null;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
url = new URL(args[0]);
} else {
url = new URL(new SimpleDocLitServiceLocator().getSimpleDocLitPortAddress());
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(SimpleDocLitServiceTestCase.class));
} // main
public SimpleDocLitServiceTestCase(java.lang.String name) throws Exception {
super(name);
if (url == null) {
url = new URL(new SimpleDocLitServiceLocator().getSimpleDocLitPortAddress());
}
}
public void test1SimpleDocLitPortEchoEmptyFault() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
try {
binding.echoEmptyFault(new EchoEmptyFaultRequest());
}
catch (EmptyPart e1) {
return; // success!
}
fail("Should have caught exception");
}
public void test2SimpleDocLitPortEchoStringFault() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
try {
binding.echoStringFault("testString");
}
catch (StringFault e1) {
assertEquals("String values didn't match", "testString", e1.getPart2());
return;
}
fail("Should have caught exception");
}
public void test3SimpleDocLitPortEchoIntArrayFault() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
int[] param = new int[] {1, 2, 3};
// Test operation
try {
binding.echoIntArrayFault(new ArrayOfInt(param));
}
catch (ArrayOfInt e1) {
int[] ret = e1.getValue();
assertEquals("Array element 1", param[0], ret[0]);
assertEquals("Array element 2", param[1], ret[1]);
assertEquals("Array element 3", param[2], ret[2]);
return;
}
fail("Should have caught exception");
}
public void test4SimpleDocLitPortEchoMultipleFaults1() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
float[] floatParam = new float[] {1.0F, 2.2F, 3.5F};
String stringParam = "HELLO";
for (int i=1; i < 4; i++) {
try {
EchoMultipleFaults1Request request =
new EchoMultipleFaults1Request();
request.setWhichFault(i);
request.setParam1(stringParam);
request.setParam2(new ArrayOfFloat(floatParam));
binding.echoMultipleFaults1(request);
}
catch (ArrayOfFloat e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 3, i);
float[] ret = e1.getValue();
assertEquals(floatParam[0], ret[0], 0.01F);
assertEquals(floatParam[1], ret[1], 0.01F);
assertEquals(floatParam[2], ret[2], 0.01F);
continue;
}
catch (StringFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals("HELLO", e2.getPart2());
continue;
}
catch (EmptyPart e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 1, i);
continue;
}
fail("Should have caught exception");
}
}
public void test5SimpleDocLitPortEchoMultipleFaults2() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
String stringParam = "HELLO";
String[] stringArrayParam = new String[] {"one", "two", "three"};
float floatParam = 9.7F;
for (int i=1; i < 4; i++) {
try {
EchoMultipleFaults2Request request =
new EchoMultipleFaults2Request();
request.setWhichFault(i);
request.setParam1(stringParam);
request.setParam2(floatParam);
request.setParam3(new ArrayOfString(stringArrayParam));
binding.echoMultipleFaults2(request);
}
catch (ArrayOfString e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 3, i);
String[] ret = e1.getValue();
assertEquals("Array element 1", stringArrayParam[0], ret[0]);
assertEquals("Array element 2", stringArrayParam[1], ret[1]);
assertEquals("Array element 3", stringArrayParam[2], ret[2]);
continue;
}
catch (FloatFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 1, i);
assertEquals(floatParam, e2.getPart4(), 0.01F);
continue;
}
catch (StringFault e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 2, i);
assertEquals(stringParam, e3.getPart2());
continue;
}
fail("Should have caught exception");
}
}
public void test6SimpleDocLitPortEchoMultipleFaults3() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
String param1 = "Param1";
String param2 = "Param2";
for (int i=1; i < 3; i++) {
try {
EchoMultipleFaults3Request request =
new EchoMultipleFaults3Request();
request.setWhichFault(i);
request.setParam1(param1);
request.setParam2(param2);
binding.echoMultipleFaults3(request);
}
catch (String2Fault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 2, i);
assertEquals(param2, e1.getPart2());
continue;
}
catch (StringFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 1, i);
assertEquals(param1, e2.getPart2());
continue;
}
fail("Should have caught exception");
}
}
public void test7SimpleDocLitPortEchoMultipleFaults4() throws Exception {
SimpleDocLitPortType binding;
try {
binding = new SimpleDocLitServiceLocator().getSimpleDocLitPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// Test operation
int intParam = 66;
Enum enumParam = new Enum(1);
for (int i=1; i < 3; i++) {
try {
EchoMultipleFaults4Request request =
new EchoMultipleFaults4Request();
request.setWhichFault(i);
request.setParam1(intParam);
request.setParam2(enumParam);
binding.echoMultipleFaults4(request);
}
catch (EnumFault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 2, i);
assertEquals(enumParam.getValue(), e1.getPart9().getValue());
continue;
}
catch (IntFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 1, i);
assertEquals(intParam, e2.getPart3());
continue;
}
fail("Should have caught exception");
}
}
}
| 6,505 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/complexRPCenc/ComplexRpcEncBindingImpl.java | /**
* ComplexRpcEncBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.complexRPCenc;
public class ComplexRpcEncBindingImpl implements test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType{
public void echoSOAPStructFault(test.wsdl.interop4.groupH.complexRPCenc.SOAPStructFault param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.complexRPCenc.SOAPStructFault {
throw param;
}
public void echoBaseStructFault(test.wsdl.interop4.groupH.complexRPCenc.BaseStruct param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.complexRPCenc.BaseStruct {
throw param;
}
public void echoExtendedStructFault(test.wsdl.interop4.groupH.complexRPCenc.ExtendedStruct param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.complexRPCenc.ExtendedStruct {
throw param;
}
public void echoMultipleFaults1(int whichFault, test.wsdl.interop4.groupH.complexRPCenc.SOAPStruct param1, test.wsdl.interop4.groupH.complexRPCenc.BaseStruct param2) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.complexRPCenc.BaseStruct, test.wsdl.interop4.groupH.complexRPCenc.SOAPStructFault {
if (whichFault == 2) {
throw param2;
}
throw new SOAPStructFault(param1);
}
public void echoMultipleFaults2(int whichFault, test.wsdl.interop4.groupH.complexRPCenc.BaseStruct param1, test.wsdl.interop4.groupH.complexRPCenc.ExtendedStruct param2, test.wsdl.interop4.groupH.complexRPCenc.MoreExtendedStruct param3) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.complexRPCenc.MoreExtendedStruct, test.wsdl.interop4.groupH.complexRPCenc.ExtendedStruct, test.wsdl.interop4.groupH.complexRPCenc.BaseStruct {
if (whichFault == 2) {
throw param2;
} else if (whichFault == 3) {
throw param3;
}
throw param1;
}
}
| 6,506 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/complexRPCenc/ComplexRpcEncServiceTestCase.java | /**
* ComplexRpcEncServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.interop4.groupH.complexRPCenc;
import java.net.URL;
public class ComplexRpcEncServiceTestCase extends junit.framework.TestCase {
public static URL url = null;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
url = new URL(args[0]);
} else {
url = new URL(new ComplexRpcEncServiceLocator().getComplexRpcEncPortAddress());
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(ComplexRpcEncServiceTestCase.class));
} // main
public ComplexRpcEncServiceTestCase(java.lang.String name) throws Exception {
super(name);
if (url == null) {
url = new URL(new ComplexRpcEncServiceLocator().getComplexRpcEncPortAddress());
}
}
public void test1ComplexRpcEncPortEchoSOAPStructFault() throws Exception {
test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType binding;
try {
binding = new test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncServiceLocator().getComplexRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
SOAPStruct soapStruct = new SOAPStruct();
soapStruct.setVarFloat(1.1F);
soapStruct.setVarInt(3);
soapStruct.setVarString("Fault test");
// Test operation
try {
SOAPStructFault param = new SOAPStructFault(soapStruct);
binding.echoSOAPStructFault(param);
}
catch (test.wsdl.interop4.groupH.complexRPCenc.SOAPStructFault e1) {
assertEquals("SOAPStruct values not equal",
soapStruct, e1.getSoapStruct());
return;
}
fail("Should have caught exception!");
}
public void test2ComplexRpcEncPortEchoBaseStructFault() throws Exception {
test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType binding;
try {
binding = new test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncServiceLocator().getComplexRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
short s = 30;
BaseStruct param = new BaseStruct(1.1F, s);
// Test operation
try {
binding.echoBaseStructFault(param);
}
catch (test.wsdl.interop4.groupH.complexRPCenc.BaseStruct e1) {
assertEquals("BaseStruct values not equal", param, e1);
return;
}
fail("Should have caught exception!");
}
public void test3ComplexRpcEncPortEchoExtendedStructFault() throws Exception {
test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType binding;
try {
binding = new test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncServiceLocator().getComplexRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
ExtendedStruct extended = new ExtendedStruct();
extended.setIntMessage(1);
extended.setAnotherIntMessage(2);
extended.setFloatMessage(3.3F);
extended.setShortMessage((short)5);
extended.setStringMessage("This is an ExtendedStruct");
// Test operation
try {
binding.echoExtendedStructFault(extended);
}
catch (test.wsdl.interop4.groupH.complexRPCenc.ExtendedStruct e1) {
assertEquals("ExtendedStruct values not equal", extended, e1);
return;
}
fail("Should have caught exception!");
}
public void test4ComplexRpcEncPortEchoMultipleFaults1() throws Exception {
test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType binding;
try {
binding = new test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncServiceLocator().getComplexRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
BaseStruct base = new BaseStruct();
base.setFloatMessage(2.2F);
base.setShortMessage((short)4);
SOAPStruct struct = new SOAPStruct();
struct.setVarFloat(1.1F);
struct.setVarInt(5);
struct.setVarString("Twas a dark and stormy night...");
for (int i = 1; i < 3; i++) {
// Test operation
try {
binding.echoMultipleFaults1(i, struct, base);
}
catch (test.wsdl.interop4.groupH.complexRPCenc.BaseStruct e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 2, i);
assertEquals("Bad data echoed", base, e1);
continue;
}
catch (test.wsdl.interop4.groupH.complexRPCenc.SOAPStructFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 1, i);
assertEquals("Bad data echoed", struct, e2.getSoapStruct());
continue;
}
fail("Should have caught exception!");
}
}
public void test5ComplexRpcEncPortEchoMultipleFaults2() throws Exception {
test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncPortType binding;
try {
binding = new test.wsdl.interop4.groupH.complexRPCenc.ComplexRpcEncServiceLocator().getComplexRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
BaseStruct base = new BaseStruct();
base.setFloatMessage(2.2F);
base.setShortMessage((short)4);
ExtendedStruct extended = new ExtendedStruct();
extended.setIntMessage(1);
extended.setAnotherIntMessage(2);
extended.setFloatMessage(3.3F);
extended.setShortMessage((short)5);
extended.setStringMessage("This is an ExtendedStruct");
MoreExtendedStruct moreExtended = new MoreExtendedStruct();
moreExtended.setBooleanMessage(true);
moreExtended.setIntMessage(2);
moreExtended.setAnotherIntMessage(3);
moreExtended.setFloatMessage(6.6F);
moreExtended.setShortMessage((short)9);
moreExtended.setStringMessage("This is a MoreExtendedStruct");
// Test operation multiple times
for (int i = 1; i < 4; i++) {
try {
binding.echoMultipleFaults2(i, base, extended, moreExtended);
}
catch (MoreExtendedStruct e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 3, i);
assertEquals("Bad data echoed", moreExtended, e3);
continue;
}
catch (ExtendedStruct e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals("Bad data echoed", extended, e2);
continue;
}
catch (BaseStruct e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
assertEquals("Bad data echoed", base, e1);
continue;
}
fail("Should have caught exception!");
}
}
}
| 6,507 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/simpleRPCenc/SimpleRpcEncBindingImpl.java | /**
* Implementation of simple RPC encoded fault services for interop4 tests
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*
* @author Glen Daniels (gdaniels@apache.org)
*/
package test.wsdl.interop4.groupH.simpleRPCenc;
public class SimpleRpcEncBindingImpl implements test.wsdl.interop4.groupH.simpleRPCenc.SimpleRpcEncPortType{
public void echoEmptyFault() throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.EmptyFault {
throw new EmptyFault();
}
public void echoStringFault(java.lang.String param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.StringFault {
StringFault fault = new StringFault(param);
throw fault;
}
public void echoIntArrayFault(int[] param) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.IntArrayFault {
throw new IntArrayFault(param);
}
public void echoMultipleFaults1(int whichFault, java.lang.String param1, float[] param2) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.FloatArrayFault, test.wsdl.interop4.groupH.simpleRPCenc.StringFault, test.wsdl.interop4.groupH.simpleRPCenc.EmptyFault {
switch (whichFault) {
case 2:
throw new StringFault(param1);
case 3:
throw new FloatArrayFault(param2);
default:
throw new EmptyFault();
}
}
public void echoMultipleFaults2(int whichFault, java.lang.String param1, float param2, java.lang.String[] param3) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.StringArrayFault, test.wsdl.interop4.groupH.simpleRPCenc.FloatFault, test.wsdl.interop4.groupH.simpleRPCenc.StringFault {
switch (whichFault) {
case 2:
throw new StringFault(param1);
case 3:
throw new StringArrayFault(param3);
default:
throw new FloatFault(param2);
}
}
public void echoMultipleFaults3(int whichFault, java.lang.String param1, java.lang.String param2) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.String2Fault, test.wsdl.interop4.groupH.simpleRPCenc.StringFault {
switch (whichFault) {
case 2:
throw new String2Fault(param2);
default:
throw new StringFault(param1);
}
}
public void echoMultipleFaults4(int whichFault, int param1, test.wsdl.interop4.groupH.simpleRPCenc.Enum param2) throws java.rmi.RemoteException, test.wsdl.interop4.groupH.simpleRPCenc.EnumFault, test.wsdl.interop4.groupH.simpleRPCenc.IntFault {
switch (whichFault) {
case 2:
throw new EnumFault(param2);
default:
throw new IntFault(param1);
}
}
}
| 6,508 |
0 | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH | Create_ds/axis-axis1-java/test/wsdl/interop4/groupH/simpleRPCenc/SimpleRpcEncServiceTestCase.java | /**
* SimpleRpcEncServiceTestCase.java
*
* Test case for SoapBuilders interop round 4
* http://soapinterop.java.sun.com/soapbuilders/r4/faults.shtml
*
* @author Tom Jordahl (tomj@macromedia.com)
*/
package test.wsdl.interop4.groupH.simpleRPCenc;
import java.net.URL;
public class SimpleRpcEncServiceTestCase extends junit.framework.TestCase {
public static URL url = null;
public static void main(String[] args) throws Exception {
if (args.length == 1) {
url = new URL(args[0]);
} else {
url = new URL(new SimpleRpcEncServiceLocator().getSimpleRpcEncPortAddress());
}
junit.textui.TestRunner.run(new junit.framework.TestSuite(SimpleRpcEncServiceTestCase.class));
} // main
public SimpleRpcEncServiceTestCase(java.lang.String name) throws Exception {
super(name);
if (url == null) {
url = new URL(new SimpleRpcEncServiceLocator().getSimpleRpcEncPortAddress());
}
}
public void test1SimpleRpcEncPortEchoEmptyFault() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
///////////////////////////////////////////////////////////////////////
// EmptyFault
try {
binding.echoEmptyFault();
}
catch(EmptyFault ef) {
return;
}
fail("Did NOT catch any exception");
}
public void test2SimpleRpcEncPortEchoStringFault() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// StringFault
try {
binding.echoStringFault("HELLO");
}
catch(StringFault sf) {
assertEquals("HELLO", sf.getPart2());
return;
}
fail("Did NOT catch any exception");
}
public void test3SimpleRpcEncPortEchoIntArrayFault() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
///////////////////////////////////////////////////////////////////////
// IntArrayFault
int[] param = new int[] {1, 2, 3};
try {
binding.echoIntArrayFault(param);
}
catch(IntArrayFault f) {
int[] ret = f.getPart5();
assertEquals("Array element 1", param[0], ret[0]);
assertEquals("Array element 2", param[1], ret[1]);
assertEquals("Array element 3", param[2], ret[2]);
return;
}
fail("Did NOT catch any exception");
}
public void test4SimpleRpcEncPortEchoMultipleFaults1() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
///////////////////////////////////////////////////////////////////////
// echoMultipleFaults1
float[] floatParam = new float[] {1.0F, 2.2F, 3.5F};
String stringParam = "HELLO";
for (int i=1; i < 4; i++) {
try {
binding.echoMultipleFaults1(i, stringParam, floatParam);
}
catch (EmptyFault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
continue;
}
catch (StringFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals("HELLO", e2.getPart2());
continue;
}
catch (FloatArrayFault e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 3, i);
float[] ret = e3.getPart7();
assertEquals(floatParam[0], ret[0], 0.01F);
assertEquals(floatParam[1], ret[1], 0.01F);
assertEquals(floatParam[2], ret[2], 0.01F);
continue;
}
fail("Did NOT catch any exception");
}
}
public void test5SimpleRpcEncPortEchoMultipleFaults2() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
///////////////////////////////////////////////////////////////////////
// echoMultipleFaults2
String stringParam = "HELLO";
String[] stringArrayParam = new String[] {"one", "two", "three"};
float floatParam = 9.7F;
for (int i=1; i < 4; i++) {
try {
binding.echoMultipleFaults2(i, stringParam, floatParam, stringArrayParam);
}
catch (FloatFault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
assertEquals(floatParam, e1.getPart4(), 0.01F);
continue;
}
catch (StringFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals(stringParam, e2.getPart2());
continue;
}
catch (StringArrayFault e3) {
assertEquals("Wrong fault thrown: " + e3.getClass(), 3, i);
String[] ret = e3.getPart6();
assertEquals("Array element 1", stringArrayParam[0], ret[0]);
assertEquals("Array element 2", stringArrayParam[1], ret[1]);
assertEquals("Array element 3", stringArrayParam[2], ret[2]);
continue;
}
fail("Did NOT catch any exception");
}
}
public void test6SimpleRpcEncPortEchoMultipleFaults3() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
///////////////////////////////////////////////////////////////////////
// echoMultipleFaults3
String param1 = "Param1";
String param2 = "Param2";
for (int i=1; i < 3; i++) {
try {
binding.echoMultipleFaults3(i, param1, param2);
}
catch (StringFault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
assertEquals(param1, e1.getPart2());
continue;
}
catch (String2Fault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals(param2, e2.getPart2());
continue;
}
fail("Did NOT catch any exception");
}
}
public void test7SimpleRpcEncPortEchoMultipleFaults4() throws Exception {
SimpleRpcEncPortType binding;
try {
binding = new SimpleRpcEncServiceLocator().getSimpleRpcEncPort(url);
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
////////////////////////////////////////////////////////////////////////
// echoMultipleFaults4
int intParam = 66;
Enum enumParam = new Enum(1);
for (int i=1; i < 3; i++) {
try {
binding.echoMultipleFaults4(i, intParam, enumParam);
}
catch (IntFault e1) {
assertEquals("Wrong fault thrown: " + e1.getClass(), 1, i);
assertEquals(intParam, e1.getPart3());
continue;
}
catch (EnumFault e2) {
assertEquals("Wrong fault thrown: " + e2.getClass(), 2, i);
assertEquals(enumParam.getValue(), e2.getPart9().getValue());
continue;
}
fail("Did NOT catch any exception");
}
}
}
| 6,509 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/doclit_arrays/ArrayService.java | package test.wsdl.doclit_arrays;
/**
* Test doc/lit service taking and returning arrays
*/
public class ArrayService {
public static class Bean {
public Bean() {
}
public String [] arrayField;
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Bean.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://doclit_arrays.wsdl.test/", "Bean"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("arrayField");
elemField.setXmlName(new javax.xml.namespace.QName("http://doclit_arrays.wsdl.test/", "arrayField"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
//elemField.setItemQName(new javax.xml.namespace.QName("", "inner"));
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
}
public String [] echoString(String [] input) {
return input;
}
public Bean echoBean(Bean input) {
return input;
}
}
| 6,510 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/InheritancePortType.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* The InheritancePortType interface defines the methods necessary when
* when implementing this interface. Note that this interface extends
* the StockQuoteProvider interface.
*
* @version 1.00 21 Jan 2002
* @author Brent Ulbricht
*/
public interface InheritancePortType extends test.wsdl.inheritance.StockQuoteProvider {
public float getRealtimeLastTradePrice(String tickerSymbol)
throws java.rmi.RemoteException;
}
| 6,511 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Child.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* The methods in this class should be listed in Java2WSDL generated WSDL.
*/
public class Child extends Parent {
/**
* This method should appear in the WSDL
*/
public String child_method(int x) {
return "child_method";
}
/**
* This method is explicitly excluded from the WSDL
*/
public String child_excluded(int argument) {
return "should never be called";
}
}
| 6,512 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Child_bean.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* This bean should be in the types section of the generated WSDL
*/
public class Child_bean extends Parent_bean {
public String child_string;
public String getChild_string() {
return child_string;
}
public void setChild_string(String child_string) {
this.child_string = child_string;
}
}
| 6,513 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Baby_bean.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
** This bean should be in the types section of the generated WSDL
*/
public class Baby_bean extends Child_bean {
public String getBaby_string() {
return baby_string;
}
public void setBaby_string(String baby_string) {
this.baby_string = baby_string;
}
public String baby_string;
}
| 6,514 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Baby.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* This class is the target of given to Java2WSDL.
*/
public class Baby extends Child {
/**
* This method should appear in the WSDL
*/
public int baby_method(Baby_bean message) {
return 42;
}
/**
* This method is explicitly excluded from the WSDL
*/
public String baby_excluded(int argument) {
return "should never be called";
}
}
| 6,515 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Parent_bean.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* This class is listed as a "Stop Class" and should not appear in the
* WSDL generated by Java2WSDL.
*/
public class Parent_bean {
public String parent_string;
public String getParent_string() {
return parent_string;
}
public void setParent_string(String parent_string) {
this.parent_string = parent_string;
}
}
| 6,516 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/InheritanceTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.wsdl.Definition;
import javax.wsdl.Operation;
import javax.wsdl.PortType;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.xml.rpc.ServiceException;
import java.io.File;
import java.util.Iterator;
import java.util.List;
/**
* This class contains the methods necessary for testing that the use inherited methods
* function in the Java2WSDL tool works as specified.
*
* When using the Java2WSDL tool with the use inherited methods switch on, the tool
* should generate the appropriate classes to include all of the inherited methods
* of the specified interface (in addition to the actual methods in the interface).
*
* @version 1.00 21 Jan 2002
* @author Brent Ulbricht
*/
public class InheritanceTestCase extends junit.framework.TestCase {
/**
* Constructor used in all tests utilizing the Junit Framework.
*/
public InheritanceTestCase(String name) {
super(name);
} // Constructor
/**
* This method insures that two methods (getLastTradePrice and getRealtimeLastTradePrice)
* can be called, and they return the expected stock values. The main goal is to verify
* that the getLastTradePrice method does not cause any compile errors and returns the
* expected stock value.
*
* The getLastTradePrice method originates from the test/wsdl/inheritance/StockQuoteProvider
* interface. The InheritancePortType interface extends the StockQuoteProvider interface.
*
* When the WSDL is generated for the InheritancePortType interface and the use inherited
* methods switch is used, all methods from the StockQuoteProvider and InheritancePortType
* interfaces should be available for service.
*/
public void testInheritanceTest() {
test.wsdl.inheritance.InheritancePortType binding;
try {
binding = new InheritancePortTypeServiceLocator().getInheritanceTest();
} catch (ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// The getLastTradePrice method should return a value of 20.25 when sent the tickerSymbol
// "SOAP".
try {
float expected = 20.25F;
float actual = binding.getLastTradePrice(new java.lang.String("SOAP"));
float delta = 0.0F;
assertEquals("The actual and expected values did not match.", expected, actual, delta);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
// The getRealtimeLastTradePrice method should return a value of 21.75 when sent the
// tickerSymbol "AXIS".
try {
float expected = 21.75F;
float actual = binding.getRealtimeLastTradePrice(new java.lang.String("AXIS"));
float delta = 0.0F;
assertEquals("The actual and expected values did not match.", expected, actual, delta);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
} // testInheritanceTest
/**
* This test validates the WSDL generated by Java2WSDL
*/
public void testStopClasses() {
String path = "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"inheritance" + File.separator + "StopExclude.wsdl";
Document doc = null;
Definition def = null;
try {
doc = XMLUtils.newDocument(path);
assertNotNull("Unable to locate WSDL file: " + path, doc);
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
//reader.setFeature("javax.wsdl.verbose", true);
def = reader.readWSDL(path, doc);
assertNotNull("unable to generate WSDL definition from document: " + path, def);
} catch (Exception e) {
throw new junit.framework.AssertionFailedError("Exception caught: " + e);
}
// Now check parts of the definition
// types
// The complex types Baby_bean and Child_bean should exist
// The type Parent_bean should NOT exist
NodeList typeList = doc.getElementsByTagName("wsdl:types");
Node typeNode = typeList.item(0);
assertNotNull("types section of the WSDL document", typeNode);
Element typeElem = (Element) typeNode;
boolean babyFound = false;
boolean childFound = false;
NodeList nodeList = typeElem.getElementsByTagName("complexType");
for (int i = 0; i < nodeList.getLength(); i++) {
Node n = nodeList.item(i);
String name = nodeList.item(i).getAttributes().getNamedItem("name").getNodeValue();
if (name.equals("Baby_bean"))
babyFound = true;
else if (name.equals("Child_bean"))
childFound = true;
else if (name.equals("Parent_bean"))
assertTrue("Parent_bean found in WSDL types section", false);
else
assertTrue("Unknown node found in types section: " + name, false);
}
assertTrue("Baby_bean not found in WSDL types section", babyFound);
assertTrue("Child_bean not found in WSDL types section", childFound);
// operations
// The only ones we shold find are baby_method and child_method
boolean babyOpFound = false;
boolean childOpFound = false;
// we iterate the portTypes, but we check to make sure there is only one
Iterator ip = def.getPortTypes().values().iterator();
PortType portType = (PortType) ip.next();
List operationList = portType.getOperations();
for (int i = 0; i < operationList.size(); ++i) {
String opName = ((Operation) operationList.get(i)).getName();
if (opName.equals("baby_method"))
babyOpFound = true;
else if (opName.equals("child_method"))
childOpFound = true;
else if (opName.equals("parent_method"))
assertTrue("parent_method operation found in WSDL", false);
else
assertTrue("Invalid operation found in WSDL: " + opName, false);
}
assertTrue("WSDL has more than one portType", !ip.hasNext());
assertTrue("baby_method operation not found in WSDL", babyOpFound);
assertTrue("child_method operation not found in WSDL ", childOpFound);
} // testStopClasses
} // InheritanceTestCase
| 6,517 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/StockQuoteProvider.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* The StockQuoteProvider interface defines the methods necessary when
* when implementing this interface.
*
* @version 1.00 21 Jan 2002
* @author Brent Ulbricht
*/
public interface StockQuoteProvider extends java.rmi.Remote {
public float getLastTradePrice(String tickerSymbol)
throws java.rmi.RemoteException;
}
| 6,518 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/InheritanceTestSoapBindingImpl.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* This class contains the remote method implementations for the
* inheritance test.
*
* @version 1.00 21 Jan 2002
* @author Brent Ulbricht
*/
public class InheritanceTestSoapBindingImpl implements test.wsdl.inheritance.InheritancePortType {
/**
* This method will return a hard coded value to the client depending on the value of the
* tickerSymbol received.
*
* The getLastTradePrice originates from the InheritancePortType interface.
*/
public float getLastTradePrice(java.lang.String tickerSymbol) throws java.rmi.RemoteException {
if (tickerSymbol.equals("SOAP")) {
return 20.25F;
} else {
return 0.00F;
}
} // getLastTradePrice
/**
* This method will return a hard coded value to the client depending on the value of the
* tickerSymbol received.
*
* The getRealtimeLastTradePrice originates from the StockQuoteProvider interface.
*/
public float getRealtimeLastTradePrice(java.lang.String tickerSymbol) throws java.rmi.RemoteException {
if (tickerSymbol.equals("AXIS")) {
return 21.75F;
} else {
return 0.00F;
}
} // getRealtimeLastTradePrice
} // End class InheritanceTestSoapBindingImpl
| 6,519 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/inheritance/Parent.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.inheritance;
/**
* This class is listed as a "Stop Class" and its methods should not appear in
* the WSDL generated by Java2WSDL.
*/
public class Parent {
public void parent_method(String message) {
return;
}
}
| 6,520 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/ServiceHandler2.java | package test.wsdl.jaxrpchandlereval;
import javax.xml.rpc.handler.*;
import javax.xml.rpc.soap.*;
import javax.xml.namespace.*;
import javax.xml.soap.*;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.rpc.JAXRPCException;
import javax.xml.rpc.soap.*;
import javax.xml.rpc.*;
import org.w3c.dom.NodeList;
public class ServiceHandler2 implements Handler {
public ServiceHandler2() {
System.out.println("ServiceHandler2:Constructor");
}
public boolean handleRequest(MessageContext context) {
System.out.println("ServiceHandler2:handleRequest");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler2HdrName =
se.createName("ServiceHandler2-handleRequest", "", "");
SOAPHeaderElement xmlServicesHandler2Hdr =
sh.addHeaderElement(xmlServicesHandler2HdrName);
xmlServicesHandler2Hdr.addTextNode(
"Processed by ServiceHandler2Hdr2.handleRequest");
/*--- getElementsByTagName() does not work.
NodeList list = sb.getElementsByTagName("in0");
if (list.getLength() == 0) {
throw new JAXRPCException("No such element : 'in0'");
}
SOAPElement elem = (SOAPElement) list.item(0);
String curBody = elem.getValue();
---*/
String curBody = sb.toString();
if (curBody.indexOf("server-throw-soapfaultexception") >= 0) {
String reason = "A FATAL EXCEPTION has occurred while processing ServiceHandler2.handleRequest";
soapMsgCtx.setProperty("fault", reason);
QName faultcode = new QName("Testimg Exception",
"http://example.org/security/");
throw new SOAPFaultException(faultcode, reason, null, null);
//throw new JAXRPCException(reason);
} else if (curBody.indexOf("server-return-false") >= 0) {
soapMsgCtx.setProperty("fault",
"An error has occurred while processing ServiceHandler2.handleRequest - returning false");
return false;
}
} catch (SOAPException ex) {
throw new JAXRPCException(ex);
}
return true;
}
public boolean handleResponse(MessageContext context) {
System.out.println("ServiceHandler2:handleResponse");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
if (soapMsg == null) {
soapMsg = prepareError(soapMsgCtx);
}
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler2HdrName =
se.createName("ServiceHandler2-handleResponse", "", "");
SOAPHeaderElement xmlServicesHandler2Hdr =
sh.addHeaderElement(xmlServicesHandler2HdrName);
xmlServicesHandler2Hdr.addTextNode(
"Processed by ServiceHandler2Hdr2.handleResponse");
} catch (Exception ex) {
throw new JAXRPCException(ex);
}
return true;
}
public SOAPMessage prepareError(SOAPMessageContext soapMsgCtx) throws Exception{
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage soapMsg = messageFactory.createMessage();
soapMsgCtx.setMessage(soapMsg);
String fault = (String)soapMsgCtx.getProperty("fault");
if (fault != null) {
SOAPFault soapFault =
soapMsg.getSOAPPart().getEnvelope().getBody().addFault();
soapFault.setFaultString(fault);
}
return soapMsg;
}
public boolean handleFault(MessageContext context) {
System.out.println("\nServiceHandler2:handleFault");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
soapMsg = prepareError(soapMsgCtx);
// soapMsg.writeTo(System.out);
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler2HdrName =
se.createName("ServiceHandler2-handleFault", "", "");
SOAPHeaderElement xmlServicesHandler2Hdr =
sh.addHeaderElement(xmlServicesHandler2HdrName);
xmlServicesHandler2Hdr.addTextNode(
"Processed by ServiceHandler2Hdr2.handleFault");
} catch (Exception ex) {
ex.printStackTrace();
}
return true;
}
public void init(HandlerInfo config) {
System.out.println("ServiceHandler2:init");
}
public void destroy() {
System.out.println("ServiceHandler2:destroy");
}
public QName[] getHeaders() {
System.out.println("ServiceHandler2:getHeaders");
return null;
}
}
| 6,521 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/HandlerTracker.java | package test.wsdl.jaxrpchandlereval;
import java.util.*;
public class HandlerTracker {
private static List clientHandlers;
private static List serverHandlers;
public static void init() {
clientHandlers = new ArrayList();
serverHandlers = new ArrayList();
}
public static void addClientHandler(String s) {
clientHandlers.add(s);
}
public static void addServerHandler(String s) {
serverHandlers.add(s);
}
public static void assertClientHandlerOrder(String[] arr) throws Exception {
assertHandlerOrder(clientHandlers, arr);
}
public static void assertServerHandlerOrder(String[] arr) throws Exception {
assertHandlerOrder(serverHandlers, arr);
}
public static void assertHandlerOrder(List handlers, String[] expected) throws Exception {
String[] actual = new String[handlers.size()];
handlers.toArray(actual);
System.out.print("excepted order:");
for (int i = 0; i < expected.length; i++) {
System.out.print(expected[i] + " ");
}
System.out.println("\n");
System.out.print("actual order:");
for (int i = 0; i < actual.length; i++) {
System.out.print(actual[i] + " ");
}
System.out.println("\n");
if (expected.length != actual.length) {
throw new Exception("Handler length not match");
}
System.out.println("\n");
for (int i = 0; i < expected.length; i++) {
if (!expected[i].equals(actual[i])) {
throw new Exception("Handler order not match : expected = " + expected[i] + ", actual = " + actual[i]);
}
}
return;
}
}
| 6,522 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/ClientHandler2.java | package test.wsdl.jaxrpchandlereval;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.Handler;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import java.util.Iterator;
import javax.xml.soap.*;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.rpc.soap.*;
import javax.xml.rpc.*;
/**
*/
public class ClientHandler2 implements Handler {
private final static String _actorURI = "myActorURI";
/**
* Constructor for ClientHandler2.
*/
public ClientHandler2() {
System.out.println("ClientHandler2:Constructor");
}
/**
* @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext)
*/
public boolean handleRequest(MessageContext context) {
System.out.println("ClientHandler2:handleRequest");
HandlerTracker.addClientHandler("clienthandler2.handleRequest");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name name = se.createName("ClientHandler2-handleRequest", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
String instruction = sb.toString();
if (instruction.indexOf("client-throw-jaxrpcexception") >= 0) {
soapMsgCtx.setProperty("fault", "Throwing a client side exception from ClientHandler2.handleRequest");
QName faultcode = new QName("Testimg Exception",
"http://example.org/security/");
// According to JAX-RPC spec client handlers cannot throw SOAPFaultException
throw new JAXRPCException();
} else if (instruction.indexOf("client-return-false") >= 0) {
soapMsgCtx.setProperty("fault", "Returning false from ClientHandler2.handleRequest");
return false;
}
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
}
}
return true;
}
/**
* @see javax.xml.rpc.handler.Handler#handleResponse(MessageContext)
*/
public boolean handleResponse(MessageContext context) {
System.out.println("ClientHandler2:handleResponse");
HandlerTracker.addClientHandler("clienthandler2.handleResponse");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
if (soapMsg == null) {
soapMsg = prepareError(soapMsgCtx);
}
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name name = se.createName("ClientHandler2-handleResponse", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
} catch (java.io.IOException ex) {
ex.printStackTrace();
return false;
} catch (Exception ex) {
throw new JAXRPCException(ex);
}
}
return true;
}
public SOAPMessage prepareError(SOAPMessageContext soapMsgCtx) throws Exception{
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage soapMsg = messageFactory.createMessage();
soapMsgCtx.setMessage(soapMsg);
String fault = (String)soapMsgCtx.getProperty("fault");
if (fault != null) {
SOAPFault soapFault =
soapMsg.getSOAPPart().getEnvelope().getBody().addFault();
soapFault.setFaultString(fault);
}
return soapMsg;
}
/**
* @see javax.xml.rpc.handler.Handler#handleFault(MessageContext)
*/
public boolean handleFault(MessageContext context) {
System.out.println("ClientHandler2:handleFault");
HandlerTracker.addClientHandler("clienthandler2.handleFault");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
if (soapMsg == null) {
soapMsg = prepareError(soapMsgCtx);
}
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name name = se.createName("ClientHandler2-handleFault", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
} catch (Exception ex) {
ex.printStackTrace();
throw new JAXRPCException(ex);
}
}
return true;
}
/**
* @see javax.xml.rpc.handler.Handler#init(HandlerInfo)
*/
public void init(HandlerInfo config) {
System.out.println("ClientHandler2.init");
}
/**
* @see javax.xml.rpc.handler.Handler#destroy()
*/
public void destroy() {
System.out.println("ClientHandler2.destroy");
}
/**
* @see javax.xml.rpc.handler.Handler#getHeaders()
*/
public QName[] getHeaders() {
System.out.println("ClientHandler2.getheaders");
return null;
}
}
| 6,523 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/ClientHandler.java | package test.wsdl.jaxrpchandlereval;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.Handler;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPHeaderElement;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import java.util.Iterator;
import javax.xml.soap.*;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.rpc.soap.*;
import javax.xml.rpc.*;
/**
*/
public class ClientHandler implements Handler {
private final static String _actorURI = "myActorURI";
/**
* Constructor for ClientHandler.
*/
public ClientHandler() {
System.out.println("ClientHandler:Constructor");
}
/**
* @see javax.xml.rpc.handler.Handler#handleRequest(MessageContext)
*/
public boolean handleRequest(MessageContext context) {
System.out.println("ClientHandler:handleRequest");
HandlerTracker.addClientHandler("clienthandler1.handleRequest");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name name = se.createName("ClientHandler-handleRequest", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
String instruction = sb.toString();
if (instruction.indexOf("client-return-false") >= 0) {
soapMsgCtx.setProperty("fault", "Returning false from ClientHandler.handleRequest");
return false;
}
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
}
}
return true;
}
public SOAPMessage prepareError(SOAPMessageContext soapMsgCtx) throws Exception{
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage soapMsg = messageFactory.createMessage();
soapMsgCtx.setMessage(soapMsg);
String fault = (String)soapMsgCtx.getProperty("fault");
if (fault != null) {
SOAPFault soapFault =
soapMsg.getSOAPPart().getEnvelope().getBody().addFault();
soapFault.setFaultString(fault);
soapFault.setFaultCode("client.Exception");
}
return soapMsg;
}
private void trackServerHandler(SOAPHeader sh) {
Iterator i = sh.getChildElements();
while (i.hasNext()) {
Node n = (Node) i.next();
if (n instanceof Text) {
continue;
}
SOAPElement e = (SOAPElement) n;
String local = e.getLocalName();
if (local.equals("ServiceHandler2-handleFault")) {
HandlerTracker.addServerHandler("serverhandler2.handleFault");
} else if (local.equals("ServiceHandler1-handleFault")) {
HandlerTracker.addServerHandler("serverhandler1.handleFault");
} else if (local.equals("ServiceHandler2-handleResponse")) {
HandlerTracker.addServerHandler("serverhandler2.handleResponse");
} else if (local.equals("ServiceHandler1-handleResponse")) {
HandlerTracker.addServerHandler("serverhandler1.handleResponse");
}
}
}
/**
* @see javax.xml.rpc.handler.Handler#handleResponse(MessageContext)
*/
public boolean handleResponse(MessageContext context) {
System.out.println("ClientHandler:handleResponse");
HandlerTracker.addClientHandler("clienthandler1.handleResponse");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
if (soapMsg == null) {
soapMsg = prepareError(soapMsgCtx);
}
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
trackServerHandler(sh);
Name name = se.createName("ClientHandler-handleResponse", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
} catch (Exception ex) {
throw new JAXRPCException (ex);
}
}
return true;
}
/**
* @see javax.xml.rpc.handler.Handler#handleFault(MessageContext)
*/
public boolean handleFault(MessageContext context) {
System.out.println("ClientHandler:handleFault");
HandlerTracker.addClientHandler("clienthandler1.handleFault");
if (context instanceof SOAPMessageContext) {
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name name = se.createName("ClientHandler-handleFault", "", "");
SOAPHeaderElement hdr = sh.addHeaderElement(name);
hdr.addTextNode("Processed");
} catch (SOAPException ex) {
ex.printStackTrace();
return false;
}
}
return false;
}
/**
* @see javax.xml.rpc.handler.Handler#init(HandlerInfo)
*/
public void init(HandlerInfo config) {
System.out.println("ClientHandler.init");
}
/**
* @see javax.xml.rpc.handler.Handler#destroy()
*/
public void destroy() {
System.out.println("ClientHandler.destroy");
}
/**
* @see javax.xml.rpc.handler.Handler#getHeaders()
*/
public QName[] getHeaders() {
System.out.println("ClientHandler.getheaders");
return null;
}
}
| 6,524 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/UserAccountSoapBindingImpl.java | package test.wsdl.jaxrpchandlereval;
public class UserAccountSoapBindingImpl implements test.wsdl.jaxrpchandlereval.UserAccount{
public java.lang.String updateInfo(java.lang.String updateInfoIn0) throws java.rmi.RemoteException {
return updateInfoIn0;
}
}
| 6,525 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/JAXRPCHandlerEvalTestCase.java | package test.wsdl.jaxrpchandlereval;
import junit.framework.TestCase;
import org.apache.axis.client.AdminClient;
import org.apache.axis.utils.Admin;
import java.rmi.RemoteException;
import javax.xml.rpc.JAXRPCException;
public class JAXRPCHandlerEvalTestCase extends TestCase {
public JAXRPCHandlerEvalTestCase() {
super("JAXRPCHandlerEvalTest");
}
public JAXRPCHandlerEvalTestCase(String name) {
super(name);
}
public void testHappyPath() throws Exception {
doClientDeploy();
HandlerTracker.init();
try {
updateInfo("Using the happy path");
HandlerTracker.assertClientHandlerOrder(new String[] {
"clienthandler1.handleRequest", "clienthandler2.handleRequest",
"clienthandler2.handleResponse", "clienthandler1.handleResponse" });
HandlerTracker.assertServerHandlerOrder(new String[] {
"serverhandler2.handleResponse", "serverhandler1.handleResponse" });
} finally {
doClientUndeploy();
}
}
public void testServerReturnFalse() throws Exception {
doClientDeploy();
HandlerTracker.init();
try {
updateInfo("server-return-false");
} catch (RemoteException e) {
HandlerTracker.assertClientHandlerOrder(new String[] {
"clienthandler1.handleRequest", "clienthandler2.handleRequest",
"clienthandler2.handleResponse", "clienthandler1.handleResponse" });
HandlerTracker.assertServerHandlerOrder(new String[] {
"serverhandler2.handleResponse", "serverhandler1.handleResponse" });
} finally {
doClientUndeploy();
}
}
public void testServerThrowSoapFaultException() throws Exception {
doClientDeploy();
HandlerTracker.init();
try {
updateInfo("server-throw-soapfaultexception");
} catch (RemoteException e) {
HandlerTracker.assertClientHandlerOrder(new String[] {
"clienthandler1.handleRequest", "clienthandler2.handleRequest",
"clienthandler2.handleResponse", "clienthandler1.handleResponse" });
HandlerTracker.assertServerHandlerOrder(new String[] {
"serverhandler2.handleFault", "serverhandler1.handleFault" });
} finally {
doClientUndeploy();
}
}
public void testClientReturnFalse() throws Exception {
doClientDeploy();
HandlerTracker.init();
try {
updateInfo("client-return-false");
} catch (RemoteException e) {
HandlerTracker.assertClientHandlerOrder(new String[] {
"clienthandler1.handleRequest", "clienthandler1.handleResponse" });
HandlerTracker.assertServerHandlerOrder(new String[] {});
} finally {
doClientUndeploy();
}
}
public void testClientThrowJaxRpcException() throws Exception {
doClientDeploy();
HandlerTracker.init();
try {
updateInfo("client-throw-jaxrpcexception");
} catch (RemoteException e) {
HandlerTracker.assertClientHandlerOrder(new String[] {
"clienthandler1.handleRequest", "clienthandler2.handleRequest" });
HandlerTracker.assertServerHandlerOrder(new String[] {});
} finally {
doClientUndeploy();
}
}
public String updateInfo(String payload) throws Exception {
UserAccountServiceLocator locator = new UserAccountServiceLocator();
UserAccount port = locator.getUserAccount();
String retval = null;
try {
retval = port.updateInfo(payload);
} catch (Exception ex) {
throw ex;
}
return retval;
}
public void doClientDeploy() throws Exception {
String[] args1 = { "client", "test/wsdl/jaxrpchandlereval/client-deploy.wsdd" };
Admin.main(args1);
}
public void doClientUndeploy() throws Exception {
String[] args1 = { "client", "test/wsdl/jaxrpchandlereval/client-undeploy.wsdd" };
Admin.main(args1);
}
}
| 6,526 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/jaxrpchandlereval/ServiceHandler1.java | package test.wsdl.jaxrpchandlereval;
import javax.xml.rpc.handler.*;
import javax.xml.soap.*;
import javax.xml.namespace.*;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.rpc.JAXRPCException;
public class ServiceHandler1 implements javax.xml.rpc.handler.Handler{
public ServiceHandler1() {
System.out.println("ServiceHandler1:Constructor");
}
public boolean handleRequest(MessageContext context) {
System.out.println("ServiceHandler1:handleRequest");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler1HdrName =
se.createName("ServiceHandler1-handleRequest", "", "");
SOAPHeaderElement xmlServicesHandler1Hdr =
sh.addHeaderElement(xmlServicesHandler1HdrName);
xmlServicesHandler1Hdr.addTextNode(
"Processed by ServiceHandler1Hdr1.handleRequest");
} catch (Exception ex) {
throw new JAXRPCException(ex);
}
return true;
}
public boolean handleResponse(MessageContext context) {
System.out.println("ServiceHandler1:handleResponse");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler1HdrName =
se.createName("ServiceHandler1-handleResponse", "", "");
SOAPHeaderElement xmlServicesHandler1Hdr =
sh.addHeaderElement(xmlServicesHandler1HdrName);
xmlServicesHandler1Hdr.addTextNode(
"Processed by ServiceHandler1Hdr1.handleResponse");
sp.addMimeHeader("MY_MIME_HEADER", "ADDING A NEW HEADER IN SOAPPART");
} catch (Exception ex) {
throw new JAXRPCException(ex);
}
return true;
}
public boolean handleFault(MessageContext context) {
System.out.println("\nServiceHandler1:handleFault");
try {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext)context;
SOAPMessage soapMsg = soapMsgCtx.getMessage();
SOAPPart sp = soapMsg.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
SOAPHeader sh = se.getHeader();
Name xmlServicesHandler1HdrName =
se.createName("ServiceHandler1-handleFault", "", "");
SOAPHeaderElement xmlServicesHandler1Hdr =
sh.addHeaderElement(xmlServicesHandler1HdrName);
xmlServicesHandler1Hdr.addTextNode(
"Processed by ServiceHandler1Hdr1.handleFault");
soapMsgCtx.setMessage(soapMsg);
} catch (Exception ex) {
ex.printStackTrace();
}
return true;
}
public void init(HandlerInfo config) {
System.out.println("ServiceHandler1:init");
}
public void destroy() {
System.out.println("ServiceHandler1:destroy");
}
public QName[] getHeaders() {
System.out.println("ServiceHandler1:getHeaders");
return null;
}
}
| 6,527 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/extensibility/ExtensibilityQueryBindingImpl.java | /**
* ExtensibilityQueryBindingImpl.java
*
*/
package test.wsdl.extensibility;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.Text;
import org.apache.commons.logging.Log;
import javax.xml.namespace.QName;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.rmi.RemoteException;
import java.util.Calendar;
public class ExtensibilityQueryBindingImpl implements ExtensibilityQueryPortType {
private final static String[] books = new String[] { "The Grid", "The Oxford Dictionary" };
private final static String[] subjects = new String[] { "Computer Science", "English" };
protected static Log log =
LogFactory.getLog(ExtensibilityQueryBindingImpl.class.getName());
public ExtensibilityType query(ExtensibilityType query) throws RemoteException {
ExtensibilityType result = new ExtensibilityType();
Object obj = null;
try {
obj = query.get_any()[0].getObjectValue(BookType.class);
} catch (Exception e) {
StringWriter writer = new StringWriter();
PrintWriter out = new PrintWriter(writer);
log.error("Error converting query: " + writer.toString());
throw new RemoteException(e.toString());
}
log.error("Incoming MessageContext " + obj + " : " + query.get_any()[0].toString());
if (obj instanceof BookType) {
BookType bookQuery = (BookType)obj;
String subject = bookQuery.getSubject();
if (!"all".equals(subject)) {
throw new RemoteException("ExtensibilityQueryBindingImpl: Book subject query should be all, instead was " + subject);
}
ResultListType resultList = new ResultListType();
QueryResultType[] queryResult = new QueryResultType[books.length];
for (int i = 0; i < books.length; i++) {
queryResult[i] = new QueryResultType();
queryResult[i].setName(subjects[i]);
queryResult[i].setStatus(StatusType.MORE);
queryResult[i].setValue(books[i]);
queryResult[i].setTime(Calendar.getInstance());
queryResult[i].setQueryType(new QName("urn:QueryType","BookQuery"));
}
resultList.setResult(queryResult);
QName elementName = QueryResultElement.getTypeDesc().getFields()[0].getXmlName();
MessageElement me = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), resultList);
log.debug("Outgoing message: " + me.toString());
result.set_any(new MessageElement [] { me });
} else {
throw new RemoteException("Failed to get FindBooksQueryExpressionElement. Got: " + obj);
}
return result;
}
public ExtensibilityType mixedQuery(ExtensibilityType query)
throws RemoteException {
MessageElement [] elements = query.get_any();
if (elements == null) {
throw new RemoteException("No any");
}
if (elements.length != 3) {
throw new RemoteException("Expected: 3 got: " + elements.length +
" element");
}
String expected = "123 456";
String received = elements[0].toString();
if (!expected.equals(received)) {
throw new RemoteException("Expected: " + expected +
" received: " + received);
}
Object obj = null;
try {
obj = elements[1].getObjectValue(BookType.class);
} catch (Exception e) {
throw new RemoteException("Failed to deserialize", e);
}
BookType bookQuery = (BookType)obj;
String subject = bookQuery.getSubject();
if (!"all".equals(subject)) {
throw new RemoteException("ExtensibilityQueryBindingImpl: Book subject query should be all, instead was " + subject);
}
expected = "789";
received = elements[2].toString();
if (!expected.equals(received)) {
throw new RemoteException("Expected: " + expected +
" received: " + received);
}
ExtensibilityType reply = new ExtensibilityType();
MessageElement [] replyElements = new MessageElement[2];
BookType book = new BookType();
book.setSubject("gotAll");
QName elementName = FindBooksQueryExpressionElement.getTypeDesc().getFields()[0].getXmlName();
replyElements[0] = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), book);
replyElements[1] = new MessageElement(new Text("ABCD"));
reply.set_any(replyElements);
return reply;
}
}
| 6,528 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/extensibility/ExtensibilityQueryTestCase.java | /**
* ExtensibilityQueryTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.extensibility;
import org.apache.axis.client.AdminClient;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.Text;
import org.apache.axis.utils.Options;
import org.apache.commons.logging.Log;
import org.apache.log4j.Logger;
import javax.xml.namespace.QName;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Calendar;
public class ExtensibilityQueryTestCase extends junit.framework.TestCase {
protected static Log log =
LogFactory.getLog(ExtensibilityQueryTestCase.class.getName());
public ExtensibilityQueryTestCase(String name) {
super(name);
}
public void testExtensibilityQueryPortWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.extensibility.ExtensibilityQueryLocator().getExtensibilityQueryPortAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.extensibility.ExtensibilityQueryLocator().getServiceName());
assertTrue(service != null);
}
public void testQuery() {
ExtensibilityQueryPortType binding;
try {
ExtensibilityQueryLocator locator = new ExtensibilityQueryLocator();
binding = locator.getExtensibilityQueryPort();
deployServer();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
catch (Exception e) {
throw new junit.framework.AssertionFailedError("Binding initialization Exception caught: " + e);
}
assertTrue("binding is null", binding != null);
try {
ExtensibilityType expression = new ExtensibilityType();
BookType book = new BookType();
book.setSubject("all");
QName elementName = FindBooksQueryExpressionElement.getTypeDesc().getFields()[0].getXmlName();
MessageElement el = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), book);
expression.set_any(new MessageElement [] { el });
// call the operation
ExtensibilityType any = binding.query(expression);
// validate results
MessageElement [] anyContent = any.get_any();
assertEquals(1, anyContent.length);
ResultListType result = (ResultListType)anyContent[0].getObjectValue(ResultListType.class);
log.debug("Message " + result + ": " + anyContent[0].toString());
assertNotNull("ResultListType back from getResultList() is null", result);
QueryResultType[] queryResult = result.getResult();
assertTrue(queryResult.length == 2);
isValid(queryResult[0], "Computer Science", "The Grid");
isValid(queryResult[1], "English", "The Oxford Dictionary");
}
catch (Exception e) {
e.printStackTrace();
throw new junit.framework.AssertionFailedError("Exception caught: " + e);
}
}
public void testMixedQuery() {
ExtensibilityQueryPortType binding;
try {
ExtensibilityQueryLocator locator = new ExtensibilityQueryLocator();
binding = locator.getExtensibilityQueryPort();
deployServer();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
catch (Exception e) {
throw new junit.framework.AssertionFailedError("Binding initialization Exception caught: " + e);
}
assertTrue("binding is null", binding != null);
try {
ExtensibilityType expression = new ExtensibilityType();
MessageElement [] elements = new MessageElement[4];
elements[0] = new MessageElement(new Text("123"));
elements[1] = new MessageElement(new Text(" 456"));
BookType book = new BookType();
book.setSubject("all");
QName elementName = FindBooksQueryExpressionElement.getTypeDesc().getFields()[0].getXmlName();
elements[2] = new MessageElement(elementName.getNamespaceURI(), elementName.getLocalPart(), book);
elements[3] = new MessageElement(new Text("789"));
expression.set_any(elements);
// call the operation
ExtensibilityType any = binding.mixedQuery(expression);
if (any == null) {
throw new Exception("No output returned");
}
// validate results
MessageElement [] anyContent = any.get_any();
if (anyContent == null) {
throw new Exception("No any");
}
if (anyContent.length != 2) {
throw new Exception("Expected: 2 got: " +
anyContent.length + " element");
}
Object obj = anyContent[0].getObjectValue(BookType.class);
BookType bookQuery = (BookType)obj;
String subject = bookQuery.getSubject();
if (!"gotAll".equals(subject)) {
throw new Exception("Book subject query reply should be gotAll, instead was " + subject);
}
String expected = "ABCD";
String received = anyContent[1].toString();
if (!expected.equals(received)) {
throw new Exception("Expected: " + expected +
" received: " + received);
}
}
catch (Exception e) {
e.printStackTrace();
throw new junit.framework.AssertionFailedError("Exception caught: " + e);
}
}
private void isValid(QueryResultType result, String name, String value) {
Logger root = Logger.getRootLogger();
root.debug("Name: " + result.getName());
root.debug("Value: " + result.getValue());
assertTrue(result.getName().equals(name));
assertTrue(result.getValue().equals(value));
assertTrue(result.getStatus().equals(StatusType.MORE));
Calendar now = Calendar.getInstance();
Calendar then = result.getTime();
assertTrue("Time check failed. Result time = " + then + ", current time = " + now, then.before(now));
assertTrue(result.getQueryType().getNamespaceURI().equals("urn:QueryType"));
assertTrue(result.getQueryType().getLocalPart().equals("BookQuery"));
}
private void deployServer() {
final String INPUT_FILE = "server-deploy.wsdd";
InputStream is = getClass().getResourceAsStream(INPUT_FILE);
if (is == null) {
// try current directory
try {
is = new FileInputStream(INPUT_FILE);
} catch (FileNotFoundException e) {
is = null;
}
}
assertNotNull("Unable to find " + INPUT_FILE + ". Make sure it is on the classpath or in the current directory.", is);
AdminClient admin = new AdminClient();
try {
Options opts = new Options( null );
opts.setDefaultURL("http://localhost:8080/axis/services/AdminService");
admin.process(opts, is);
} catch (Exception e) {
assertTrue("Unable to deploy " + INPUT_FILE + ". ERROR: " + e, false);
}
}
public void testMixedType() {
MixedType1 t1 = new MixedType1();
assertTrue(t1 instanceof org.apache.axis.encoding.MixedContentType);
// restriction cases
MixedType2 t2 = new MixedType2();
assertFalse(t2 instanceof org.apache.axis.encoding.MixedContentType);
MixedType3 t3 = new MixedType3();
assertFalse(t3 instanceof org.apache.axis.encoding.MixedContentType);
}
public void testAnyAttribute() {
// if everything is right the AttributedURI class should be generated
AttributedURI uri = new AttributedURI();
assertTrue(uri instanceof org.apache.axis.encoding.SimpleType);
}
}
| 6,529 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/ExcludeBeanTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies that no classes were generated for an excluded bean
* namespace.
@author Jim Stafford jim.stafford@raba.com
*/
public class ExcludeBeanTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
String bean1Dir = "bean1";
String bean2Dir = "bean2";
String servicesDir = "services";
//excluded - set.add(bean1Dir + File.separator + "Bean1.java");
set.add(bean2Dir + File.separator + "Bean2.java");
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"excludedbean";
}
public ExcludeBeanTestCase(String name) {
super(name);
}
}
| 6,530 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/AllNamespacesTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test establishes a base capability for the selective generation tests
* whereby nothing is excluded in this test case. All files should be
* generated.
@author Jim Stafford jim.stafford@raba.com
*/
public class AllNamespacesTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
String bean1Dir = "bean1";
String bean2Dir = "bean2";
String servicesDir = "services";
set.add(bean1Dir + File.separator + "Bean1.java");
set.add(bean2Dir + File.separator + "Bean2.java");
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"allnamespaces";
}
public AllNamespacesTestCase(String name) {
super(name);
}
}
| 6,531 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/Bean1.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
/** This class provides an example of an externally generated bean class
* that will be excluded from WSDL to Java generation, but included when
* the program is executed.
@author Jim Stafford jim.stafford@raba.com
*/
public class Bean1 {
private String domain_;
private String service_;
public void setDomain(String domain) { domain_ = domain; }
public String getDomain() { return domain_; }
public void setService(String service) { service_ = service; }
public String getService() { return service_; }
}
| 6,532 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/CmdLineExcludeTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies that the selective file generation exclude option
* works with the cmd line interface where the other tests concentrated on the
* Ant task interface. This test will exclude one of the Bean classes and have
* the service(s) map to a custom bean.
@author Jim Stafford jim.stafford@raba.com
*/
public class CmdLineExcludeTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
String bean1Dir = "bean1";
String bean2Dir = "bean2";
String servicesDir = "services";
//excluded - set.add(bean1Dir + File.separator + "Bean1.java");
set.add(bean2Dir + File.separator + "Bean2.java");
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"cmdlinex";
}
public CmdLineExcludeTestCase(String name) {
super(name);
}
}
| 6,533 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/Bean2.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
/** This class provides an example of an externally generated bean class
* that will be excluded from WSDL to Java generation, but included when
* the program is executed.
@author Jim Stafford jim.stafford@raba.com
*/
public class Bean2 {
private String domain_;
private String service_;
public void setDomain(String domain) { domain_ = domain; }
public String getDomain() { return domain_; }
public void setService(String service) { service_ = service; }
public String getService() { return service_; }
}
| 6,534 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/ExcludeServiceTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies that no classes were generated for an excluded
* service namespace.
@author Jim Stafford jim.stafford@raba.com
*/
public class ExcludeServiceTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
String bean1Dir = "bean1";
String bean2Dir = "bean2";
String servicesDir = "services";
set.add(bean1Dir + File.separator + "Bean1.java");
set.add(bean2Dir + File.separator + "Bean2.java");
/* excluded -
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
*/
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"excludedsvc";
}
public ExcludeServiceTestCase(String name) {
super(name);
}
}
| 6,535 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/CmdLineIncludeTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies the cmd line interface to the selective file
* generation. This test is similar to the includes test, in that it names
* two namespaces to be generated, which causes only the bean classes to be
* generated.
@author Jim Stafford jim.stafford@raba.com
*/
public class CmdLineIncludeTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
set.add("Bean1.java");
set.add("Bean2.java");
/* not included -
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
*/
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"cmdlinei";
}
public CmdLineIncludeTestCase(String name) {
super(name);
}
}
| 6,536 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/IncludeBeanTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies that no classes were generated besides the included
* bean namespaces.
@author Jim Stafford jim.stafford@raba.com
*/
public class IncludeBeanTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
set.add("Bean1.java");
set.add("Bean2.java");
/* excluded -
set.add(servicesDir + File.separator + "Reporter.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingImpl.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingStub.java");
set.add(servicesDir + File.separator + "ReporterSoapBindingSkeleton.java");
set.add(servicesDir + File.separator + "deploy.wsdd");
set.add(servicesDir + File.separator + "undeploy.wsdd");
*/
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"includedbean";
}
public IncludeBeanTestCase(String name) {
super(name);
}
}
| 6,537 |
0 | Create_ds/axis-axis1-java/test/wsdl | Create_ds/axis-axis1-java/test/wsdl/selectivefilegen/IncludeServiceTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//File: AntTestCase.java
package test.wsdl.selectivefilegen;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import test.wsdl.filegen.FileGenTestCase;
/**
* This test verifies that only the classes for the included service
* namespace were generated.
@author Jim Stafford jim.stafford@raba.com
*/
public class IncludeServiceTestCase extends FileGenTestCase {
/**
* List of files which should be generated.
*/
protected Set shouldExist() {
HashSet set = new HashSet();
//not included - set.add(bean1Dir + File.separator + "Bean1.java");
//not included - set.add(bean2Dir + File.separator + "Bean2.java");
set.add("Reporter.java");
set.add("ReporterSoapBindingImpl.java");
set.add("ReporterSoapBindingStub.java");
set.add("ReporterSoapBindingSkeleton.java");
set.add("deploy.wsdd");
set.add("undeploy.wsdd");
return set;
}
protected String rootDir() {
return "build" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"selectivefilegen" + File.separator +
"includedsvc";
}
public IncludeServiceTestCase(String name) {
super(name);
}
}
| 6,538 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/client/TestCall.java | /*
* Copyright 2002-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.client;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import java.io.InterruptedIOException;
import java.net.ConnectException;
import java.net.URL;
public class TestCall extends TestCase {
public TestCall(String name) {
super(name);
}
public static Test suite() {
return new TestSuite(TestCall.class);
}
protected void setup() {
}
/* Test case for Bug 23031 - No deserializer found for ns1:ArrayOfstring */
public void testWeatherService() throws Exception {
try {
Call call = new Call(new URL("http://live.capescience.com:80/ccx/GlobalWeather"));
call.setUseSOAPAction(true);
call.setSOAPActionURI("capeconnect:GlobalWeather:StationInfo#listCountries");
call.setTimeout(new Integer(15*1000));
call.setOperationName(new javax.xml.namespace.QName("capeconnect:GlobalWeather:StationInfo", "listCountries"));
String[] c = (String[]) call.invoke(new Object[]{});
System.out.println(c.length);
for (int i = 0; i < c.length; i++) {
System.out.println(c[i]);
}
} catch (AxisFault fault) {
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
(fault.getFaultString().indexOf("Connection timed out") != -1) ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("getTemp HTTP error: " + fault);
return;
}
throw fault;
}
}
}
| 6,539 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/client/PackageTests.java | package test.client;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
*/
public class PackageTests
{
public static void main (String[] args) {
junit.textui.TestRunner.run (suite());
}
public static Test suite()
{
TestSuite suite = new TestSuite("All Axis Call tests");
suite.addTest(TestCall.suite());
suite.addTest(TestAsyncCall.suite());
return suite;
}
}
| 6,540 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/client/TestAsyncCall.java | /*
* Copyright 2002-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.client;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.axis.client.Call;
import org.apache.axis.client.async.AsyncCall;
import org.apache.axis.client.async.IAsyncCallback;
import org.apache.axis.client.async.IAsyncResult;
import org.apache.axis.client.async.Status;
import java.net.MalformedURLException;
import java.net.URL;
public class TestAsyncCall extends TestCase {
public TestAsyncCall(String name) {
super(name);
}
public static Test suite() {
return new TestSuite(TestAsyncCall.class);
}
protected void setup() {
}
public void testAsyncPollWeatherService() throws MalformedURLException, InterruptedException {
Call call = new Call(new URL("http://live.capescience.com:80/ccx/GlobalWeather"));
call.setUseSOAPAction(true);
call.setSOAPActionURI("capeconnect:GlobalWeather:StationInfo#listCountries");
call.setTimeout(new Integer(15 * 1000));
call.setOperationName(new javax.xml.namespace.QName("capeconnect:GlobalWeather:StationInfo", "listCountries"));
AsyncCall ac = new AsyncCall(call);
IAsyncResult result = ac.invoke(new Object[]{});
System.out.println("STARTED");
Status status = null;
while ((status = result.getStatus()) == Status.NONE) {
System.out.print('.');
Thread.sleep(50);
}
System.out.println("FINISHED");
if (status == Status.COMPLETED) {
String[] c = (String[]) result.getResponse();
System.out.println(c.length);
for (int i = 0; i < c.length; i++) {
System.out.println(c[i]);
}
} else if (status == Status.EXCEPTION) {
result.getException().printStackTrace();
}
}
public void testAsyncCallbackWeatherService() throws MalformedURLException, InterruptedException {
final Call call = new Call(new URL("http://live.capescience.com:80/ccx/GlobalWeather"));
call.setUseSOAPAction(true);
call.setSOAPActionURI("capeconnect:GlobalWeather:StationInfo#listCountries");
call.setTimeout(new Integer(15 * 1000));
call.setOperationName(new javax.xml.namespace.QName("capeconnect:GlobalWeather:StationInfo", "listCountries"));
final AsyncCall ac = new AsyncCall(call, new IAsyncCallback() {
public void onCompletion(IAsyncResult result) {
Status status = result.getStatus();
System.out.println(".....FINISHED");
if (status == Status.COMPLETED) {
String[] c = (String[]) result.getResponse();
System.out.println(c.length);
for (int i = 0; i < c.length; i++) {
System.out.println(c[i]);
}
} else if (status == Status.EXCEPTION) {
result.getException().printStackTrace();
}
synchronized (call) {
call.notifyAll();
}
}
});
IAsyncResult result = ac.invoke(new Object[]{});
System.out.println("STARTED....");
synchronized (call) {
call.wait(0);
}
}
}
| 6,541 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/functional/FunctionalTests.java | package test.functional;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.axis.utils.ClassUtils;
/**
* Axis's FunctionalTests test client/server interactions.
*/
public class FunctionalTests extends TestCase
{
public FunctionalTests(String name)
{
super(name);
}
public static Test suite() throws Exception
{
TestSuite suite = new TestSuite();
// Echo test - end to end serialization and deserialization /
// interop tests.
suite.addTestSuite(TestEchoSample.class);
// Test the JAX-RPC compliance samples
suite.addTestSuite(TestJAXRPCSamples.class);
// Test the JAXM compliance samples
suite.addTestSuite(TestJAXMSamples.class);
// stock sample test
// run this BEFORE ALL OTHER TESTS to minimize confusion;
// this will run the JWS test first, and we want to know that
// nothing else has been deployed
suite.addTestSuite(TestStockSample.class);
// JWS global types test (deploys a typeMapping)
suite.addTestSuite(TestJWSGlobalTypes.class);
// TCP transport sample test
suite.addTestSuite(TestTCPTransportSample.class);
// file transport sample test
// TODO: this test no longer works because it depends on a 3rd party service that is no longer available
// suite.addTestSuite(TestTransportSample.class);
// bid-buy test
suite.addTestSuite(TestBidBuySample.class);
// "Raw" echo service test.
suite.addTestSuite(TestMiscSample.class);
// Proxy service test.
//suite.addTestSuite(TestProxySample.class);
// Element service test.
suite.addTestSuite(TestElementSample.class);
// Message service test.
suite.addTestSuite(TestMessageSample.class);
// test.rpc test
suite.addTestSuite(TestIF3SOAP.class);
// samples.fault test
suite.addTestSuite(TestFaultsSample.class);
suite.addTestSuite(TestEncoding.class);
// Attachments service test.
try{
if( null != ClassUtils.forName("javax.activation.DataHandler") &&
null != ClassUtils.forName("javax.mail.internet.MimeMultipart")){
suite.addTestSuite( ClassUtils.forName("test.functional.TestAttachmentsSample"));
}
}catch( Throwable t){;}
// MIME headers test.
// BROKEN - COMMENTED OUT FOR NOW --gdaniels
//suite.addTestSuite(TestMimeHeaders.class);
suite.addTestSuite(TestAutoTypes.class);
return suite;
}
}
| 6,542 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/functional/GlobalBean.java | /*
* Copyright 2002-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Glen Daniels (gdaniels@apache.org)
*/
package test.functional;
public class GlobalBean {
private int intValue;
public int getIntValue() {
return intValue;
}
public void setIntValue(int intValue) {
this.intValue = intValue;
}
}
| 6,543 |
0 | Create_ds/axis-axis1-java/test | Create_ds/axis-axis1-java/test/functional/TestJWSGlobalTypes.java | /*
* Copyright 2002-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author Glen Daniels (gdaniels@apache.org)
*/
package test.functional;
import junit.framework.TestCase;
import org.apache.axis.client.AdminClient;
import org.apache.axis.client.Call;
import org.apache.axis.deployment.wsdd.WSDDConstants;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.utils.Options;
import javax.xml.namespace.QName;
import java.io.ByteArrayInputStream;
public class TestJWSGlobalTypes extends TestCase {
private static final String TYPEMAPPING_WSDD =
"<deployment xmlns=\"" + WSDDConstants.URI_WSDD + "\" " +
"xmlns:java=\"" + WSDDConstants.URI_WSDD_JAVA + "\" " +
"xmlns:ns=\"http://globalTypeTest\">\n" +
" <beanMapping type=\"java:test.functional.GlobalBean\" " +
"qname=\"ns:GlobalType\"/>\n" +
"</deployment>";
public TestJWSGlobalTypes(String s) {
super(s);
}
protected void setUp() throws Exception {
// Deploy the type mapping
AdminClient client = new AdminClient();
Options opts = new Options(null);
ByteArrayInputStream bis =
new ByteArrayInputStream(TYPEMAPPING_WSDD.getBytes());
client.process(opts, bis);
}
public void testGlobalTypes() throws Exception {
Call call = new Call("http://localhost:8080/jws/GlobalTypeTest.jws");
QName qname = new QName("http://globalTypeTest", "GlobalType");
call.registerTypeMapping(GlobalBean.class, qname,
new BeanSerializerFactory(GlobalBean.class, qname),
new BeanDeserializerFactory(GlobalBean.class, qname));
GlobalBean bean = new GlobalBean();
bean.setIntValue(4);
GlobalBean ret = (GlobalBean)call.invoke("echo", new Object [] { bean });
assertEquals(4, ret.getIntValue());
}
}
| 6,544 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestSOAPService.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import java.net.URL;
import junit.framework.TestCase;
public class TestSOAPService extends TestCase {
private Dummy dummy;
protected void setUp() throws Exception {
dummy = new DummyServiceLocator().getDummy(new URL(
"http://localhost:" + System.getProperty("axis.httpPort", "8080") + "/axis/services/Dummy"));
}
public void testTwoWay() throws Exception {
assertEquals("Hi there!", dummy.echo("Hi there!"));
}
public void testFault() throws Exception {
try {
dummy.faultTest();
fail("Expected SOAP fault");
} catch (Fault fault) {
// OK
}
}
}
| 6,545 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestGET.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import junit.framework.TestCase;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.soap.SOAP12Constants;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.types.Time;
public class TestGET extends TestCase {
public void testXMLP2() throws Exception {
Call call = new Call("http://localhost:" + System.getProperty("jetty.httpPort", "9080") + "/soap12/add-test-doc/getTime");
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.setProperty(SOAP12Constants.PROP_WEBMETHOD, "GET");
call.setOperationStyle(Style.DOCUMENT);
call.setOperationUse(Use.LITERAL);
call.invoke();
SOAPEnvelope env = call.getMessageContext().getResponseMessage().getSOAPEnvelope();
Object result = env.getFirstBody().getValueAsType(Constants.XSD_TIME);
assertEquals(Time.class, result.getClass());
}
public void testXMLP3() throws Exception {
Call call = new Call("http://localhost:" + System.getProperty("jetty.httpPort", "9080") + "/soap12/add-test-rpc/getTime");
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.setProperty(SOAP12Constants.PROP_WEBMETHOD, "GET");
call.setOperationStyle(Style.RPC);
call.setReturnType(Constants.XSD_TIME);
Object ret = call.invoke("", new Object [] {});
assertEquals(Time.class, ret.getClass());
}
}
| 6,546 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/DummySOAPImpl.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import java.rmi.RemoteException;
public class DummySOAPImpl implements Dummy {
public String echo(String in) throws RemoteException {
return in;
}
public void faultTest() throws RemoteException, Fault {
throw new Fault();
}
}
| 6,547 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestDefaultConfiguration.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import junit.framework.TestCase;
import org.apache.axis.Handler;
import org.apache.axis.SimpleTargetedChain;
import org.apache.axis.client.AxisClient;
import org.apache.axis.configuration.DefaultConfiguration;
/**
* Tests that {@link DefaultConfiguration} (with type <tt>client</tt>) configures the java.net
* transport as default HTTP transport if it is in the classpath.
*
* @author Andreas Veithen
*/
public class TestDefaultConfiguration extends TestCase {
public void test() throws Exception {
AxisClient client = new AxisClient(new DefaultConfiguration("client"));
Handler[] handlers = ((SimpleTargetedChain)client.getTransport("http")).getHandlers();
assertTrue(handlers[0] instanceof JavaNetHTTPSender);
}
}
| 6,548 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/test/java/org/apache/axis/transport/http/javanet/TestErrors.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import junit.framework.TestCase;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.w3c.dom.Element;
public class TestErrors extends TestCase {
public void test404() throws Exception {
Call call = new Call("http://localhost:" + System.getProperty("axis.httpPort", "8080") + "/doesnt-exist");
call.setOperationName("test");
try {
call.invoke(new Object[0]);
fail("Expected AxisFault");
} catch (AxisFault fault) {
Element[] details = fault.getFaultDetails();
assertEquals(2, details.length);
Element detail = details[1];
assertEquals(Constants.QNAME_FAULTDETAIL_HTTPERRORCODE.getNamespaceURI(), detail.getNamespaceURI());
assertEquals(Constants.QNAME_FAULTDETAIL_HTTPERRORCODE.getLocalPart(), detail.getLocalName());
assertEquals("404", detail.getFirstChild().getNodeValue());
}
}
}
| 6,549 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/main/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/main/java/org/apache/axis/transport/http/javanet/JavaNetHTTPSender.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.encoding.Base64;
import org.apache.axis.handlers.BasicHandler;
import org.apache.axis.soap.SOAP12Constants;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.commons.logging.Log;
/**
* Pivot handler for the HTTP transport based on the {@link HttpURLConnection} API.
*
* @author Andreas Veithen
*/
public class JavaNetHTTPSender extends BasicHandler {
private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(JavaNetHTTPSender.class.getName());
/**
* The value of the <tt>User-Agent</tt> header. It is composed of the Axis version, the version
* of JavaNetHTTPSender (which may be different, because it may work with older Axis versions as
* well) and the Java version (which is important because we are using the HTTP client of the
* JRE).
*/
private static final String userAgent = Messages.getMessage("axisUserAgent") + " "
+ Messages.getMessage("userAgentToken") + " Java/" + System.getProperty("java.version");
public void invoke(MessageContext msgContext) throws AxisFault {
try {
Message request = msgContext.getRequestMessage();
if (request != null && "GET".equals(msgContext.getStrProp(SOAP12Constants.PROP_WEBMETHOD))) {
// Always ignore the request message if the request is explicitly marked as a GET request
request = null;
}
URL url = new URL(msgContext.getStrProp(MessageContext.TRANS_URL));
// Create and configure HttpURLConnection
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setDoInput(true);
if (request != null) {
connection.setDoOutput(true);
connection.setChunkedStreamingMode(0); // 0 means default chunk size
}
int timeout = msgContext.getTimeout();
connection.setConnectTimeout(timeout);
connection.setReadTimeout(timeout);
connection.setUseCaches(false);
connection.addRequestProperty(HTTPConstants.HEADER_USER_AGENT, userAgent);
connection.addRequestProperty(HTTPConstants.HEADER_ACCEPT,
HTTPConstants.HEADER_ACCEPT_APPL_SOAP + ", "
+ HTTPConstants.HEADER_ACCEPT_APPLICATION_DIME + ", "
+ HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED + ", "
+ HTTPConstants.HEADER_ACCEPT_TEXT_ALL);
// Set "SOAPAction" header
String action = null;
if (msgContext.useSOAPAction()) {
action = msgContext.getSOAPActionURI();
}
if (action == null) {
action = "";
}
connection.addRequestProperty(HTTPConstants.HEADER_SOAP_ACTION, action);
// Set "Authorization" header
String userID = msgContext.getUsername();
if (userID != null) {
String passwd = msgContext.getPassword();
byte[] token = (userID + ":" + (passwd == null ? "" : passwd)).getBytes("UTF-8");
connection.addRequestProperty(HTTPConstants.HEADER_AUTHORIZATION, "Basic " + Base64.encode(token));
}
if (request != null) {
// Set "Content-Type" header
connection.setRequestProperty(HTTPConstants.HEADER_CONTENT_TYPE,
request.getContentType(msgContext.getSOAPConstants()));
// Send request
OutputStream out = connection.getOutputStream();
request.writeTo(out);
out.close();
}
// Process response
int statusCode = connection.getResponseCode();
String responseContentType = connection.getHeaderField(HTTPConstants.HEADER_CONTENT_TYPE);
String rawResponseContentType;
if (responseContentType == null) {
rawResponseContentType = null;
} else {
int idx = responseContentType.indexOf(';');
rawResponseContentType = idx == -1 ? responseContentType : responseContentType.substring(0, idx);
}
if (log.isDebugEnabled()) {
log.debug("Status code: " + statusCode);
log.debug("Content type: " + responseContentType);
log.debug("Raw content type: " + rawResponseContentType);
}
InputStream in;
// TODO: need to recognize at least 202 here!
// TODO: if we enable chunkedStreamingMode, then redirection is not handled transparently
if (statusCode == 200) {
in = connection.getInputStream();
} else if (statusCode == 500 && rawResponseContentType != null
&& (rawResponseContentType.equalsIgnoreCase(SOAPConstants.SOAP11_CONSTANTS.getContentType())
|| rawResponseContentType.equalsIgnoreCase(SOAPConstants.SOAP12_CONSTANTS.getContentType()))) {
in = connection.getErrorStream();
} else {
// TODO: extract charset encoding from document type (reuse the code in org.apache.axisMessage?)
Reader reader = new InputStreamReader(connection.getErrorStream(), "UTF-8");
StringBuffer content = new StringBuffer();
char[] buffer = new char[4096];
int c;
while ((c = reader.read(buffer)) != -1) {
content.append(buffer, 0, c);
}
reader.close();
AxisFault fault = new AxisFault("HTTP", statusCode + " " + connection.getResponseMessage(), null, null);
fault.setFaultDetailString(content.toString());
fault.addFaultDetail(Constants.QNAME_FAULTDETAIL_HTTPERRORCODE, Integer.toString(statusCode));
throw fault;
}
Message response = new Message(in, false, responseContentType,
connection.getHeaderField(HTTPConstants.HEADER_CONTENT_LOCATION));
MimeHeaders mimeHeaders = response.getMimeHeaders();
String key;
for (int i=0; (key = connection.getHeaderField(i)) != null; i++) {
mimeHeaders.addHeader(key, connection.getHeaderField(i));
}
response.setMessageType(Message.RESPONSE);
msgContext.setResponseMessage(response);
// Note: the JRE seems to automatically release/recycle the connection when the response stream has
// been consumed; therefore we don't need to do anything to explicitly close the connection
} catch (IOException ex) {
if (log.isDebugEnabled()) {
log.debug("Failed to send to " + msgContext.getStrProp(MessageContext.TRANS_URL), ex);
}
throw AxisFault.makeFault(ex);
} catch (SOAPException ex) {
throw AxisFault.makeFault(ex);
}
}
}
| 6,550 |
0 | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/main/java/org/apache/axis/transport/http | Create_ds/axis-axis1-java/axis-rt-transport-http-javanet/src/main/java/org/apache/axis/transport/http/javanet/Messages.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.axis.transport.http.javanet;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.apache.axis.i18n.MessageBundle;
import org.apache.axis.i18n.MessagesConstants;
/**
* Message resources for the <code>org.apache.axis.transport.http.javanet</code> package.
*
* @see org.apache.axis.i18n.Messages
*/
public class Messages {
private static final Class thisClass = Messages.class;
private static final String projectName = MessagesConstants.projectName;
private static final String resourceName = MessagesConstants.resourceName;
private static final Locale locale = MessagesConstants.locale;
private static final String packageName = getPackage(thisClass.getName());
private static final ClassLoader classLoader = thisClass.getClassLoader();
private static final ResourceBundle parent =
(MessagesConstants.rootPackageName == packageName)
? null
: MessagesConstants.rootBundle;
/***** NO NEED TO CHANGE ANYTHING BELOW *****/
private static final MessageBundle messageBundle =
new MessageBundle(projectName, packageName, resourceName,
locale, classLoader, parent);
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @return The formatted message
*/
public static String getMessage(String key)
throws MissingResourceException
{
return messageBundle.getMessage(key);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @return The formatted message
*/
public static String getMessage(String key, String arg0)
throws MissingResourceException
{
return messageBundle.getMessage(key, arg0);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @return The formatted message
*/
public static String getMessage(String key, String arg0, String arg1)
throws MissingResourceException
{
return messageBundle.getMessage(key, arg0, arg1);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @return The formatted message
*/
public static String getMessage(String key, String arg0, String arg1, String arg2)
throws MissingResourceException
{
return messageBundle.getMessage(key, arg0, arg1, arg2);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @param arg3 The argument to place in variable {3}
* @return The formatted message
*/
public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3)
throws MissingResourceException
{
return messageBundle.getMessage(key, arg0, arg1, arg2, arg3);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param arg0 The argument to place in variable {0}
* @param arg1 The argument to place in variable {1}
* @param arg2 The argument to place in variable {2}
* @param arg3 The argument to place in variable {3}
* @param arg4 The argument to place in variable {4}
* @return The formatted message
*/
public static String getMessage(String key, String arg0, String arg1, String arg2, String arg3, String arg4)
throws MissingResourceException
{
return messageBundle.getMessage(key, arg0, arg1, arg2, arg3, arg4);
}
/**
* Get a message from resource.properties from the package of the given object.
* @param key The resource key
* @param args An array of objects to place in corresponding variables
* @return The formatted message
*/
public static String getMessage(String key, String[] args)
throws MissingResourceException
{
return messageBundle.getMessage(key, args);
}
public static ResourceBundle getResourceBundle() {
return messageBundle.getResourceBundle();
}
public static MessageBundle getMessageBundle() {
return messageBundle;
}
private static final String getPackage(String name) {
return name.substring(0, name.lastIndexOf('.')).intern();
}
}
| 6,551 |
0 | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializerFactory.java | /*
* XmlBeanSerializerFactory.java
*
* Copyright 2001-2004 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* Original author: Jonathan Colwell
*/
package org.apache.axis.encoding.ser.xbeans;
import org.apache.axis.encoding.ser.BaseSerializerFactory;
import javax.xml.namespace.QName;
/**
* Class XmlBeanSerializerFactory
* @author Jonathan Colwell
*/
public class XmlBeanSerializerFactory extends BaseSerializerFactory {
public XmlBeanSerializerFactory(Class javaType, QName xmlType) {
super(XmlBeanSerializer.class, xmlType, javaType);
}
}
| 6,552 |
0 | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializer.java | /*
* XmlBeanDeserializer.java
*
* Copyright 2001-2004 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* Original author: Jonathan Colwell
*/
package org.apache.axis.encoding.ser.xbeans;
import org.apache.axis.encoding.DeserializationContext;
import org.apache.axis.encoding.DeserializerImpl;
import org.apache.axis.message.MessageElement;
import org.apache.xmlbeans.QNameSet;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import javax.xml.namespace.QName;
/**
* Class XmlBeanDeserializer
* @author Jonathan Colwell
*/
public class XmlBeanDeserializer extends DeserializerImpl {
private Class mJavaType;
public XmlBeanDeserializer(Class javaType, QName xmlType) {
mJavaType = javaType;
}
public void onStartElement(String namespace, String localName,
String prefix, Attributes attributes,
DeserializationContext context)
throws SAXException {
try {
MessageElement me = context.getCurElement();
XmlOptions opts = new XmlOptions()
.setLoadReplaceDocumentElement(null);
XmlObject xObj = XmlObject.Factory.parse(me, opts);
SchemaType jt = (SchemaType) mJavaType.getField("type").get(null);
XmlObject converted = xObj.changeType(jt);
if (converted != null) {
setValue(converted);
} else {
XmlObject[] children = xObj.selectChildren(QNameSet.ALL);
for (int j = 0; j < children.length; j++) {
converted = xObj.changeType(jt);
if (converted != null) {
setValue(converted);
break;
}
}
}
} catch (Exception xe) {
throw new SAXException(xe);
}
}
}
| 6,553 |
0 | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanDeserializerFactory.java | /*
* XmlBeanDeserializerFactory.java
*
* Copyright 2001-2004 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* Original author: Jonathan Colwell
*/
package org.apache.axis.encoding.ser.xbeans;
import org.apache.axis.encoding.ser.BaseDeserializerFactory;
import javax.xml.namespace.QName;
/**
* Class XmlBeanDeserializerFactory
* @author Jonathan Colwell
*/
public class XmlBeanDeserializerFactory extends BaseDeserializerFactory {
public XmlBeanDeserializerFactory(Class javaType, QName xmlType) {
super(XmlBeanDeserializer.class, xmlType, javaType);
}
}
| 6,554 |
0 | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser | Create_ds/axis-axis1-java/axis-rt-databinding-xmlbeans/src/main/java/org/apache/axis/encoding/ser/xbeans/XmlBeanSerializer.java | /*
* XmlBeanSerializer.java
*
* Copyright 2001-2004 The Apache Software Foundation.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Original author: Jonathan Colwell
*/
package org.apache.axis.encoding.ser.xbeans;
import org.apache.axis.AxisFault;
import org.apache.axis.Constants;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.wsdl.fromJava.Types;
import org.apache.xmlbeans.SchemaField;
import org.apache.xmlbeans.SchemaType;
import org.apache.xmlbeans.SchemaTypeLoader;
import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.impl.xb.xsdschema.LocalElement;
import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
import org.apache.xmlbeans.impl.xb.xsdschema.TopLevelComplexType;
import org.apache.xmlbeans.impl.xb.xsdschema.TopLevelElement;
import org.apache.xmlbeans.impl.xb.xsdschema.TopLevelSimpleType;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.Attributes;
import org.xmlsoap.schemas.wsdl.DefinitionsDocument;
import org.xmlsoap.schemas.wsdl.TTypes;
import javax.xml.namespace.QName;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Array;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
/**
* Class XmlBeanSerializer
*
* @author Jonathan Colwell
*/
public class XmlBeanSerializer implements Serializer {
/**
* Serialize an element named name, with the indicated attributes
* and value.
*
* @param name is the element name
* @param attributes are the attributes...serialize is free to add more.
* @param value is the value
* @param context is the SerializationContext
*/
public void serialize(QName name, Attributes attributes,
Object value, SerializationContext context)
throws IOException {
if (!(value instanceof XmlObject)) {
throw new IOException(((value != null) ?
value.getClass().getName()
: "null")
+ " is not an "
+ XmlObject.class.getName());
} else {
context.setWriteXMLType(null);
context.startElement(name, attributes);
XmlCursor xCur = ((XmlObject) value).newCursor();
if (xCur.toFirstContentToken() == XmlCursor.TokenType.START) {
do {
Node n = xCur.getDomNode();
if (n.getNodeType() == Node.ELEMENT_NODE) {
context.writeDOMElement((Element) n);
}
} while (xCur.toNextSibling());
}
context.endElement();
}
}
public String getMechanismType() {
return Constants.AXIS_SAX;
}
/**
* Return XML schema for the specified type, suitable for insertion into the
* <types> element of a WSDL document, or underneath an
* <element> or <attribute> declaration.
*
* @param javaType the Java Class we're writing out schema for
* @param types the Java2WSDL Types object which holds the context for the
* WSDL being generated.
* @return a type element containing a schema simpleType/complexType
* @see org.apache.axis.wsdl.fromJava.Types
*/
public Element writeSchema(Class javaType, Types types) throws Exception {
try {
if (!XmlObject.class.isAssignableFrom(javaType)) {
throw new RuntimeException(
"Invalid Object type is assigned to the XMLBeanSerialization Type: "
+ javaType);
}
SchemaType docType = XmlBeans.typeForClass(javaType);
writeSchemaForDocType(docType, types);
// assume that the writeSchemaForDocType wrote the schema
// for the type and all the dependent types.
return null;
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
private void writeSchemaForDocType(SchemaType docType, Types types)
throws Exception {
SchemaDocument.Schema[] mySchemas = findtSchemaDocument(docType);
QName q = docType.getName();
XmlObject typeNodeInWSDL = getTypeNode(mySchemas, q);
if (null == typeNodeInWSDL)
throw new RuntimeException(
"Type for object not found in the assigned WSDL file. "
+ docType.getName() + " schema in: "
+ docType.getSourceName());
// insertDependentTypes(typeNodeInWSDL, types);
Node n = typeNodeInWSDL.getDomNode();
Document doc = types.createElement(
"element_to_get_document_useless_otherwise").getOwnerDocument();
Element e = (Element) doc.importNode(n, true);
try {
types.writeSchemaElementDecl(q, e);
} catch (AxisFault e1) {
// this means the types was already in... fine!
// TBD: make sure there are other types of exceptions are at least
// reported
}
Set dependentTypes = new HashSet();
getAllDependentTypes(typeNodeInWSDL, dependentTypes);
for (java.util.Iterator it = dependentTypes.iterator(); it.hasNext();) {
QName nxtType = (QName) it.next();
Class nxtJavaType;
// add the class if it is an xml bean
if (null != (nxtJavaType = q2UserClass(nxtType))
&& XmlObject.class.isAssignableFrom(nxtJavaType)) {
writeSchema(nxtJavaType, types);
}
}
}
private Class q2UserClass(QName qname) {
SchemaTypeLoader stl = XmlBeans.getContextTypeLoader();
SchemaType st = stl.findType(qname);
if (st == null) {
SchemaField sf = stl.findElement(qname);
if (sf != null)
st = sf.getType();
}
if (st != null && !st.isBuiltinType())
return st.getJavaClass();
// for classes that are not found, or are built in
return null;
}
/**
* @param nodeInWSDL
* @param dependentTypes Walk all the nodes under the nodeInWSDL if there is an 'element' type the
* add its types or references to the dependent type.
*/
private void getAllDependentTypes(XmlObject nodeInWSDL,
Set dependentTypes) {
// scan for any node under the type that has "type" or "ref" attribute
XmlCursor cursor = nodeInWSDL.newCursor();
if (cursor.toFirstChild()) { // has child
while (true) {
getAllDependentTypes(cursor.getObject(), dependentTypes);
if (!cursor.toNextSibling())
break;
}
}
if (nodeInWSDL.schemaType().getName().getLocalPart().equals(
"localElement")) {
LocalElement e = (LocalElement) nodeInWSDL;
if (e.isSetType())
dependentTypes.add(e.getType());
else if (e.isSetRef())
dependentTypes.add(e.getRef());
}
}
public static DefinitionsDocument parseWSDL(String wsdlLocation)
throws IOException, MalformedURLException, XmlException {
if (wsdlLocation.indexOf("://") > 2) {
return parseWSDL(new URL(wsdlLocation));
} else {
return parseWSDL(new File(wsdlLocation));
}
}
public static DefinitionsDocument parseWSDL(File wsdlFile)
throws IOException, XmlException {
return DefinitionsDocument.Factory.parse(wsdlFile);
}
public static DefinitionsDocument parseWSDL(URL wsdlURL)
throws IOException, XmlException {
return DefinitionsDocument.Factory.parse(wsdlURL);
}
public static DefinitionsDocument parseWSDL(InputStream wsdlStream)
throws IOException, XmlException {
return DefinitionsDocument.Factory.parse(wsdlStream);
}
public static SchemaDocument parseSchema(InputStream stream)
throws XmlException, IOException {
return SchemaDocument.Factory.parse(stream);
}
public static SchemaDocument.Schema[] selectChildren(XmlObject parent, Class childClass)
throws IllegalAccessException, NoSuchFieldException {
// retrieve the SchemaType from the static type field
SchemaType st = (SchemaType) childClass.getField("type").get(null);
XmlObject[] kids = parent.selectChildren(st.getDocumentElementName());
SchemaDocument.Schema[] castKids = (SchemaDocument.Schema[]) Array.newInstance(childClass, kids.length);
for (int j = 0; j < castKids.length; j++) {
castKids[j] = (SchemaDocument.Schema) kids[j];
}
return castKids;
}
public static SchemaDocument.Schema[] findtSchemaDocument(SchemaType docType)
throws XmlException, IOException, IllegalAccessException, NoSuchFieldException {
SchemaDocument.Schema[] schemas = null;
String schemaSrc = docType.getSourceName();
InputStream stream = null;
try {
stream = docType.getTypeSystem().getSourceAsStream(schemaSrc);
if (null == stream) {
throw new RuntimeException("WSDL file not found: " + schemaSrc);
}
if (schemaSrc.toLowerCase().endsWith(".wsdl")) {
TTypes tt = parseWSDL(stream).getDefinitions().getTypesArray(0);
schemas = selectChildren(tt, SchemaDocument.Schema.class);
} else {
SchemaDocument schemaDoc = parseSchema(stream);
schemas = new SchemaDocument.Schema[1];
schemas[0] = schemaDoc.getSchema();
}
} finally {
if (null != stream)
stream.close();
}
return schemas;
}
public static XmlObject getTypeNode(SchemaDocument.Schema[] schemas, QName q) {
// first find the schema with matching namespace
SchemaDocument.Schema schema = null;
for (int i = 0; i < schemas.length; i++) {
SchemaDocument.Schema nxtSchema = schemas[i];
if (nxtSchema.getTargetNamespace() != null
&& nxtSchema.getTargetNamespace().equals(
q.getNamespaceURI())) {
schema = nxtSchema;
break;
}
}
if (null == schema)
return null; // namespace is not found in this schema.
// look in complex types
TopLevelComplexType[] tlComplexTypes = schema.getComplexTypeArray();
for (int i = 0; i < tlComplexTypes.length; i++) {
TopLevelComplexType nxtComplexType = tlComplexTypes[i];
if (nxtComplexType.getName().equals(q.getLocalPart())) {
return nxtComplexType;
}
}
// look in simple types
TopLevelSimpleType[] tlSimpleTypes = schema.getSimpleTypeArray();
for (int i = 0; i < tlSimpleTypes.length; i++) {
TopLevelSimpleType nxtSimpleType = tlSimpleTypes[i];
if (nxtSimpleType.getName().equals(q.getLocalPart())) {
return nxtSimpleType;
}
}
// look in element types
TopLevelElement[] tlElementTypes = schema.getElementArray();
for (int i = 0; i < tlElementTypes.length; i++) {
TopLevelElement nxtElement = tlElementTypes[i];
if (nxtElement.getName().equals(q.getLocalPart())) {
return nxtElement;
}
}
return null; // it is not in comlex or simple types!
}
}
| 6,555 |
0 | Create_ds/axis-axis1-java/integration/src/test/java | Create_ds/axis-axis1-java/integration/src/test/java/test/HttpTestUtil.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package test;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Contains utility methods for tests that use the stand-alone server.
*
* @author Andreas Veithen
*/
public class HttpTestUtil {
/**
* Get the URL of the test endpoint by replacing the port number in the original URL with the
* one specified by the <tt>test.functional.ServicePort</tt> system property.
*
* @param orgUrl
* the original URL
* @return the modified URL
* @throws MalformedURLException
*/
public static URL getTestEndpoint(String orgUrl) throws MalformedURLException {
URL url = new URL(orgUrl);
return new URL(url.getProtocol(), url.getHost(), Integer.parseInt(System.getProperty("test.functional.ServicePort", "8080")), url.getFile());
}
}
| 6,556 |
0 | Create_ds/axis-axis1-java/integration/src/test/java | Create_ds/axis-axis1-java/integration/src/test/java/test/GenericLocalTest.java | /*
* Copyright 2002-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test;
import junit.framework.TestCase;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.configuration.BasicServerConfig;
import org.apache.axis.configuration.SimpleProvider;
import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;
import org.apache.axis.handlers.soap.SOAPService;
import org.apache.axis.providers.java.RPCProvider;
import org.apache.axis.server.AxisServer;
import org.apache.axis.transport.local.LocalTransport;
import org.apache.axis.Handler;
/**
* This is a framework class which handles all the basic stuff necessary
* to set up a local "roundtrip" test to an AxisServer.
*
* To use it - extend this class with your own test. Make sure if you
* override setUp() that you call super.setUp() so that the engine gets
* initialized correctly. The method deploy() needs to be called to deploy
* a target service and set up the transport to talk to it - note that this
* is done by default in the no-argument setUp(). If you don't want this
* behavior, or want to tweak names/classes, just call super.setUp(false)
* instead of super.setUp() and the deploy() call won't happen.
*
* Then you get a Call object by calling getCall() and you're ready to rock.
*
* @author Glen Daniels (gdaniels@apache.org)
*/
public abstract class GenericLocalTest extends TestCase {
protected AxisServer server;
protected SimpleProvider config;
protected LocalTransport transport;
protected SOAPService service = null;
public GenericLocalTest(String s) {
super(s);
}
/**
* Default setUp, which automatically deploys the current class
* as a service named "service". Override to switch this off.
*
* @throws Exception
*/
protected void setUp() throws Exception {
setUp(true);
}
/**
* setUp which allows controlling whether or not deploy() is called.
*
* @param deploy indicates whether we should call deploy()
* @throws Exception
*/
protected void setUp(boolean deploy) throws Exception {
super.setUp();
config = new BasicServerConfig();
server = new AxisServer(config);
transport = new LocalTransport(server);
if (deploy)
deploy();
}
/**
* Get an initialized Call, ready to invoke us over the local transport.
*
* @return an initialized Call object.
*/
public Call getCall() {
Call call = new Call(new Service());
call.setTransport(transport);
return call;
}
/**
* Convenience method to deploy ourselves as a service
*/
public void deploy() {
deploy("service", this.getClass(), Style.RPC);
}
/**
* Deploy a service to the local server we've set up, and point the
* cached local transport object to the desired service name.
*
* After calling this method, the "service" field will contain the
* deployed service, on which you could set other options if
* desired.
*
* @param serviceName the name under which to deploy the service.
* @param target class of the service.
*/
public void deploy(String serviceName, Class target, Style style) {
String className = target.getName();
service = new SOAPService(new RPCProvider());
service.setStyle(style);
service.setOption("className", className);
service.setOption("allowedMethods", "*");
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
}
public void deploy(String serviceName, Class target, Style style, Use use) {
String className = target.getName();
service = new SOAPService(new RPCProvider());
service.setStyle(style);
service.setUse(use);
service.setOption("className", className);
service.setOption("allowedMethods", "*");
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
}
/**
* Deploy a service to the local server we've set up, using a
* Handler we provide as the pivot.
*
* @param serviceName
* @param handler
*/
public void deploy(String serviceName, Handler handler) {
service = new SOAPService(handler);
config.deployService(serviceName, service);
transport.setRemoteService(serviceName);
}
} | 6,557 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/dynamic/ServiceGetPort.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.dynamic;
import junit.framework.TestCase;
import samples.addr.AddressBook;
import samples.addr.AddressBookSOAPBindingStub;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import java.net.URL;
import java.rmi.Remote;
/**
* This class tests Fault deserialization.
*
* @author Sam Ruby (rubys@us.ibm.com)
*/
public class ServiceGetPort extends TestCase {
public ServiceGetPort(String name) {
super(name);
} // ctor
public void testGetGeneratedStub() throws Exception {
Service service = ServiceFactory.newInstance().createService(
new URL("file:../samples/addr-sample/src/main/wsdl/AddressBook.wsdl"),
new QName("urn:AddressFetcher2", "AddressBookService"));
QName portName = new QName("urn:AddressFetcher2", "AddressBook");
Remote stub = service.getPort(portName, AddressBook.class);
assertTrue("Stub should be an instance of AddressBookSOAPBindingStub; instead, it is " + stub.getClass().getName(), stub instanceof AddressBookSOAPBindingStub);
} // testGetGeneratedStub
}
| 6,558 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/dynamic/TestJAXRPCDII.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.dynamic;
import junit.framework.TestCase;
import org.apache.axis.AxisFault;
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import java.io.InterruptedIOException;
import java.net.ConnectException;
import java.net.URL;
public class TestJAXRPCDII extends TestCase {
public TestJAXRPCDII(String name) {
super(name);
} // ctor
public void test1() throws Exception {
try {
String wsdlLocation = "http://www.xmethods.net/sd/2001/TemperatureService.wsdl";
String wsdlNsp = "http://www.xmethods.net/sd/TemperatureService.wsdl";
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(new URL(wsdlLocation),
new QName(wsdlNsp, "TemperatureService"));
Call[] calls = service.getCalls(new QName(wsdlNsp,"TemperaturePort"));
assertTrue(calls != null);
assertEquals(calls[0].getOperationName().getLocalPart(),"getTemp");
((org.apache.axis.client.Call)calls[0]).setTimeout(new Integer(15*1000));
Object ret = calls[0].invoke(new Object[]{"02067"});
System.out.println("Temperature:" + ret);
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
(fault.getFaultString().indexOf("Connection timed out") != -1) ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("getTemp HTTP error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
} catch (java.io.IOException ioe) {
System.err.println("getTemp connect error: " + ioe);
return;
}
}
}
| 6,559 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/dynamic/TestDynamicInvoker.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.dynamic;
import junit.framework.TestCase;
import org.apache.axis.AxisFault;
import samples.client.DynamicInvoker;
import java.io.InterruptedIOException;
import java.net.ConnectException;
public class TestDynamicInvoker extends TestCase {
public TestDynamicInvoker(String name) {
super(name);
} // ctor
public void test1() throws Exception {
try {
String[] args = new String[]{"http://www.xmethods.net/sd/2001/TemperatureService.wsdl", "getTemp", "02067"};
DynamicInvoker.main(args);
} catch (java.net.ConnectException ce) {
System.err.println("getTemp connect error: " + ce);
return;
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
(fault.getFaultString().indexOf("Connection timed out") != -1) ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("getTemp HTTP error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
} catch (java.io.IOException ioe) {
System.err.println("getTemp connect error: " + ioe);
return;
}
}
public void test2() throws Exception {
try {
String[] args = new String[]{"http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl", "getQuote", "IBM"};
DynamicInvoker.main(args);
} catch (java.net.ConnectException ce) {
System.err.println("getQuote connect error: " + ce);
return;
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("getQuote HTTP error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
} catch (java.io.IOException ioe) {
System.err.println("getQuote connect error: " + ioe);
return;
}
}
public void test3() throws Exception {
try {
String[] args = new String[]{"http://mssoapinterop.org/asmx/xsd/round4XSD.wsdl", "echoString(Round4XSDTestSoap)", "Hello World!!!"};
DynamicInvoker.main(args);
} catch (java.net.ConnectException ce) {
System.err.println("round4XSD connect error: " + ce);
return;
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("round4XSD HTTP error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
} catch (java.io.IOException ioe) {
System.err.println("round4XSD connect error: " + ioe);
return;
}
}
public void test4() throws Exception {
try {
String[] args = new String[]{"http://samples.gotdotnet.com/quickstart/aspplus/samples/services/MathService/VB/MathService.asmx?WSDL",
"Add",
"3",
"4"};
DynamicInvoker.main(args);
} catch (java.net.ConnectException ce) {
System.err.println("MathService connect error: " + ce);
return;
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.detail instanceof InterruptedIOException ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("MathService HTTP error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
} catch (java.io.IOException ioe) {
System.err.println("MathService connect error: " + ioe);
return;
}
}
}
| 6,560 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/encoding/TestDeser2000.java | package test.encoding;
import org.apache.axis.Constants;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Test deserialization of SOAP responses
*/
public class TestDeser2000 extends TestDeser {
public TestDeser2000(String name) {
super(name, Constants.URI_2000_SCHEMA_XSI,
Constants.URI_2000_SCHEMA_XSD);
}
public void testMapWithNulls() throws Exception {
HashMap m = new HashMap();
m.put(null, new Boolean("false"));
m.put("hi", null);
deserialize("<result xsi:type=\"xmlsoap:Map\" " +
"xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
"<item>" +
"<key xsi:null=\"true\"/>" +
"<value xsi:type=\"xsd:boolean\">false</value>" +
"</item><item>" +
"<key xsi:type=\"xsd:string\">hi</key>" +
"<value xsi:null=\"true\"/>" +
"</item>" +
"</result>",
m);
}
public void testArrayWithNullInt() throws Exception {
ArrayList list = new ArrayList(4);
list.add(new Integer(1));
list.add(null);
list.add(new Integer(3));
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:int[3]\"> " +
"<item xsi:type=\"xsd:int\">1</item>" +
"<item xsi:null=\"true\"/>" +
"<item xsi:type=\"xsd:int\">3</item>" +
"</result>",
list, true);
}
public void testArrayWithNullString() throws Exception {
ArrayList list = new ArrayList(4);
list.add("abc");
list.add(null);
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[3]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:null=\"true\"/>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testNullSOAPBoolean() throws Exception {
deserialize("<result xsi:type=\"soapenc:boolean\" xsi:null=\"true\" />",
null);
}
}
| 6,561 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/encoding/TestDeser2001.java | package test.encoding;
import org.apache.axis.Constants;
import org.apache.axis.types.Day;
import org.apache.axis.types.Duration;
import org.apache.axis.types.HexBinary;
import org.apache.axis.types.Month;
import org.apache.axis.types.MonthDay;
import org.apache.axis.types.NCName;
import org.apache.axis.types.NMToken;
import org.apache.axis.types.Name;
import org.apache.axis.types.NegativeInteger;
import org.apache.axis.types.NonNegativeInteger;
import org.apache.axis.types.NonPositiveInteger;
import org.apache.axis.types.NormalizedString;
import org.apache.axis.types.PositiveInteger;
import org.apache.axis.types.Time;
import org.apache.axis.types.Token;
import org.apache.axis.types.URI;
import org.apache.axis.types.UnsignedByte;
import org.apache.axis.types.UnsignedInt;
import org.apache.axis.types.UnsignedLong;
import org.apache.axis.types.UnsignedShort;
import org.apache.axis.types.Year;
import org.apache.axis.types.YearMonth;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.TimeZone;
/**
* Test deserialization of SOAP responses
*/
public class TestDeser2001 extends TestDeser {
public TestDeser2001(String name) {
super(name, Constants.URI_2001_SCHEMA_XSI,
Constants.URI_2001_SCHEMA_XSD);
}
/**
* Test deserialization of Date responses
*/
public void testMinDate() throws Exception {
Calendar date = Calendar.getInstance();
date.set(1999, 04, 31, 0, 0, 0);
date.set(Calendar.MILLISECOND,0);
deserialize("<result xsi:type=\"xsd:date\">" +
"1999-05-31" +
"</result>",
date.getTime());
}
/**
* Test deserialization of dateTime (Calendar) responses
*/
public void testMinDateTime() throws Exception {
Calendar date = Calendar.getInstance();
date.set(1999,04,31, 12, 01, 30);
date.setTimeZone(TimeZone.getTimeZone("GMT"));
date.set(Calendar.MILLISECOND,0);
deserialize("<result xsi:type=\"xsd:dateTime\">" +
"1999-05-31T12:01:30Z" +
"</result>",
date);
}
public void testDateTimeZ() throws Exception {
Calendar date = Calendar.getInstance();
date.set(1999,04,31,12,01,30);
date.setTimeZone(TimeZone.getTimeZone("GMT"));
date.set(Calendar.MILLISECOND,150);
deserialize("<result xsi:type=\"xsd:dateTime\">" +
"1999-05-31T12:01:30.150Z" +
"</result>",
date);
}
public void testDateTZ() throws Exception {
Calendar date = Calendar.getInstance();
date.set(1999, 04, 31, 0, 0, 0);
date.set(Calendar.MILLISECOND,0);
deserialize("<result xsi:type=\"xsd:date\">" +
"1999-05-31" +
"</result>",
date.getTime());
}
public void testDateTimeTZ() throws Exception {
Calendar date = Calendar.getInstance();
date.set(1999,04,31,12,01,30);
date.set(Calendar.MILLISECOND,150);
deserialize("<result xsi:type=\"xsd:dateTime\">" +
"1999-05-31T12:01:30.150" + calcGMTOffset(date) +
"</result>",
date);
}
/**
* Test the xsd:Time deserialization
*/
public void testTimeZ() throws Exception {
Calendar date = Calendar.getInstance();
date.set(Calendar.HOUR_OF_DAY, 12);
date.set(Calendar.MINUTE, 01);
date.set(Calendar.SECOND, 30);
date.set(Calendar.MILLISECOND,150);
date.setTimeZone(TimeZone.getTimeZone("GMT"));
Time time = new Time(date);
deserialize("<result xsi:type=\"xsd:time\">" +
"12:01:30.150Z" +
"</result>",
time);
}
/* Commented out for now (not sure how I feel about checking in tests which
break the build without fixes...) --Glen
public void testTimePacific() throws Exception {
deserializeCalendar(TimeZone.getTimeZone("PST8PDT"));
}
*/
/**
* this isnt a test, it is here to list timezones
*/
public void NotestListTimeZones() throws Exception {
String ids[] = TimeZone.getAvailableIDs();
for (int i = 9; i < ids.length; i++) {
System.out.println(ids[i]);
}
}
/**
* test local time costs
* @throws Exception
*/
public void NotestTimeLocal() throws Exception {
deserializeCalendar(TimeZone.getDefault());
}
// /**
// * test that this works in Wintertime
// * @throws Exception
// */
public void testTimeUKWinter() throws Exception {
deserializeCalendar(TimeZone.getTimeZone("GMT+0:00"));
}
public void testTimeUKSummer() throws Exception {
deserializeCalendar(TimeZone.getTimeZone("GMT+1:00"));
}
public void testTimeUK() throws Exception {
deserializeCalendar(TimeZone.getTimeZone("Europe/London"));
}
/**
* this test is here to track down odd behaviour on one system related to these TZ tests
*
*/
public void testTimeZoneLogicWorks() {
TimeZone tz=TimeZone.getTimeZone("GMT");
//assertEquals(0,tz.getDSTSavings());
assertEquals(0,tz.getRawOffset());
Time time=new Time("12:01:30.150+00:00");
String timeVal=time.toString();
assertEquals("12:01:30.150Z",timeVal);
}
private void deserializeCalendar(TimeZone tz) throws Exception {
deserializeCalendar(2004, 1, 1, tz);
deserializeCalendar(2004, 7, 1, tz);
}
private void deserializeCalendar(int year, int month,int day,TimeZone tz) throws Exception {
Calendar date = Calendar.getInstance();
date.set(Calendar.YEAR, year);
date.set(Calendar.MONTH, month);
date.set(Calendar.DAY_OF_MONTH, day);
date.set(Calendar.HOUR_OF_DAY, 12);
date.set(Calendar.MINUTE, 01);
date.set(Calendar.SECOND, 30);
date.set(Calendar.MILLISECOND, 150);
date.setTimeZone(tz);
Time time = new Time(date);
String offset = calcGMTOffset(date);
//diagnostics string
String comment=" [time="+time.toString()+"; tz="+tz.getDisplayName()
+"; offset="+offset+"]";
deserialize("<result xsi:type=\"xsd:time\">" +
"12:01:30.150" + offset +
"</result>",
time,
false,
comment);
}
private static final int MILLISECONDS_IN_MINUTE = 60000;
private static final int MILLISECONDS_IN_HOUR = 60 * MILLISECONDS_IN_MINUTE;
/**
*
* calculate the offset from GMT of the current time zone.
* If the underlying time zone of the calendar contains historical
* summer time information, the offset will be corrected for summertime
* if the date of the calendar is a summertime date
* @param cal
* @return an offset string such as +3:00 or -2:30. GMT is returned as -00:00
*/
private String calcGMTOffset(Calendar cal) {
int msecOffset = cal.get(Calendar.ZONE_OFFSET) +
cal.get(Calendar.DST_OFFSET);
int hourOffset = Math.abs(msecOffset / MILLISECONDS_IN_HOUR);
String offsetString = msecOffset > 0 ? "+" : "-";
offsetString += hourOffset >= 10 ? "" + hourOffset : "0" + hourOffset;
offsetString += ":";
int minOffset = Math.abs(msecOffset % MILLISECONDS_IN_HOUR) / MILLISECONDS_IN_MINUTE;
if (minOffset == 0) {
offsetString += "00";
}
else {
offsetString += minOffset >= 10 ? "" + minOffset : "0" + minOffset;
}
return offsetString;
}
public void testBase64() throws Exception {
deserialize("<result xsi:type=\"xsd:base64Binary\">QmFzZTY0</result>",
"Base64".getBytes());
}
public void testBase64Null() throws Exception {
deserialize("<result xsi:type=\"xsd:base64Binary\"></result>",
new byte[0]);
}
public void testHex() throws Exception {
deserialize("<result xsi:type=\"xsd:hexBinary\">50A9</result>",
new HexBinary("50A9"),true);
}
public void testHexNull() throws Exception {
deserialize("<result xsi:type=\"xsd:hexBinary\"></result>",
new HexBinary(""),true);
}
public void testToken() throws Exception {
deserialize("<result xsi:type=\"xsd:token\">abcdefg</result>",
new Token("abcdefg"),true);
}
public void testNormalizedString() throws Exception {
deserialize("<result xsi:type=\"xsd:normalizedString\">abcdefg</result>",
new NormalizedString("abcdefg"),true);
}
public void testUnsignedLong() throws Exception {
deserialize("<result xsi:type=\"xsd:unsignedLong\">100</result>",
new UnsignedLong(100),true);
}
public void testUnsignedInt() throws Exception {
deserialize("<result xsi:type=\"xsd:unsignedInt\">101</result>",
new UnsignedInt(101),true);
}
public void testUnsignedShort() throws Exception {
deserialize("<result xsi:type=\"xsd:unsignedShort\">102</result>",
new UnsignedShort(102),true);
}
public void testUnsignedByte() throws Exception {
deserialize("<result xsi:type=\"xsd:unsignedByte\">103</result>",
new UnsignedByte(103),true);
}
public void testNonNegativeInteger() throws Exception {
deserialize("<result xsi:type=\"xsd:nonNegativeInteger\">12345678901234567890</result>",
new NonNegativeInteger("12345678901234567890"), true);
}
public void testNonPositiveInteger() throws Exception {
deserialize("<result xsi:type=\"xsd:nonPositiveInteger\">-12345678901234567890</result>",
new NonPositiveInteger("-12345678901234567890"), true);
}
public void testNegativeInteger() throws Exception {
deserialize("<result xsi:type=\"xsd:negativeInteger\">-12345678901234567890</result>",
new NegativeInteger("-12345678901234567890"), true);
}
public void testPositiveInteger() throws Exception {
deserialize("<result xsi:type=\"xsd:positiveInteger\">12345678901234567890</result>",
new PositiveInteger("12345678901234567890"), true);
}
public void testName() throws Exception {
deserialize("<result xsi:type=\"xsd:Name\">:Braves</result>",
new Name(":Braves"),true);
}
public void testNCName() throws Exception {
deserialize("<result xsi:type=\"xsd:NCName\">_Atlanta.Braves</result>",
new NCName("_Atlanta.Braves"),true);
}
public void testNMToken() throws Exception {
deserialize("<result xsi:type=\"xsd:NMTOKEN\">_A.B.C.1-2-3</result>",
new NMToken("_A.B.C.1-2-3"),true);
}
public void testQName() throws Exception {
deserialize("<result xsi:type=\"xsd:QName\" xmlns:qns=\"namespace\">qns:localPart</result>", new QName("namespace", "localPart"), true);
}
public void testMapWithNils() throws Exception {
HashMap m = new HashMap();
m.put(null, new Boolean("false"));
m.put("hi", null);
deserialize("<result xsi:type=\"xmlsoap:Map\" " +
"xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
"<item>" +
"<key xsi:nil=\"true\"/>" +
"<value xsi:type=\"xsd:boolean\">false</value>" +
"</item><item>" +
"<key xsi:type=\"xsd:string\">hi</key>" +
"<value xsi:nil=\"true\"/>" +
"</item>" +
"</result>",
m);
}
public void testArrayWithNilInt() throws Exception {
ArrayList list = new ArrayList(4);
list.add(new Integer(1));
list.add(null);
list.add(new Integer(3));
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:int[3]\"> " +
"<item xsi:type=\"xsd:int\">1</item>" +
"<item xsi:nil=\"true\"/>" +
"<item xsi:type=\"xsd:int\">3</item>" +
"</result>",
list, true);
}
public void testArrayWithNilString() throws Exception {
ArrayList list = new ArrayList(4);
list.add("abc");
list.add(null);
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[3]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:nil=\"true\"/>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testNilSOAPBoolean() throws Exception {
deserialize("<result xsi:type=\"soapenc:boolean\" xsi:nil=\"true\" />",
null);
}
public void testYearMonth() throws Exception {
org.apache.axis.types.YearMonth ym = new YearMonth(2002, 8);
deserialize("<result xsi:type=\"xsd:gYearMonth\">2002-08</result>",
ym);
}
public void testYear() throws Exception {
org.apache.axis.types.Year ym = new Year(2002);
deserialize("<result xsi:type=\"xsd:gYear\">2002</result>",
ym);
}
public void testMonth() throws Exception {
org.apache.axis.types.Month ym = new Month(8);
deserialize("<result xsi:type=\"xsd:gMonth\">--08--</result>",
ym);
}
public void testDay() throws Exception {
org.apache.axis.types.Day ym = new Day(15);
deserialize("<result xsi:type=\"xsd:gDay\">---15</result>",
ym);
}
public void testMonthDay() throws Exception {
org.apache.axis.types.MonthDay ym = new MonthDay(8, 5);
deserialize("<result xsi:type=\"xsd:gMonthDay\">--08-05</result>",
ym);
}
public void testDuration() throws Exception {
org.apache.axis.types.Duration ym = new Duration(false, 2, 3, 8, 8, 1, 3.3);
deserialize("<result xsi:type=\"xsd:duration\">P2Y3M8DT8H1M3.3S</result>",
ym);
org.apache.axis.types.Duration ym2 = new Duration(true, 2, 3, 8, 8, 1, 3.3);
deserialize("<result xsi:type=\"xsd:duration\">-P2Y3M8DT8H1M3.3S</result>",
ym2);
}
public void testAnyURI() throws Exception {
org.apache.axis.types.URI uri = new URI("urn:this-is-a-test");
deserialize("<result xsi:type=\"xsd:anyURI\">urn:this-is-a-test</result>",
uri);
uri = new URI("http", "www.macromedia.com", "/testing", "query=1", null);
deserialize("<result xsi:type=\"xsd:anyURI\">http://www.macromedia.com/testing?query=1</result>",
uri);
}
public static void main() throws Exception {
TestDeser2001 deser=new TestDeser2001("");
deser.testTimeUKWinter();
}
}
| 6,562 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/encoding/TestDeser1999.java | package test.encoding;
import org.apache.axis.Constants;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Test deserialization of SOAP responses
*/
public class TestDeser1999 extends TestDeser {
public TestDeser1999(String name) {
super(name, Constants.URI_1999_SCHEMA_XSI,
Constants.URI_1999_SCHEMA_XSD);
}
public void testMapWithNulls() throws Exception {
HashMap m = new HashMap();
m.put(null, new Boolean("false"));
m.put("hi", null);
// Test map with nulls and
// Test type references to the default namespace.
deserialize("<result xsi:type=\"xmlsoap:Map\" " +
"xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
"<item>" +
"<key xsi:null=\"true\"/>" +
"<value xsi:type=\"boolean\" xmlns=\"" +
Constants.URI_1999_SCHEMA_XSD +
"\">false</value>" +
"</item><item>" +
"<key xsi:type=\"string\" xmlns=\"" +
Constants.URI_1999_SCHEMA_XSD +
"\">hi</key>" +
"<value xsi:null=\"true\"/>" +
"</item>" +
"</result>",
m);
}
public void testArrayWithNullInt() throws Exception {
ArrayList list = new ArrayList(4);
list.add(new Integer(1));
list.add(null);
list.add(new Integer(3));
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:int[3]\"> " +
"<item xsi:type=\"xsd:int\">1</item>" +
"<item xsi:null=\"true\"/>" +
"<item xsi:type=\"xsd:int\">3</item>" +
"</result>",
list, true);
}
public void testArrayWithNullString() throws Exception {
ArrayList list = new ArrayList(4);
list.add("abc");
list.add(null);
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[3]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:null=\"true\"/>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testNullSOAPBoolean() throws Exception {
deserialize("<result xsi:type=\"soapenc:boolean\" xsi:null=\"true\" />",
null);
}
}
| 6,563 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/encoding/TestDeser.java | package test.encoding;
import junit.framework.TestCase;
import org.apache.axis.Constants;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.encoding.TypeMappingRegistry;
import org.apache.axis.message.RPCElement;
import org.apache.axis.message.RPCParam;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.server.AxisServer;
import org.apache.axis.utils.JavaUtils;
import samples.echo.SOAPStruct;
import samples.echo.SOAPStructStruct;
import javax.xml.namespace.QName;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
/**
* Test deserialization of SOAP responses
*/
public class TestDeser extends TestCase {
private String header;
private String footer;
private AxisServer server = new AxisServer();
public TestDeser(String name) {
this(name, Constants.URI_DEFAULT_SCHEMA_XSI,
Constants.URI_DEFAULT_SCHEMA_XSD);
}
public TestDeser(String name, String NS_XSI, String NS_XSD) {
super(name);
header =
"<?xml version=\"1.0\"?>\n" +
"<soap:Envelope " +
"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
"xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" " +
"xmlns:me=\"http://soapinterop.org/xsd\" " +
"xmlns:this=\"http://encoding.test\" " +
"xmlns:xsi=\"" + NS_XSI + "\" " +
"xmlns:xsd=\"" + NS_XSD + "\">\n" +
"<soap:Body>\n" +
"<methodResult xmlns=\"http://tempuri.org/\">\n";
footer =
"</methodResult>\n" +
"</soap:Body>\n" +
"</soap:Envelope>\n";
TypeMappingRegistry tmr = server.getTypeMappingRegistry();
TypeMapping tm = (TypeMapping) tmr.createTypeMapping();
tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
tm.register(java.lang.String[].class,
new QName("http://soapinterop.org/xsd", "ArrayOfString"),
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
tm.register(java.lang.Object[].class,
new QName("http://soapinterop.org/xsd", "ArrayOfObject"),
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
tm.register(samples.echo.SOAPStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStruct"),
new org.apache.axis.encoding.ser.BeanSerializerFactory(
samples.echo.SOAPStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStruct")),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(
samples.echo.SOAPStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStruct")));
tm.register(samples.echo.SOAPStruct[].class,
new QName("http://soapinterop.org/xsd", "ArrayOfSOAPStruct"),
new org.apache.axis.encoding.ser.ArraySerializerFactory(),
new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
tm.register(samples.echo.SOAPStructStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStructStruct"),
new org.apache.axis.encoding.ser.BeanSerializerFactory(
samples.echo.SOAPStructStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStructStruct")),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(
samples.echo.SOAPStructStruct.class,
new QName("http://soapinterop.org/xsd", "SOAPStructStruct")));
tm.register(test.encoding.IndexPropBean.class,
new QName("http://encoding.test", "IndexPropBean"),
new org.apache.axis.encoding.ser.BeanSerializerFactory(
test.encoding.IndexPropBean.class,
new QName("http://encoding.test", "IndexPropBean")),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(
test.encoding.IndexPropBean.class,
new QName("http://encoding.test", "IndexPropBean")));
}
/**
* Verify that two objects have the same value, handling arrays...
*/
private static boolean equals(Object obj1, Object obj2) {
if ( (obj1 == null) || (obj2 == null) ) return (obj1 == obj2);
if (obj1.equals(obj2)) return true;
if (obj2.getClass().isArray() && obj1.getClass().isArray()) {
if (Array.getLength(obj1) != Array.getLength(obj2)) return false;
for (int i=0; i<Array.getLength(obj1); i++)
if (!equals(Array.get(obj1,i),Array.get(obj2,i))) return false;
return true;
}
if ((obj1 instanceof List) && (obj2 instanceof List)) {
List list1 = (List)obj1;
List list2 = (List)obj2;
if (list1.size() != list2.size()) return false;
for (int i=0; i < list1.size(); i++) {
if (!equals(list1.get(i), list2.get(i))) return false;
}
return true;
}
if ((obj1 instanceof Map) && (obj2 instanceof Map)) {
Map map1 = (Map)obj1;
Map map2 = (Map)obj2;
Set keys1 = map1.keySet();
Set keys2 = map2.keySet();
if (!(keys1.equals(keys2))) return false;
Iterator i = keys1.iterator();
while (i.hasNext()) {
Object key = i.next();
if (!map1.get(key).equals(map2.get(key)))
return false;
}
return true;
}
return false;
}
/**
* Verify that a given XML deserialized produces the expected result
*/
protected void deserialize(String data, Object expected)
throws Exception {
deserialize(data, expected, false);
}
protected void deserialize(String data, Object expected, boolean tryConvert)
throws Exception {
deserialize(data, expected,tryConvert,"");
}
/**
* Verify that a given XML deserialized produces the expected result
* @param data
* @param expected
* @param tryConvert
* @param comment extra text to add
* @throws Exception
*/
protected void deserialize(String data, Object expected, boolean tryConvert, String comment)
throws Exception
{
Message message = new Message(header + data + footer);
message.setMessageContext(new MessageContext(server));
String postfix="";
if(comment!=null) {
postfix=" "+comment;
}
SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope();
assertNotNull("SOAP envelope should not be null"+ postfix, envelope);
RPCElement body = (RPCElement)envelope.getFirstBody();
assertNotNull("SOAP body should not be null" + postfix, body);
Vector arglist = body.getParams();
assertNotNull("arglist", arglist);
assertTrue("param.size()<=0 {Should be > 0}" + postfix, arglist.size()>0);
RPCParam param = (RPCParam) arglist.get(0);
assertNotNull("SOAP param should not be null" + postfix, param);
Object result = param.getObjectValue();
if (!equals(result, expected)) {
String errorText = "Failed to decode " + data + postfix+" : ";
// Try to convert to the expected class
if (tryConvert) {
Object result2 = JavaUtils.convert(result, expected.getClass());
if (!equals(result2, expected)) {
assertEquals(errorText, expected, result);
}
} else {
assertEquals(errorText, expected, result);
}
}
}
public void testString() throws Exception {
deserialize("<result xsi:type=\"xsd:string\">abc</result>",
"abc");
}
public void testBoolean() throws Exception {
deserialize("<result xsi:type=\"xsd:boolean\">false</result>",
new Boolean(false));
deserialize("<result xsi:type=\"xsd:boolean\">true</result>",
new Boolean(true));
deserialize("<result xsi:type=\"xsd:boolean\">0</result>",
new Boolean(false));
deserialize("<result xsi:type=\"xsd:boolean\">1</result>",
new Boolean(true));
}
public void testDouble() throws Exception {
deserialize("<result xsi:type=\"xsd:double\">3.14</result>",
new Double(3.14));
}
public void testDoubleNaN() throws Exception {
deserialize("<result xsi:type=\"xsd:double\">NaN</result>",
new Double(Double.NaN));
}
public void testDoubleINF() throws Exception {
deserialize("<result xsi:type=\"xsd:double\">INF</result>",
new Double(Double.POSITIVE_INFINITY));
}
public void testDoubleNINF() throws Exception {
deserialize("<result xsi:type=\"xsd:double\">-INF</result>",
new Double(Double.NEGATIVE_INFINITY));
}
public void testFloat() throws Exception {
deserialize("<result xsi:type=\"xsd:float\">3.14</result>",
new Float(3.14F));
}
public void testFloatNaN() throws Exception {
deserialize("<result xsi:type=\"xsd:float\">NaN</result>",
new Float(Float.NaN));
}
public void testFloatINF() throws Exception {
deserialize("<result xsi:type=\"xsd:float\">INF</result>",
new Float(Float.POSITIVE_INFINITY));
}
public void testFloatNINF() throws Exception {
deserialize("<result xsi:type=\"xsd:float\">-INF</result>",
new Float(Float.NEGATIVE_INFINITY));
}
public void testInt() throws Exception {
deserialize("<result xsi:type=\"xsd:int\">10</result>",
new Integer(10));
}
public void testLong() throws Exception {
deserialize("<result xsi:type=\"xsd:long\">17</result>",
new Long(17));
}
public void testShort() throws Exception {
deserialize("<result xsi:type=\"xsd:short\">3</result>",
new Short((short)3));
}
public void testQName() throws Exception {
String ns = "http://test";
String local = "bar";
deserialize("<result xmlns:foo=\"" + ns + "\" xsi:type=\"xsd:QName\">foo:" + local + "</result>",
new QName(ns, local));
deserialize("<result xmlns:foo=\"" + ns + "\" xsi:type=\"xsd:QName\">\n foo:" + local + " \r\n </result>",
new QName(ns, local));
}
public void testArray() throws Exception {
Vector v = new Vector();
v.addElement("abc");
v.addElement("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[2]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
v, true);
}
public void testSparseArray1() throws Exception {
ArrayList list = new ArrayList(4);
list.add(null);
list.add(null);
list.add("abc");
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[4]\" " +
"soapenc:offset=\"[2]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testSparseArray2() throws Exception {
ArrayList list = new ArrayList(4);
list.add("abc");
list.add(null);
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[4]\"> " +
"<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" +
"<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testHugeSparseArray() throws Exception {
ArrayList list = new ArrayList(4);
list.add("abc");
list.add(null);
list.add("def");
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[50000000]\"> " +
"<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" +
"<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" +
"</result>",
list, true);
}
public void testMap() throws Exception {
HashMap m = new HashMap();
m.put("abcKey", "abcVal");
m.put("defKey", "defVal");
deserialize("<result xsi:type=\"xmlsoap:Map\" " +
"xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
"<item>" +
"<key xsi:type=\"xsd:string\">abcKey</key>" +
"<value xsi:type=\"xsd:string\">abcVal</value>" +
"</item><item>" +
"<key xsi:type=\"xsd:string\">defKey</key>" +
"<value xsi:type=\"xsd:string\">defVal</value>" +
"</item>" +
"</result>",
m);
}
public void testHashtable() throws Exception {
Hashtable ht = new Hashtable();
ht.put("abcKey", "abcVal");
ht.put("defKey", "defVal");
deserialize("<result xsi:type=\"xmlsoap:Map\" " +
"xmlns:xmlsoap=\"http://xml.apache.org/xml-soap\"> " +
"<item>" +
"<key xsi:type=\"xsd:string\">abcKey</key>" +
"<value xsi:type=\"xsd:string\">abcVal</value>" +
"</item><item>" +
"<key xsi:type=\"xsd:string\">defKey</key>" +
"<value xsi:type=\"xsd:string\">defVal</value>" +
"</item>" +
"</result>",
ht, true);
}
public void testUntyped() throws Exception {
deserialize("<result>10</result>", "10");
}
public void testSOAPString() throws Exception {
deserialize("<result xsi:type=\"soapenc:string\">abc</result>",
"abc");
}
// Complicated array tests
// type=soapenc:Array
public void testArrayA() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[2]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
s, true);
}
// Like above but missing [2] dimension
public void testArrayB() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
s, true);
}
// Like above but no xsi:type on elements
public void testArrayC() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:string[]\"> " +
"<item>abc</item>" +
"<item>def</item>" +
"</result>",
s, true);
}
// Now try with arrayType=xsd:anyType
public void testArrayD() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"soapenc:arrayType=\"xsd:anyType[]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
s, true);
}
// Now try without arrayType
public void testArrayE() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
s, true);
}
// Use a specific array type, not soapenc:Array
public void testArrayF() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"me:ArrayOfString\" " +
"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"xsd:string\">def</item>" +
"</result>",
s, true);
}
// Same as above without individual item types
public void testArrayG() throws Exception {
String[] s = new String[] {"abc", "def"};
deserialize("<result xsi:type=\"me:ArrayOfString\" " +
"> " +
"<item>abc</item>" +
"<item>def</item>" +
"</result>",
s, true);
}
// Same as above except result is an Object[]
public void testArrayH() throws Exception {
Object[] s = new Object[] {new String("abc"), new String("def")};
deserialize("<result xsi:type=\"me:ArrayOfString\" " +
"> " +
"<item>abc</item>" +
"<item>def</item>" +
"</result>",
s, true);
}
// Ooh La La
// Array of Object containing a String and an Integer
public void testArrayI() throws Exception {
Object[] s = new Object[] {new String("abc"), new Integer(123)};
deserialize("<result xsi:type=\"me:ArrayOfObject\" " +
"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"soapenc:int\">123</item>" +
"</result>",
s, true);
}
// Same as above using arrayType=xsd:anyType
public void testArrayJ() throws Exception {
Object[] s = new Object[] {new String("abc"), new Integer(123)};
deserialize("<result xsi:type=\"me:ArrayOfObject\" " +
"soapenc:arrayType=\"xsd:anyType[]\"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"soapenc:int\">123</item>" +
"</result>",
s, true);
}
// Same as above using type=soapenc:Array and no arrayType...bare bones
public void testArrayK() throws Exception {
Object[] s = new Object[] {new String("abc"), new Integer(123)};
deserialize("<result xsi:type=\"soapenc:Array\" " +
"> " +
"<item xsi:type=\"xsd:string\">abc</item>" +
"<item xsi:type=\"soapenc:int\">123</item>" +
"</result>",
s, true);
}
// This was created from a return received from a .NET service
public void testArrayL() throws Exception {
SOAPStruct[] s = new SOAPStruct[] {
new SOAPStruct(),
new SOAPStruct(),
new SOAPStruct()};
s[0].setVarInt(1);
s[0].setVarString("one");
s[0].setVarFloat(1.1F);
s[1].setVarInt(2);
s[1].setVarString("two");
s[1].setVarFloat(2.2F);
s[2].setVarInt(3);
s[2].setVarString("three");
s[2].setVarFloat(3.3F);
deserialize("<soapenc:Array id=\"ref-7\" soapenc:arrayType=\"me:SOAPStruct[3]\">" +
"<item href=\"#ref-8\"/>" +
"<item href=\"#ref-9\"/>" +
"<item href=\"#ref-10\"/>" +
"</soapenc:Array>" +
"<me:SOAPStruct id=\"ref-8\">" +
"<varString xsi:type=\"xsd:string\">one</varString>" +
"<varInt xsi:type=\"xsd:int\">1</varInt>" +
"<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" +
"</me:SOAPStruct>" +
"<me:SOAPStruct id=\"ref-9\">" +
"<varString xsi:type=\"xsd:string\">two</varString>" +
"<varInt xsi:type=\"xsd:int\">2</varInt>" +
"<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" +
"</me:SOAPStruct>" +
"<me:SOAPStruct id=\"ref-10\">" +
"<varString xsi:type=\"xsd:string\">three</varString>" +
"<varInt xsi:type=\"xsd:int\">3</varInt>" +
"<varFloat xsi:type=\"xsd:float\">3.3</varFloat>" +
"</me:SOAPStruct>",
s, true);
}
// Like above without multiref
public void testArrayM() throws Exception {
SOAPStruct[] s = new SOAPStruct[] {
new SOAPStruct(),
new SOAPStruct(),
new SOAPStruct()};
s[0].setVarInt(1);
s[0].setVarString("one");
s[0].setVarFloat(1.1F);
s[1].setVarInt(2);
s[1].setVarString("two");
s[1].setVarFloat(2.2F);
s[2].setVarInt(3);
s[2].setVarString("three");
s[2].setVarFloat(3.3F);
deserialize("<soapenc:Array id=\"ref-7\" soapenc:arrayType=\"me:SOAPStruct[3]\">" +
"<me:SOAPStruct>" +
"<varString xsi:type=\"xsd:string\">one</varString>" +
"<varInt xsi:type=\"xsd:int\">1</varInt>" +
"<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" +
"</me:SOAPStruct>" +
"<me:SOAPStruct>" +
"<varString xsi:type=\"xsd:string\">two</varString>" +
"<varInt xsi:type=\"xsd:int\">2</varInt>" +
"<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" +
"</me:SOAPStruct>" +
"<me:SOAPStruct>" +
"<varString xsi:type=\"xsd:string\">three</varString>" +
"<varInt xsi:type=\"xsd:int\">3</varInt>" +
"<varFloat xsi:type=\"xsd:float\">3.3</varFloat>" +
"</me:SOAPStruct>" +
"</soapenc:Array>",
s, true);
}
// Deserialize Bean with discreet names
public void testBeanWithIndexedPropA() throws Exception {
IndexPropBean s = new IndexPropBean();
s.setName(new String[] {"hello", "goodbye"});
deserialize("<result xsi:type=\"this:IndexPropBean\" " + "> " +
"<name href=\"#ref-1\"/>" +
"<name href=\"#ref-2\"/>" +
"</result>" +
"<item id=\"ref-1\" xsi:type=\"xsd:string\">hello</item>" +
"<item id=\"ref-2\" xsi:type=\"xsd:string\">goodbye</item>",
s, true);
}
// Deserialize Bean with names in an array
public void testBeanWithIndexedPropB() throws Exception {
IndexPropBean s = new IndexPropBean();
s.setName(new String[] {"hello", "goodbye"});
deserialize("<result xsi:type=\"this:IndexPropBean\" " + "> " +
"<name href=\"#ref-0\" /> " +
"</result>" +
"<soapenc:Array id=\"ref-0\" soapenc:arrayType=\"xsd:string[2]\"> " +
"<item xsi:type=\"xsd:string\">hello</item>" +
"<item xsi:type=\"xsd:string\">goodbye</item>" +
"</soapenc:Array>",
s, true);
}
// Struct within Struct
public void testStructStruct() throws Exception {
SOAPStruct s = new samples.echo.SOAPStruct();
s.setVarInt(1);
s.setVarString("one");
s.setVarFloat(1.1F);
SOAPStructStruct ss = new SOAPStructStruct();
ss.setVarString("hello");
ss.setVarInt(2);
ss.setVarFloat(2.2F);
ss.setVarStruct(s);
deserialize("<whatever xsi:type=\"me:SOAPStructStruct\">" +
"<varString xsi:type=\"xsd:string\">hello</varString>" +
"<varInt xsi:type=\"xsd:int\">2</varInt>" +
"<varFloat xsi:type=\"xsd:float\">2.2</varFloat>" +
"<varStruct xsi:type=\"me:SOAPStruct\">" +
"<varString xsi:type=\"xsd:string\">one</varString>" +
"<varInt xsi:type=\"xsd:int\">1</varInt>" +
"<varFloat xsi:type=\"xsd:float\">1.1</varFloat>" +
"</varStruct>" +
"</whatever>" , ss, true);
}
/*
public void testBug18390() throws Exception {
String[] s = new String[] {"GW671055X"};
deserialize("<molNames soapenc:arrayType=\"xsd:string[1]\"> " +
"<xsd:string xsi:type=\"xsd:string\">GW671055X</xsd:string>" +
"</molNames>",
s, true);
}
public void testBug25536() throws Exception {
int[] array = new int[]{3,4};
deserialize("<myFavoriteNumbers soapenc:arrayType=\"xsd:int[2]\">\n" +
" <number>3</number> \n" +
" <number>4</number> \n" +
"</myFavoriteNumbers>",array,true);
}
*/
// Struct within Struct
public void testStructStruct2() throws Exception {
SOAPStruct s = new samples.echo.SOAPStruct();
s.setVarInt(1);
s.setVarString("one");
s.setVarFloat(1.1F);
SOAPStructStruct ss = new SOAPStructStruct();
ss.setVarString("hello");
ss.setVarInt(2);
ss.setVarFloat(2.2F);
ss.setVarStruct(s);
deserialize("<whatever xsi:type=\"me:SOAPStructStruct\">" +
"<varString>hello</varString>" +
"<varInt>2</varInt>" +
"<varFloat>2.2</varFloat>" +
"<varStruct>" +
"<varString>one</varString>" +
"<varInt>1</varInt>" +
"<varFloat>1.1</varFloat>" +
"</varStruct>" +
"</whatever>" , ss, true);
}
}
| 6,564 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test | Create_ds/axis-axis1-java/integration/src/test/java/test/encoding/IndexPropBean.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.encoding;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.FieldDesc;
import org.apache.axis.description.TypeDesc;
import javax.xml.namespace.QName;
/**
* Bean with an indexed property
*/
public class IndexPropBean {
private java.lang.String[] name;
public IndexPropBean() {}
public java.lang.String getName(int i) {
return name[i];
}
public void setName(int i, java.lang.String name){
this.name[i] = name;
}
public java.lang.String[] getName() {
return name;
}
public void setName(java.lang.String name[]){
this.name = name;
}
public boolean equals(Object obj)
{
if (obj == null || !(obj instanceof IndexPropBean))
return false;
IndexPropBean other = (IndexPropBean)obj;
if (other.name == null && this.name == null)
return true;
if (other.name != null &&
java.util.Arrays.equals(other.name, name))
return true;
return false;
}
public int hashCode() {
int _hashCode = 0;
if (name != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(name);
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(name, i);
if (obj != null) {
_hashCode += obj.hashCode();
}
}
}
return _hashCode;
}
// Type metadata
private static TypeDesc typeDesc;
static {
typeDesc = new TypeDesc(IndexPropBean.class);
FieldDesc field;
field = new ElementDesc();
field.setFieldName("name");
field.setXmlName(new QName("", "name"));
typeDesc.addFieldDesc(field);
}
public static TypeDesc getTypeDesc()
{
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| 6,565 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/attrGroup/AttrGroupServiceTestCase.java | /**
* AttrGroupServiceTestCase.java
*/
package test.wsdl.attrGroup;
public class AttrGroupServiceTestCase extends junit.framework.TestCase {
public AttrGroupServiceTestCase(java.lang.String name) {
super(name);
}
public void test1AttrGroupService() throws Exception {
// make sure WSDL2Java generated the right stuff
// we don't really need to test sending a request
// and getting a response, since many other tests comprehend that
// all we need to do is make sure WSDL2Java generated
// the attributes needed from the attributeGroup definitions
// so, basically, if this compiles, we are good to go
// but running it won't hurt anything
test.wsdl.attrGroup.Record1 rec1 = new test.wsdl.attrGroup.Record1();
// an element defined within Record1
rec1.setElem1(1);
assertTrue("elem1 should be 1, but is "+rec1.getElem1(), rec1.getElem1()==1);
// an attribute defined in an attributeGroup
rec1.setAttr1(2);
assertTrue("attr1 should be 2, but is "+rec1.getAttr1(), rec1.getAttr1()==2);
// an attribute defined in Record1 itself
rec1.setAttr3("x");
assertTrue("attr3 should be x, but is "+rec1.getAttr3(), rec1.getAttr3().equals("x"));
// two attributes from a known 1.1 soap encoding schema
rec1.setId(new org.apache.axis.types.Id("theId"));
rec1.setHref(new org.apache.axis.types.URI("a", "b"));
test.wsdl.attrGroup.Record2 rec2 = new test.wsdl.attrGroup.Record2();
// an element defined within Record2
rec2.setElem2("2");
// an attribute defined in a referenced attributeGroup within an attributeGroup
rec2.setAttr1(2);
// an attribute defined in an attributeGroup that has another nested reference
rec2.setAttr2(1.2);
// an attribute from a known 1.2 soap encoding schema
rec2.setId(new org.apache.axis.types.Id("theId"));
}
/*
public static void main(String[] args)
{
AttrGroupServiceTestCase test = new AttrGroupServiceTestCase("x");
try {
test.test1AttrGroupService();
}
catch (Exception e)
{
e.printStackTrace();
}
}
*/
}
| 6,566 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qualify/Qualify_BindingImpl.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Qualify_BindingImpl.java
*
* Service implementation for Qualified/Nonqualified elements in a complex
* type. The service validates the request XML and the test client validates
* the response XML to verify the elements that should be namesapce qualified
* are, and those that are not supposed to be aren't.
*/
package test.wsdl.qualify;
import org.apache.axis.AxisFault;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPEnvelope;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class Qualify_BindingImpl implements test.wsdl.qualify.Qualify_PortType {
public static final String namespace = "urn:qualifyTest";
public java.lang.String simple(java.lang.String name) throws java.rmi.RemoteException {
// Validate XML request to make sure elements are properly qualified
// or not per the WSDL
MessageContext mc = MessageContext.getCurrentContext();
Message request = mc.getRequestMessage();
SOAPEnvelope env = request.getSOAPEnvelope();
String requestString = request.getSOAPPartAsString();
Element body;
try {
body = env.getFirstBody().getAsDOM();
} catch (Exception e) {
throw new AxisFault("Unable to get request body as DOM Element on server");
}
// debug
//System.err.println("Request:\n---------\n" + requestString + "\n------");
/*
* Here is what we expect the Body to look like:
* <Simple xmlns="urn:qualifyTest">
* <name>Tommy</name>
* </Simple>
*/
// Now we have a DOM Element, verfy namespace attributes
String simpleNS = body.getNamespaceURI();
if (!simpleNS.equals(namespace) ) {
throw new AxisFault("Namespace of Simple element incorrect: " +
simpleNS + " should be: " + namespace);
}
NodeList list = body.getChildNodes();
for(int i=0;i<list.getLength();i++) {
Node node = list.item(i);
if(node.getNodeType() == Node.TEXT_NODE)
continue;
String nameNS = node.getNamespaceURI();
if (!nameNS.equals("urn:qualifyTest")) {
throw new AxisFault("Namespace of name element incorrect: " +
nameNS + " should be: urn:qualifyTest");
}
}
// Return a response (which the client will validate)
return "Hello there: " + name;
}
public test.wsdl.qualify.FormOverrideResponseResponse formOverride(test.wsdl.qualify.FormOverrideComplex complex) throws java.rmi.RemoteException {
// Validate XML request to make sure elements are properly qualified
// or not per the WSDL
MessageContext mc = MessageContext.getCurrentContext();
Message request = mc.getRequestMessage();
SOAPEnvelope env = request.getSOAPEnvelope();
String requestString = request.getSOAPPartAsString();
Element body;
try {
body = env.getFirstBody().getAsDOM();
} catch (Exception e) {
throw new AxisFault("Unable to get request body as DOM Element on server");
}
// debug
//System.err.println("Request:\n---------\n" + requestString + "\n------");
/*
* Here is what we expect the Body to look like:
* <FormOverride xmlns="urn:qualifyTest">
* <complex xmlns="">
* <ns1:name xmlns:ns1="urn:qualifyTest">Timmah</ns1:name>
* </complex>
* </FormOverride>
*/
// Now we have a DOM Element, verfy namespace attributes
String FormOverrideNS = body.getNamespaceURI();
if (!FormOverrideNS.equals(namespace) ) {
throw new AxisFault("Namespace of FormOverrideNS element incorrect: " +
FormOverrideNS + " should be: " + namespace);
}
Node complexNode = body.getFirstChild();
String complexNS = complexNode.getNamespaceURI();
if (complexNS != null ) {
throw new AxisFault("Namespace of <complex> element incorrect: " +
complexNS + " should be: NULL");
}
// FIXME: for some reason I can't get at the <name> node which is
// under the <complex> node. Are we not converting the request to
// DOM correctly?
if (complexNode.hasChildNodes()) {
Node nameNode = complexNode.getFirstChild();
String nameNS = nameNode.getNamespaceURI();
if (!nameNS.equals(namespace)) {
throw new AxisFault("Namespace of <name> element incorrect: " +
nameNS + " should be: " + namespace);
}
}
// Return a response (which the client will validate)
test.wsdl.qualify.FormOverrideResponseResponse r = new FormOverrideResponseResponse();
r.setName("Tommy");
return r;
}
}
| 6,567 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qualify/Qualify_ServiceTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Qualify_ServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.qualify;
import junit.framework.AssertionFailedError;
import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPEnvelope;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import test.HttpTestUtil;
import javax.xml.rpc.ServiceException;
public class Qualify_ServiceTestCase extends junit.framework.TestCase {
public static final String namespace = "urn:qualifyTest";
public Qualify_ServiceTestCase(String name) {
super(name);
}
public void test1QualifySimple() throws Exception {
Qualify_ServiceLocator locator = new Qualify_ServiceLocator();
Qualify_BindingStub binding;
try {
binding = (Qualify_BindingStub)locator.getQualify(HttpTestUtil.getTestEndpoint(locator.getQualifyAddress()));
} catch (javax.xml.rpc.ServiceException jre) {
throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
String value = null;
String name = "Tommy";
value = binding.simple(name);
// Validate XML reponse to make sure elements are properly qualified
// or not per the WSDL
MessageContext mc = null;
mc = binding._getCall().getMessageContext();
Message response = mc.getResponseMessage();
SOAPEnvelope env = response.getSOAPEnvelope();
String responseString = response.getSOAPPartAsString();
Element body;
try {
body = env.getFirstBody().getAsDOM();
} catch (Exception e) {
throw new AssertionFailedError("Unable to get request body as DOM Element on server");
}
// debug
//System.err.println("Response:\n---------\n" + responseString + "\n------");
/*
* Here is what we expect the Body to look like:
* <SimpleResponse xmlns="urn:qualifyTest">
* <SimpleResult>Hello there: Tommy</SimpleResult>
* </SimpleResponse>
*/
// Now we have a DOM Element, verfy namespace attributes
String simpleNS = body.getNamespaceURI();
assertEquals("Namespace of Simple element incorrect", simpleNS, namespace);
Node nameNode = body.getFirstChild();
String nameNS = nameNode.getNamespaceURI();
assertEquals("Namespace of <name> element incorrect",
nameNS, namespace);
// Check the response
assertEquals(value, "Hello there: " + name);
} catch (java.rmi.RemoteException re) {
throw new AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test2QualifyFormOverride() throws Exception {
Qualify_ServiceLocator locator = new Qualify_ServiceLocator();
test.wsdl.qualify.Qualify_BindingStub binding;
try {
binding = (test.wsdl.qualify.Qualify_BindingStub)locator.getQualify(HttpTestUtil.getTestEndpoint(locator.getQualifyAddress()));
} catch (javax.xml.rpc.ServiceException jre) {
throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
FormOverrideResponseResponse value = null;
FormOverrideComplex arg = new FormOverrideComplex();
arg.setName("Timmah");
value = binding.formOverride(arg);
// Get the XML response
// Validate XML reponse to make sure elements are properly qualified
// or not per the WSDL
MessageContext mc = null;
mc = binding._getCall().getMessageContext();
Message response = mc.getResponseMessage();
SOAPEnvelope env = response.getSOAPEnvelope();
String responseString = response.getSOAPPartAsString();
Element body;
try {
body = env.getFirstBody().getAsDOM();
} catch (Exception e) {
throw new AssertionFailedError("Unable to get request body as DOM Element on server");
}
// debug
//System.err.println("Response:\n---------\n" + responseString + "\n------");
/*
* Here is what we expect the Body to look like:
* <FormOverrideResponse xmlns="urn:qualifyTest">
* <response xmlns="">
* <ns1:name xmlns:ns1="urn:qualifyTest">Tommy</ns1:name>
* </response>
* </FormOverrideResponse>
*/
// Now we have a DOM Element, verfy namespace attributes
String FormOverrideNS = body.getNamespaceURI();
assertEquals("Namespace of <FormOverrideResponse> element incorrect",
FormOverrideNS, namespace);
Node complexNode = body.getFirstChild();
String complexNS = complexNode.getNamespaceURI();
assertNull("Namespace of <complex> element incorrect", complexNS);
// FIXME: for some reason I can't get at the <name> node which is
// under the <complex> node. Are we not converting the request to
// DOM correctly?
if (complexNode.hasChildNodes()) {
Node nameNode = complexNode.getFirstChild();
String nameNS = nameNode.getNamespaceURI();
assertEquals("Namespace of <name> element incorrect",
nameNS, namespace);
}
// Check the response
assertEquals(value.getName(), "Tommy");
} catch (java.rmi.RemoteException re) {
throw new AssertionFailedError("Remote Exception caught: " + re);
}
}
}
| 6,568 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/primitiveWrappers/TypeWrapper_BindingImpl.java | /**
* TypeWrapper_BindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis #axisVersion# #today# WSDL2Java emitter.
*/
package test.wsdl.primitiveWrappers;
public class TypeWrapper_BindingImpl implements test.wsdl.primitiveWrappers.TypeWrapper_PortType {
public java.lang.Integer testWrapping(java.lang.Integer testWrappingInputInteger, test.wsdl.primitiveWrappers.Bean testWrappingInputBean) throws java.rmi.RemoteException {
return testWrappingInputInteger;
}
}
| 6,569 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/primitiveWrappers/TypeWrapper_ServiceTestCase.java | /**
* TypeWrapper_ServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis #axisVersion# #today# WSDL2Java emitter.
*/
package test.wsdl.primitiveWrappers;
import test.HttpTestUtil;
public class TypeWrapper_ServiceTestCase extends junit.framework.TestCase {
public TypeWrapper_ServiceTestCase(java.lang.String name) {
super(name);
}
public void testTypeWrapperWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.primitiveWrappers.TypeWrapper_ServiceLocator().getTypeWrapperAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.primitiveWrappers.TypeWrapper_ServiceLocator().getServiceName());
assertTrue(service != null);
}
public void test1TypeWrapperTestWrapping() throws Exception {
test.wsdl.primitiveWrappers.TypeWrapper_BindingStub binding;
try {
TypeWrapper_ServiceLocator loc = new TypeWrapper_ServiceLocator();
binding = (TypeWrapper_BindingStub)loc.getTypeWrapper(HttpTestUtil.getTestEndpoint(loc.getTypeWrapperAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Integer value = null;
Bean bean = new test.wsdl.primitiveWrappers.Bean();
bean.setPrimitive(5);
bean.setWrapped(null); // Since this is null it won't appear on the
// wire. We should check that at some point!
value = binding.testWrapping(new java.lang.Integer(5), bean);
assertEquals("Wrong result from service", value, new Integer(5));
}
}
| 6,570 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/stubheaders/StubHeaderServiceTestCase.java | /**
* StubHeaderServiceTestCase.java
*
* Test case. Add a SOAP header using the Stub APIs and make sure the
* service returns a SOAP header that we can read.
*/
package test.wsdl.stubheaders;
import org.apache.axis.message.SOAPHeaderElement;
import test.HttpTestUtil;
public class StubHeaderServiceTestCase extends junit.framework.TestCase {
public StubHeaderServiceTestCase(java.lang.String name) {
super(name);
}
public void testStubHeaderServiceWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.stubheaders.StubHeaderServiceLocator().getStubHeaderServiceAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.stubheaders.StubHeaderServiceLocator().getServiceName());
assertTrue(service != null);
}
public void test1StubHeaderServiceEcho() throws Exception {
StubHeaderStub binding;
try {
StubHeaderServiceLocator loc = new StubHeaderServiceLocator();
binding = (StubHeaderStub)loc.getStubHeaderService(HttpTestUtil.getTestEndpoint(loc.getStubHeaderServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Set header value via the Stub API
binding.setHeader("http://test.org/inputheader", "headerin", "inputvalue");
// Test operation
java.lang.String value = null;
value = binding.echo(new java.lang.String());
// validate input header was echoed back
assertEquals("Request header did not reach service", "inputvalue", value);
// Check that getting the list of response headers works
SOAPHeaderElement[] hdrs = binding.getResponseHeaders();
assertEquals("List of response headers has the wrong number", 1, hdrs.length );
// Get response header using ONLY the Stub API
SOAPHeaderElement hdr = binding.getResponseHeader("http://test.org/outputheader", "headerout");
assertNotNull("Cant find header 'headerout' in response", hdr);
assertNotNull("Header object value is NULL", hdr.getObjectValue());
assertEquals("Response header did not arrive as expected", "outputvalue", hdr.getObjectValue());
// Everything is OK
}
}
| 6,571 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/stubheaders/StubHeaderImpl.java | /**
* StubHeaderImpl.java
*
* Test implimentation.
* Make sure the service sees a SOAP header added by the Sub API.
* Set a different header in the response to the test can verify it.
*/
package test.wsdl.stubheaders;
import org.apache.axis.MessageContext;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.SOAPHeaderElement;
public class StubHeaderImpl implements test.wsdl.stubheaders.StubHeaderInterface {
public java.lang.String echo(java.lang.String in) throws java.rmi.RemoteException {
String ret = null;
MessageContext mc = MessageContext.getCurrentContext();
// Verify the existence of in the input header
SOAPEnvelope env = mc.getRequestMessage().getSOAPEnvelope();
SOAPHeaderElement header = env.getHeaderByName("http://test.org/inputheader", "headerin");
if (header != null)
{
ret = header.getObjectValue().toString();
}
// add a different output header to the response
env = mc.getResponseMessage().getSOAPEnvelope();
SOAPHeaderElement hdr =
new SOAPHeaderElement("http://test.org/outputheader", "headerout", "outputvalue");
env.addHeader(hdr);
// just return the input header, so test can validate it
return ret;
}
}
| 6,572 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpcdynproxy/AddressSoapBindingImpl.java | package test.wsdl.jaxrpcdynproxy;
import test.wsdl.jaxrpcdynproxy.holders.AddressBeanHolder;
public class AddressSoapBindingImpl implements test.wsdl.jaxrpcdynproxy.AddressService {
public String updateAddress(AddressBeanHolder addressBeanHolder, int newPostCode) throws java.rmi.RemoteException {
addressBeanHolder.value.setPostcode(newPostCode);
return ("Your street : " + addressBeanHolder.value.getStreet() + "\nYour postCode : " + newPostCode);
}
}
| 6,573 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpcdynproxy/JAXRPCDynProxyTestCase.java | package test.wsdl.jaxrpcdynproxy;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceFactory;
import java.net.URL;
import test.HttpTestUtil;
import test.wsdl.jaxrpcdynproxy.holders.AddressBeanHolder;
import junit.framework.TestCase;
import java.net.URL;
import java.lang.reflect.Proxy;
import org.apache.axis.encoding.TypeMappingRegistry;
import org.apache.axis.encoding.TypeMapping;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.client.AxisClientProxy;
public class JAXRPCDynProxyTestCase extends TestCase {
/**
* Default constructor for use as service
*/
public JAXRPCDynProxyTestCase() {
super("JAXRPCDynProxyTest");
}
public JAXRPCDynProxyTestCase(String name) {
super(name);
}
public void testInOut() throws Exception {
URL urlWsdl = HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/AddressInOut?wsdl");
String nameSpaceUri = "http://jaxrpcdynproxy.wsdl.test";
String serviceName = "AddressInOut";
String portName = "AddressInOut";
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(urlWsdl, new
QName(nameSpaceUri, serviceName));
AddressService myProxy = (AddressService) service.getPort(new
QName(nameSpaceUri, portName), AddressService.class);
AddressBean addressBean = new AddressBean();
addressBean.setStreet("55, rue des Lilas");
AddressBeanHolder addressBeanHolder = new AddressBeanHolder(addressBean);
QName qName = new QName("http://jaxrpcdynproxy.wsdl.test", "AddressBean");
AxisClientProxy clientProxy = (AxisClientProxy) Proxy.getInvocationHandler(myProxy);
clientProxy.getCall().registerTypeMapping(AddressBean.class,
qName,
BeanSerializerFactory.class,
BeanDeserializerFactory.class,
false);
myProxy.updateAddress(addressBeanHolder, 75005);
addressBean = addressBeanHolder.value;
assertEquals("New postcode is not the expected 75005", addressBean.getPostcode(), 75005);
}
public static void main(String[] args) throws Exception {
JAXRPCDynProxyTestCase test = new JAXRPCDynProxyTestCase("test");
test.testInOut();
}
}
| 6,574 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/types/DynamicProxyTestCase.java | /**
* TypeTestServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.types;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.axis.holders.DayHolder;
import org.apache.axis.holders.MonthDayHolder;
import org.apache.axis.holders.MonthHolder;
import org.apache.axis.holders.NegativeIntegerHolder;
import org.apache.axis.holders.NonNegativeIntegerHolder;
import org.apache.axis.holders.NonPositiveIntegerHolder;
import org.apache.axis.holders.PositiveIntegerHolder;
import org.apache.axis.holders.TimeHolder;
import org.apache.axis.holders.URIHolder;
import org.apache.axis.holders.UnsignedByteHolder;
import org.apache.axis.holders.UnsignedIntHolder;
import org.apache.axis.holders.UnsignedLongHolder;
import org.apache.axis.holders.UnsignedShortHolder;
import org.apache.axis.holders.YearHolder;
import org.apache.axis.holders.YearMonthHolder;
import org.apache.axis.types.Day;
import org.apache.axis.types.Month;
import org.apache.axis.types.MonthDay;
import org.apache.axis.types.NegativeInteger;
import org.apache.axis.types.NonNegativeInteger;
import org.apache.axis.types.NonPositiveInteger;
import org.apache.axis.types.PositiveInteger;
import org.apache.axis.types.Time;
import org.apache.axis.types.URI;
import org.apache.axis.types.UnsignedByte;
import org.apache.axis.types.UnsignedInt;
import org.apache.axis.types.UnsignedLong;
import org.apache.axis.types.UnsignedShort;
import org.apache.axis.types.Year;
import org.apache.axis.types.YearMonth;
import test.HttpTestUtil;
import test.wsdl.types.comprehensive_service.TypeTest;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Stub;
import javax.xml.rpc.holders.BigDecimalHolder;
import javax.xml.rpc.holders.BigIntegerHolder;
import javax.xml.rpc.holders.BooleanHolder;
import javax.xml.rpc.holders.BooleanWrapperHolder;
import javax.xml.rpc.holders.ByteArrayHolder;
import javax.xml.rpc.holders.ByteHolder;
import javax.xml.rpc.holders.CalendarHolder;
import javax.xml.rpc.holders.DoubleHolder;
import javax.xml.rpc.holders.DoubleWrapperHolder;
import javax.xml.rpc.holders.FloatHolder;
import javax.xml.rpc.holders.FloatWrapperHolder;
import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.IntegerWrapperHolder;
import javax.xml.rpc.holders.LongHolder;
import javax.xml.rpc.holders.QNameHolder;
import javax.xml.rpc.holders.ShortHolder;
import javax.xml.rpc.holders.ShortWrapperHolder;
import javax.xml.rpc.holders.StringHolder;
import java.io.File;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.Calendar;
public class DynamicProxyTestCase extends TestCase {
public DynamicProxyTestCase(String name) {
super(name);
}
private TypeTest getProxyWithWSDL() {
try {
Service service = ServiceFactory.newInstance().createService(
new File("src/test/wsdl/types/ComprehensiveTypes.wsdl").getAbsoluteFile().toURL(),
new QName("urn:comprehensive-service.types.wsdl.test",
"TypeTestService"));
Stub stub = (Stub)service.getPort(
new QName("", "TypeTest"), TypeTest.class);
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, HttpTestUtil.getTestEndpoint((String)stub._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)).toString());
return (TypeTest)stub;
}
catch (MalformedURLException mue) {
throw new AssertionFailedError(
"MalformedURLException caught: " + mue);
}
catch (ServiceException jre) {
throw new AssertionFailedError("ServiceException caught: " + jre);
}
} // getProxyWithWSDL
private TypeTest getProxy() {
try {
Service service = ServiceFactory.newInstance().createService(null);
Stub binding = (Stub) service.getPort(TypeTest.class);
binding._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:8080/axis/services/TypeTest");
throw new AssertionFailedError("Should not get a binding");
}
catch (ServiceException jre) {
return null;
}
} // getProxy
private void allPrimitivesIn(TypeTest binding) {
assertTrue("binding is null", binding != null);
try {
binding.allPrimitivesIn(
new String(),
new BigInteger("0"),
0,
0,
(short)0,
new BigDecimal(0),
0,
0,
true,
(byte)0,
new QName("http://double-double", "toil-and-trouble"),
Calendar.getInstance(),
new byte[0],
new byte[0],
new String(),
new Boolean(false),
new Float(0),
new Double(0),
new BigDecimal(0),
new Integer(0),
new Short((short)0),
new byte[0],
new Time("12:01:30.150Z"),
new UnsignedLong(0),
new UnsignedInt(0),
new UnsignedShort(0),
new UnsignedByte(0),
new NonNegativeInteger("0"),
new PositiveInteger("1"),
new NonPositiveInteger("0"),
new NegativeInteger("-1"),
new URI("urn:this-is-a-test"),
new Year(1995),
new Month(7),
new Day(13),
new YearMonth(2002, 8),
new MonthDay(8, 26)
);
}
catch (RemoteException re) {
re.printStackTrace();
throw new AssertionFailedError("Remote Exception caught: " + re);
}
catch (Exception e) {
// possibly thrown from Unsigned constructors
// wont happen since we know the value are good!
}
} // allPrimitivesIn
public void test1TypeTestAllPrimitivesIn() {
TypeTest binding = getProxyWithWSDL();
allPrimitivesIn(binding);
binding = getProxy();
assertTrue(binding == null);
} // test2TypeTestAllPrimitivesInout
private void allPrimitivesInout(TypeTest binding) {
assertTrue("binding is null", binding != null);
try {
binding.allPrimitivesInout(
new StringHolder(new String()),
new BigIntegerHolder(new BigInteger("0")),
new IntHolder(0),
new LongHolder(0),
new ShortHolder((short)0),
new BigDecimalHolder(new BigDecimal(0)),
new FloatHolder(0),
new DoubleHolder(0),
new BooleanHolder(true),
new ByteHolder((byte)0),
new QNameHolder(new QName("http://double-double",
"toil-and-trouble")),
new CalendarHolder(Calendar.getInstance()),
new ByteArrayHolder(new byte[0]),
new ByteArrayHolder(new byte[0]),
new StringHolder(new String()),
new BooleanWrapperHolder(new Boolean(false)),
new FloatWrapperHolder(new Float(0)),
new DoubleWrapperHolder(new Double(0)),
new BigDecimalHolder(new BigDecimal(0)),
new IntegerWrapperHolder(new Integer(0)),
new ShortWrapperHolder(new Short((short)0)),
new ByteArrayHolder(new byte[0]),
new TimeHolder(new Time("12:01:30.150Z")),
new UnsignedLongHolder(new UnsignedLong(0)),
new UnsignedIntHolder(new UnsignedInt(0)),
new UnsignedShortHolder(new UnsignedShort(0)),
new UnsignedByteHolder(new UnsignedByte(0)),
new NonNegativeIntegerHolder(new NonNegativeInteger("0")),
new PositiveIntegerHolder(new PositiveInteger("1")),
new NonPositiveIntegerHolder(new NonPositiveInteger("0")),
new NegativeIntegerHolder(new NegativeInteger("-1")),
new URIHolder(new URI("urn:this-is-a-test")),
new YearHolder(new Year(1995)),
new MonthHolder(new Month(7)),
new DayHolder(new Day(13)),
new YearMonthHolder(new YearMonth(2002, 8)),
new MonthDayHolder(new MonthDay(8, 26))
);
}
catch (RemoteException re) {
re.printStackTrace();
throw new AssertionFailedError("Remote Exception caught: " + re);
}
catch (Exception e) {
// possibly thrown from Unsigned constructors
// wont happen since we know the value are good!
}
} // allPrimitivesInout
public void test2TypeTestAllPrimitivesInout() {
/*
TypeTest binding = getProxyWithWSDL();
allPrimitivesInout(binding);
binding = getProxy();
allPrimitivesInout(binding);
*/
} // test2TypeTestAllPrimitivesInout
private void allPrimitivesOut(TypeTest binding) {
assertTrue("binding is null", binding != null);
try {
binding.allPrimitivesOut(
new StringHolder(),
new BigIntegerHolder(),
new IntHolder(),
new LongHolder(),
new ShortHolder(),
new BigDecimalHolder(),
new FloatHolder(),
new DoubleHolder(),
new BooleanHolder(),
new ByteHolder(),
new QNameHolder(),
new CalendarHolder(),
new ByteArrayHolder(),
new ByteArrayHolder(),
new StringHolder(),
new BooleanWrapperHolder(),
new FloatWrapperHolder(),
new DoubleWrapperHolder(),
new BigDecimalHolder(),
new IntegerWrapperHolder(),
new ShortWrapperHolder(),
new ByteArrayHolder(),
new TimeHolder(),
new UnsignedLongHolder(),
new UnsignedIntHolder(),
new UnsignedShortHolder(),
new UnsignedByteHolder(),
new NonNegativeIntegerHolder(),
new PositiveIntegerHolder(),
new NonPositiveIntegerHolder(),
new NegativeIntegerHolder(),
new URIHolder(),
new YearHolder(),
new MonthHolder(),
new DayHolder(),
new YearMonthHolder(),
new MonthDayHolder()
);
}
catch (RemoteException re) {
throw new AssertionFailedError("Remote Exception caught: " + re);
}
} // allPrimitivesOut
public void test3TypeTestAllPrimitivesOut() {
/*
TypeTest binding = getProxyWithWSDL();
allPrimitivesOut(binding);
binding = getProxy();
allPrimitivesOut(binding);
*/
} // test3TypeTestAllPrimitivesOut
/*
public void test4TypeTestEnumIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.enumIn(test.wsdl.types.comprehensive_types.Enum.one);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test5TypeTestEnumInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.enumInout(new test.wsdl.types.comprehensive_types.EnumHolder(test.wsdl.types.comprehensive_types.Enum.one));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test6TypeTestEnumOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.enumOut(new test.wsdl.types.comprehensive_types.EnumHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test7TypeTestEnumReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.Enum value = null;
value = binding.enumReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test8TypeTestArrayIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayIn(new String[0]);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test9TypeTestArrayInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayInout(new test.wsdl.types.comprehensive_types.ArrayHolder(new String[0]));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test10TypeTestArrayOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayOut(new test.wsdl.types.comprehensive_types.ArrayHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test11TypeTestArrayReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
String[] value = null;
value = binding.arrayReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test12TypeTestArrayMIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayMIn(new int[0][0][0]);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test13TypeTestArrayMInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayMInout(new test.wsdl.types.comprehensive_types.ArrayMHolder(new int[0][0][0]));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test14TypeTestArrayMOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.arrayMOut(new test.wsdl.types.comprehensive_types.ArrayMHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test15TypeTestArrayMReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
int[][][] value = null;
value = binding.arrayMReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test16TypeTestComplexAllIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexAllIn(new test.wsdl.types.comprehensive_types.ComplexAll());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test17TypeTestComplexAllInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexAllInout(new test.wsdl.types.comprehensive_types.ComplexAllHolder(new test.wsdl.types.comprehensive_types.ComplexAll()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test18TypeTestComplexAllOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexAllOut(new test.wsdl.types.comprehensive_types.ComplexAllHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test19TypeTestComplexAllReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.ComplexAll value = null;
value = binding.complexAllReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test20TypeTestComplexSequenceIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexSequenceIn(new test.wsdl.types.comprehensive_types.ComplexSequence());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test21TypeTestComplexSequenceInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexSequenceInout(new test.wsdl.types.comprehensive_types.ComplexSequenceHolder(new test.wsdl.types.comprehensive_types.ComplexSequence()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test22TypeTestComplexSequenceOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexSequenceOut(new test.wsdl.types.comprehensive_types.ComplexSequenceHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test23TypeTestComplexSequenceReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.ComplexSequence value = null;
value = binding.complexSequenceReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test24TypeTestElemWComplexIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.elemWComplexIn(new test.wsdl.types.comprehensive_types.ElemWComplex());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test25TypeTestElemWComplexInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.elemWComplexInout(new test.wsdl.types.comprehensive_types.ElemWComplexHolder(new test.wsdl.types.comprehensive_types.ElemWComplex()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test26TypeTestElemWComplexOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.elemWComplexOut(new test.wsdl.types.comprehensive_types.ElemWComplexHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test27TypeTestElemWComplexReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.ElemWComplex value = null;
value = binding.elemWComplexReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test28TypeTestComplexWComplexIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexWComplexIn(new test.wsdl.types.comprehensive_types.ComplexWComplex());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test29TypeTestComplexWComplexInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexWComplexInout(new test.wsdl.types.comprehensive_types.ComplexWComplexHolder(new test.wsdl.types.comprehensive_types.ComplexWComplex()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test30TypeTestComplexWComplexOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.complexWComplexOut(new test.wsdl.types.comprehensive_types.ComplexWComplexHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test31TypeTestComplexWComplexReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.ComplexWComplex value = null;
value = binding.complexWComplexReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test32TypeTestAnyIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.anyIn(new String());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test33TypeTestAnyInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.anyInout(new ObjectHolder(new String()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test34TypeTestAnyOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.anyOut(new ObjectHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test35TypeTestAnyReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Object value = null;
value = binding.anyReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test36TypeTestAnimalIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.animalIn(new test.wsdl.types.comprehensive_types.Animal());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test37TypeTestAnimalInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.animalInout(new test.wsdl.types.comprehensive_types.AnimalHolder(new test.wsdl.types.comprehensive_types.Animal()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test38TypeTestAnimalOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.animalOut(new test.wsdl.types.comprehensive_types.AnimalHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test39TypeTestAnimalReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.Animal value = null;
value = binding.animalReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test40TypeTestCatIn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.catIn(new test.wsdl.types.comprehensive_types.Cat());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test41TypeTestCatInout() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.catInout(new test.wsdl.types.comprehensive_types.CatHolder(new test.wsdl.types.comprehensive_types.Cat()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test42TypeTestCatOut() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.catOut(new test.wsdl.types.comprehensive_types.CatHolder());
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test43TypeTestCatReturn() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.types.comprehensive_types.Cat value = null;
value = binding.catReturn();
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test44TypeTestMethodBoolean() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
boolean value = false;
value = binding.methodBoolean(true, new BooleanHolder(true));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test45TypeTestMethodByte() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
byte value = -3;
value = binding.methodByte((byte)0, new ByteHolder((byte)0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test46TypeTestMethodShort() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
short value = -3;
value = binding.methodShort((short)0, new ShortHolder((short)0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test47TypeTestMethodInt() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
int value = -3;
value = binding.methodInt(0, new IntHolder(0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test48TypeTestMethodLong() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
long value = -3;
value = binding.methodLong(0, new LongHolder(0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test49TypeTestMethodFloat() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
float value = -3;
value = binding.methodFloat(0, new FloatHolder(0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test50TypeTestMethodDouble() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
double value = -3;
value = binding.methodDouble(0, new DoubleHolder(0));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test51TypeTestMethodString() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
String value = null;
value = binding.methodString(new String(), new StringHolder(new String()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test52TypeTestMethodInteger() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.math.BigInteger value = null;
value = binding.methodInteger(new java.math.BigInteger("0"), new BigIntegerHolder(new java.math.BigInteger("0")));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test53TypeTestMethodDecimal() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.math.BigDecimal value = null;
value = binding.methodDecimal(new java.math.BigDecimal(0), new BigDecimalHolder(new java.math.BigDecimal(0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test54TypeTestMethodDateTime() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.util.Calendar value = null;
value = binding.methodDateTime(java.util.Calendar.getInstance(), new CalendarHolder(java.util.Calendar.getInstance()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test55TypeTestMethodQName() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
javax.xml.namespace.QName value = null;
value = binding.methodQName(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble"), new QNameHolder(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble")));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test56TypeTestMethodSoapString() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
String value = null;
value = binding.methodSoapString(new String(), new StringHolder(new String()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test57TypeTestMethodSoapBoolean() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Boolean value = null;
value = binding.methodSoapBoolean(new Boolean(false), new BooleanWrapperHolder(new Boolean(false)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test58TypeTestMethodSoapFloat() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Float value = null;
value = binding.methodSoapFloat(new Float(0), new FloatWrapperHolder(new Float(0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test59TypeTestMethodSoapDouble() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Double value = null;
value = binding.methodSoapDouble(new Double(0), new DoubleWrapperHolder(new Double(0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test60TypeTestMethodSoapDecimal() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.math.BigDecimal value = null;
value = binding.methodSoapDecimal(new java.math.BigDecimal(0), new BigDecimalHolder(new java.math.BigDecimal(0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test61TypeTestMethodSoapInt() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Integer value = null;
value = binding.methodSoapInt(new Integer(0), new IntegerWrapperHolder(new Integer(0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test62TypeTestMethodSoapShort() {
test.wsdl.types.comprehensive_service.TypeTest binding;
try {
binding = new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTest();
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Short value = null;
value = binding.methodSoapShort(new Short((short)0), new ShortWrapperHolder(new Short((short)0)));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
*/
}
| 6,575 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/types/VerifyTestCase.java | /**
* TypeTestServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.types;
import org.apache.axis.holders.DayHolder;
import org.apache.axis.holders.MonthDayHolder;
import org.apache.axis.holders.MonthHolder;
import org.apache.axis.holders.NegativeIntegerHolder;
import org.apache.axis.holders.NonNegativeIntegerHolder;
import org.apache.axis.holders.NonPositiveIntegerHolder;
import org.apache.axis.holders.PositiveIntegerHolder;
import org.apache.axis.holders.TimeHolder;
import org.apache.axis.holders.URIHolder;
import org.apache.axis.holders.UnsignedByteHolder;
import org.apache.axis.holders.UnsignedIntHolder;
import org.apache.axis.holders.UnsignedLongHolder;
import org.apache.axis.holders.UnsignedShortHolder;
import org.apache.axis.holders.YearHolder;
import org.apache.axis.holders.YearMonthHolder;
import org.apache.axis.types.Day;
import org.apache.axis.types.Month;
import org.apache.axis.types.MonthDay;
import org.apache.axis.types.NegativeInteger;
import org.apache.axis.types.NonNegativeInteger;
import org.apache.axis.types.NonPositiveInteger;
import org.apache.axis.types.PositiveInteger;
import org.apache.axis.types.URI;
import org.apache.axis.types.URI.MalformedURIException;
import org.apache.axis.types.UnsignedByte;
import org.apache.axis.types.UnsignedInt;
import org.apache.axis.types.UnsignedLong;
import org.apache.axis.types.UnsignedShort;
import org.apache.axis.types.Year;
import org.apache.axis.types.YearMonth;
import test.HttpTestUtil;
import test.wsdl.types.comprehensive_service.TypeTest;
import test.wsdl.types.comprehensive_service.TypeTestServiceLocator;
import test.wsdl.types.comprehensive_types.Animal;
import test.wsdl.types.comprehensive_types.Cat;
import test.wsdl.types.comprehensive_types.ComplexAll;
import test.wsdl.types.comprehensive_types.ComplexSequence;
import test.wsdl.types.comprehensive_types.ComplexWComplex;
import test.wsdl.types.comprehensive_types.EmptyComplexType;
import test.wsdl.types.comprehensive_types.Enum;
import test.wsdl.types.comprehensive_types.PersionCat;
import test.wsdl.types.comprehensive_types.Time;
import test.wsdl.types.comprehensive_types.Yarn;
import test.wsdl.types.comprehensive_types.ComplexWComplexStock_quote;
import test.wsdl.types.comprehensive_types.holders.AnimalHolder;
import test.wsdl.types.comprehensive_types.holders.ArrayHolder;
import test.wsdl.types.comprehensive_types.holders.ArrayMHolder;
import test.wsdl.types.comprehensive_types.holders.CatHolder;
import test.wsdl.types.comprehensive_types.holders.ComplexAllHolder;
import test.wsdl.types.comprehensive_types.holders.ComplexSequenceHolder;
import test.wsdl.types.comprehensive_types.holders.ComplexWComplexHolder;
import test.wsdl.types.comprehensive_types.holders.EmptyComplexTypeHolder;
import test.wsdl.types.comprehensive_types.holders.EnumHolder;
import test.wsdl.types.comprehensive_types2.A;
import test.wsdl.types.comprehensive_types2.B;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.holders.BigDecimalHolder;
import javax.xml.rpc.holders.BigIntegerHolder;
import javax.xml.rpc.holders.BooleanHolder;
import javax.xml.rpc.holders.BooleanWrapperHolder;
import javax.xml.rpc.holders.ByteArrayHolder;
import javax.xml.rpc.holders.ByteHolder;
import javax.xml.rpc.holders.CalendarHolder;
import javax.xml.rpc.holders.DoubleHolder;
import javax.xml.rpc.holders.DoubleWrapperHolder;
import javax.xml.rpc.holders.FloatHolder;
import javax.xml.rpc.holders.FloatWrapperHolder;
import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.IntegerWrapperHolder;
import javax.xml.rpc.holders.LongHolder;
import javax.xml.rpc.holders.ObjectHolder;
import javax.xml.rpc.holders.QNameHolder;
import javax.xml.rpc.holders.ShortHolder;
import javax.xml.rpc.holders.ShortWrapperHolder;
import javax.xml.rpc.holders.StringHolder;
import java.util.Calendar;
import java.util.Date;
public class VerifyTestCase extends junit.framework.TestCase {
public VerifyTestCase(String name) {
super(name);
}
/* FIXME: RUNTIME WSDL broken.
public void testTypeTestWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTestAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getServiceName());
assertTrue(service != null);
}
*/
public void testTypeTest() throws Exception {
TypeTest binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// setup unsigned
UnsignedLong ulong = null;
UnsignedInt uint = null;
UnsignedShort ushort = null;
UnsignedByte ubyte = null;
NonNegativeInteger nnint = null;
PositiveInteger pint = null;
NonPositiveInteger npint = null;
NegativeInteger nint = null;
URI uri = null;
Year year = null;
Month month = null;
Day day = null;
YearMonth yearmonth = null;
MonthDay monthday = null;
try {
ulong = new UnsignedLong(7777);
uint = new UnsignedInt(777);
ushort = new UnsignedShort(77);
ubyte = new UnsignedByte(7);
nnint = new NonNegativeInteger("7");
pint = new PositiveInteger("7");
npint = new NonPositiveInteger("-7");
nint = new NegativeInteger("-7");
uri = new URI("urn:this-is-a-test");
year = new Year(1995);
month = new Month(7);
day = new Day(13);
yearmonth = new YearMonth(2002, 8);
monthday = new MonthDay(8, 26);
} catch (Exception e) {
// possibly thrown from constructors
// wont happen since we know the values are good!
}
try {
binding.allPrimitivesIn(
"hi",
new java.math.BigInteger("5"),
0,
(long) 0,
(short) 0,
new java.math.BigDecimal(6),
(float) 0,
(double) 0,
true,
(byte) 0,
new QName("hi", "ho"),
Calendar.getInstance(),
new byte[]{(byte) 5},
new byte[]{(byte) 6},
"hi ho",
new Boolean(true),
new Float(0),
new Double(0),
new java.math.BigDecimal(7),
new Integer(0),
new Short((short) 0),
new byte[]{(byte) 7},
new org.apache.axis.types.Time("12:01:30.150Z"),
ulong,
uint,
ushort,
ubyte,
nnint,
pint,
npint,
nint,
uri,
year,
month,
day,
yearmonth,
monthday
);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("allPrimitives: " + re );
}
try {
binding.allPrimitivesInout(
new StringHolder("hi"),
new BigIntegerHolder(new java.math.BigInteger("0")),
new IntHolder(1),
new LongHolder(2),
new ShortHolder((short) 3),
new BigDecimalHolder(new java.math.BigDecimal(4)),
new FloatHolder(5),
new DoubleHolder(6),
new BooleanHolder(true),
new ByteHolder((byte) 7),
new QNameHolder(new QName("ho", "hi")),
new CalendarHolder(Calendar.getInstance()),
new ByteArrayHolder(new byte[]{(byte) 8}),
new ByteArrayHolder(new byte[]{(byte) 9}),
new StringHolder("ho hi"),
new BooleanWrapperHolder(new Boolean(true)),
new FloatWrapperHolder(new Float(10)),
new DoubleWrapperHolder(new Double(11)),
new BigDecimalHolder(new java.math.BigDecimal(12)),
new IntegerWrapperHolder(new Integer(13)),
new ShortWrapperHolder(new Short((short) 14)),
new ByteArrayHolder(new byte[]{(byte) 15}),
new TimeHolder(new org.apache.axis.types.Time("12:01:30.150Z")),
new UnsignedLongHolder(ulong),
new UnsignedIntHolder(uint),
new UnsignedShortHolder(ushort),
new UnsignedByteHolder(ubyte),
new NonNegativeIntegerHolder(nnint),
new PositiveIntegerHolder(pint),
new NonPositiveIntegerHolder(npint),
new NegativeIntegerHolder(nint),
new URIHolder(uri),
new YearHolder(year),
new MonthHolder(month),
new DayHolder(day),
new YearMonthHolder(yearmonth),
new MonthDayHolder(monthday)
);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("allPrimitivesInout Exception caught: " + re );
}
try {
binding.allPrimitivesOut(
new StringHolder(),
new BigIntegerHolder(),
new IntHolder(),
new LongHolder(),
new ShortHolder(),
new BigDecimalHolder(),
new FloatHolder(),
new DoubleHolder(),
new BooleanHolder(),
new ByteHolder(),
new QNameHolder(),
new CalendarHolder(),
new ByteArrayHolder(),
new ByteArrayHolder(),
new StringHolder(),
new BooleanWrapperHolder(),
new FloatWrapperHolder(),
new DoubleWrapperHolder(),
new BigDecimalHolder(),
new IntegerWrapperHolder(),
new ShortWrapperHolder(),
new ByteArrayHolder(),
new TimeHolder(),
new UnsignedLongHolder(),
new UnsignedIntHolder(),
new UnsignedShortHolder(),
new UnsignedByteHolder(),
new NonNegativeIntegerHolder(),
new PositiveIntegerHolder(),
new NonPositiveIntegerHolder(),
new NegativeIntegerHolder(),
new URIHolder(),
new YearHolder(),
new MonthHolder(),
new DayHolder(),
new YearMonthHolder(),
new MonthDayHolder()
);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("allPrimitivesOut Exception caught: " + re );
}
try {
binding.enumIn(Enum.one);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("enumIn Exception caught: " + re );
}
try {
binding.enumInout(new EnumHolder(Enum.two));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("enumInout Exception caught: " + re );
}
try {
EnumHolder value = new EnumHolder();
binding.enumOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("enumOut Exception caught: " + re );
}
try {
Enum value = null;
value = binding.enumReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("enumReturn Exception caught: " + re );
}
try {
binding.arrayIn(new String[] {"hi", "ho"});
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayIn Exception caught: " + re);
}
try {
binding.arrayInout(new ArrayHolder(new String[] {"hee", "hee"}));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayInout Exception caught: " + re);
}
try {
ArrayHolder value = new ArrayHolder();
binding.arrayOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayOut Exception caught: " + re);
}
try {
String[] value = binding.arrayReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayReturn Exception caught: " + re);
}
try {
binding.arrayMIn(new int[][][] {new int[][] {new int[] {2}}});
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayMIn Exception caught: " + re);
}
try {
binding.arrayMInout(new ArrayMHolder(new int[][][] {new int[][] {new int[] {2}}}));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayMInout Exception caught: " + re);
}
try {
ArrayMHolder value = new ArrayMHolder();
binding.arrayMOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayMOut Exception caught: " + re);
}
try {
int[][][] value = binding.arrayMReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("arrayMReturn Exception caught: " + re);
}
ComplexAll complexAll = new ComplexAll();
complexAll.setAreaCode(512);
complexAll.setExchange("838");
complexAll.setNumber("4544");
try {
binding.complexAllIn(complexAll);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexAllIn Exception caught: " + re);
}
try {
binding.complexAllInout(new ComplexAllHolder(complexAll));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexAllInout Exception caught: " + re );
}
try {
ComplexAllHolder value = new ComplexAllHolder();
binding.complexAllOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexAllOut Exception caught: " + re );
}
try {
ComplexAll value = null;
value = binding.complexAllReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexAllReturn Exception caught: " + re );
}
ComplexSequence complexSequence = new ComplexSequence();
complexSequence.setAreaCode(512);
complexSequence.setExchange("838");
complexSequence.setNumber("4544");
try {
binding.complexSequenceIn(complexSequence);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexSequenceIn Exception caught: " + re );
}
try {
binding.complexSequenceInout(new ComplexSequenceHolder(complexSequence));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexSequenceInout Exception caught: " + re );
}
try {
ComplexSequenceHolder value = new ComplexSequenceHolder();
binding.complexSequenceOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexSequenceOut Exception caught: " + re );
}
try {
ComplexSequence value = null;
value = binding.complexSequenceReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexSequenceReturn Exception caught: " + re );
}
String[] optArray = new String[] {"abc", "def"};
byte[][] byteArray = new byte[][] { new byte[] {'a', 'b', 'c'}, new byte[] {'x', 'y', 'z'} };
B b = new B();
A a = new A();
a.setC(3);
b.setD(a);
ComplexWComplexStock_quote stockQuote = new ComplexWComplexStock_quote();
Time time = new Time();
time.setDST(false);
stockQuote.setTime(time);
stockQuote.setChange("5");
stockQuote.setPctchange("100%");
stockQuote.setBid("9");
stockQuote.setAsk("11");
stockQuote.setSymbol("AXS");
stockQuote.setLast("5");
ComplexWComplex complexWComplex = new ComplexWComplex();
complexWComplex.setStock_quote(stockQuote);
complexWComplex.setOutside(22);
binding.complexWComplexIn(complexWComplex);
try {
binding.complexWComplexInout(new ComplexWComplexHolder(complexWComplex));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexWComplexInout Exception caught: " + re );
}
try {
ComplexWComplexHolder value = new ComplexWComplexHolder();
binding.complexWComplexOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexWComplexOut Exception caught: " + re );
}
try {
ComplexWComplex value = null;
value = binding.complexWComplexReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("complexWComplexReturn Exception caught: " + re );
}
try {
EmptyComplexType value = new EmptyComplexType();
binding.emptyComplexTypeIn(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("emptyComplexTypeIn Exception caught: " + re );
}
try {
EmptyComplexTypeHolder value = new EmptyComplexTypeHolder( new EmptyComplexType());
binding.emptyComplexTypeInout(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("emptyComplexTypeInout Exception caught: " + re );
}
try {
EmptyComplexTypeHolder value = new EmptyComplexTypeHolder();
binding.emptyComplexTypeOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("emptyComplexTypeOut Exception caught: " + re );
}
try {
EmptyComplexType value = null;
value = binding.emptyComplexTypeReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("emptyComplexTypeReturn Exception caught: " + re );
}
try {
binding.anyIn(new java.lang.String("hi ho"));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("anyIn Exception caught: " + re );
}
try {
binding.anyInout(new ObjectHolder(new java.lang.String("yo ho ho")));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("anyInout Exception caught: " + re );
}
try {
ObjectHolder value = new ObjectHolder();
binding.anyOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("anyOut Exception caught: " + re );
}
try {
java.lang.Object value = binding.anyReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
Cat cat = new Cat();
cat.setPurr("meow");
PersionCat persion = new PersionCat();
Yarn yarn = new Yarn();
yarn.setColor("green");
persion.setPurr("meow meow");
persion.setColor("blue");
persion.setToy(yarn);
try {
binding.animalIn(cat);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("animalIn Exception caught: " + re );
}
try {
binding.animalInout(new AnimalHolder(cat));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("animalInout Exception caught: " + re );
}
try {
AnimalHolder value = new AnimalHolder();
binding.animalOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("animalOut Exception caught: " + re );
}
try {
Animal value = null;
value = binding.animalReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("animalReturn Exception caught: " + re );
}
try {
binding.catIn(cat);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catIn Exception caught: " + re );
}
try {
binding.catInout(new CatHolder(cat));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catInout Exception caught: " + re );
}
try {
CatHolder value = new CatHolder();
binding.catOut(value);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catOut Exception caught: " + re );
}
try {
Cat value = null;
value = binding.catReturn();
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catReturn Exception caught: " + re );
}
try {
binding.catIn(persion);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catIn Exception caught: " + re );
}
try {
binding.catInout(new CatHolder(persion));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("catInout Exception caught: " + re );
}
try {
BooleanHolder bh = new BooleanHolder(true);
boolean actual = binding.methodBoolean(true, bh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodBoolean Exception caught: " + re );
}
try {
ByteHolder bh = new ByteHolder((byte)5);
byte actual = binding.methodByte((byte)5, bh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodByte Exception caught: " + re );
}
try {
ShortHolder sh = new ShortHolder((short)127);
short actual = binding.methodShort((short)127, sh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodShort Exception caught: " + re );
}
try {
IntHolder ih = new IntHolder(2002);
int actual = binding.methodInt(2002, ih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodInt Exception caught: " + re );
}
try {
LongHolder lh = new LongHolder(14003L);
long actual = binding.methodLong(14003L, lh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodLong Exception caught: " + re );
}
try {
FloatHolder fh = new FloatHolder(2.342F);
float delta = 0.0F;
float actual = binding.methodFloat(2.342F, fh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodFloat Exception caught: " + re );
}
try {
DoubleHolder dh = new DoubleHolder(5006.345D);
double value = 110312.2325D;
double delta = 0.0D;
double actual = binding.methodDouble(5006.345D, dh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodDouble Exception caught: " + re );
}
try {
String sendValue = "Sent String";
StringHolder sh = new StringHolder(sendValue);
String actual = binding.methodString(sendValue, sh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodString Exception caught: " + re );
}
try {
java.math.BigInteger sendValue = new java.math.BigInteger("3048");
BigIntegerHolder bih = new BigIntegerHolder(sendValue);
java.math.BigInteger actual = binding.methodInteger(sendValue, bih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodInteger Exception caught: " + re );
}
try {
java.math.BigDecimal sendValue = new java.math.BigDecimal("1205.258");
BigDecimalHolder bdh = new BigDecimalHolder(sendValue);
java.math.BigDecimal actual = binding.methodDecimal(sendValue, bdh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodDecimal Exception caught: " + re );
}
try {
Calendar sendValue = Calendar.getInstance();
sendValue.setTime(new Date(1012182070626L));
CalendarHolder ch = new CalendarHolder(sendValue);
Calendar actual = binding.methodDateTime(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodDateTime Exception caught: " + re );
}
// Comment out for now because causes compile errors
// try {
// byte[] sendValue = {(byte) 10, (byte) 9};
// ByteArrayHolder bah = new ByteArrayHolder(sendValue);
// byte[] actual = binding.methodBase64Binary(sendValue, bah);
// } catch (java.rmi.RemoteException re) {
// throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
// }
try {
QName sendValue = new QName("test1", "test2");
QNameHolder qh = new QNameHolder(sendValue);
QName actual = binding.methodQName(sendValue, qh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodQName Exception caught: " + re );
}
// Comment out for now because causes compile errors
// try {
// byte[] sendValue = {(byte) 10, (byte) 9};
// ByteArrayHolder bah = new ByteArrayHolder(sendValue);
// byte[] actual = binding.methodHexBinary(sendValue, bah);
// } catch (java.rmi.RemoteException re) {
// throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
// }
try {
org.apache.axis.types.Time sendValue = new org.apache.axis.types.Time("15:30:45.245Z");
TimeHolder ch = new TimeHolder(sendValue);
org.apache.axis.types.Time actual = binding.methodTime(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodTime Exception caught: " + re );
}
try {
UnsignedLong sendValue = null;
try {
sendValue = new UnsignedLong(18446744073709551600D);
} catch (Exception e) {
}
UnsignedLongHolder ch = new UnsignedLongHolder(sendValue);
UnsignedLong actual = binding.methodUnsignedLong(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodUnsignedLong Exception caught: " + re );
}
try {
UnsignedInt sendValue = null;
try {
sendValue = new UnsignedInt(4294967200L);
} catch (Exception e) {
}
UnsignedIntHolder ch = new UnsignedIntHolder(sendValue);
UnsignedInt actual = binding.methodUnsignedInt(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodUnsignedInt Exception caught: " + re );
}
try {
UnsignedShort sendValue = null;
try {
sendValue = new UnsignedShort(65530);
} catch (Exception e) {
}
UnsignedShortHolder ch = new UnsignedShortHolder(sendValue);
UnsignedShort actual = binding.methodUnsignedShort(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodUnsignedShort Exception caught: " + re );
}
try {
UnsignedByte sendValue = null;
try {
sendValue = new UnsignedByte(250);
} catch (Exception e) {
}
UnsignedByteHolder ch = new UnsignedByteHolder(sendValue);
UnsignedByte actual = binding.methodUnsignedByte(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodUnsignedByte Exception caught: " + re );
}
try {
NonNegativeInteger sendValue = new NonNegativeInteger("246802468024680");
NonNegativeIntegerHolder nnih = new NonNegativeIntegerHolder(sendValue);
NonNegativeInteger actual = binding.methodNonNegativeInteger(sendValue, nnih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodNonNegativeInteger Exception caught: " + re );
}
try {
PositiveInteger sendValue = new PositiveInteger("246802468024680");
PositiveIntegerHolder pih = new PositiveIntegerHolder(sendValue);
PositiveInteger actual = binding.methodPositiveInteger(sendValue, pih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodPositiveInteger Exception caught: " + re );
}
try {
NonPositiveInteger sendValue = new NonPositiveInteger("-246802468024680");
NonPositiveIntegerHolder npih = new NonPositiveIntegerHolder(sendValue);
NonPositiveInteger actual = binding.methodNonPositiveInteger(sendValue, npih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodNonPositiveInteger Exception caught: " + re );
}
try {
NegativeInteger sendValue = new NegativeInteger("-246802468024680");
NegativeIntegerHolder nih = new NegativeIntegerHolder(sendValue);
NegativeInteger actual = binding.methodNegativeInteger(sendValue, nih);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodNegativeInteger Exception caught: " + re );
}
try {
URI sendValue = null;
try {
sendValue = new URI("urn:this-is-a-test");
} catch (URI.MalformedURIException e) {
}
URIHolder ch = new URIHolder(sendValue);
URI actual = binding.methodAnyURI(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodAnyURI Exception caught: " + re );
}
try {
test.wsdl.types.comprehensive_types2.SimpleAnyURIType sendValue = new test.wsdl.types.comprehensive_types2.SimpleAnyURIType("urn:this-is-a-simple-test");
test.wsdl.types.comprehensive_types2.holders.SimpleAnyURITypeHolder ch = new test.wsdl.types.comprehensive_types2.holders.SimpleAnyURITypeHolder(sendValue);
test.wsdl.types.comprehensive_types2.SimpleAnyURIType actual = binding.methodSimpleAnyURI(sendValue, ch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodAnyURI Exception caught: " + re );
}
try {
Year sendValue = null;
try {
year = new Year(1995);
} catch (Exception e) {
}
YearHolder h = new YearHolder(year);
Year actual = binding.methodYear(sendValue, h);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodYear Exception caught: " + re );
}
try {
Month sendValue = null;
try {
month = new Month(8);
} catch (Exception e) {
}
MonthHolder h = new MonthHolder(month);
Month actual = binding.methodMonth(sendValue, h);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodMonth Exception caught: " + re );
}
try {
Day sendValue = null;
try {
day = new Day(26);
} catch (Exception e) {
}
DayHolder h = new DayHolder(day);
Day actual = binding.methodDay(sendValue, h);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodDay Exception caught: " + re );
}
try {
YearMonth sendValue = null;
try {
yearmonth = new YearMonth(1995,8);
} catch (Exception e) {
}
YearMonthHolder h = new YearMonthHolder(yearmonth);
YearMonth actual = binding.methodYearMonth(sendValue, h);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodYearMonth Exception caught: " + re );
}
try {
MonthDay sendValue = null;
try {
monthday = new MonthDay(8,26);
} catch (Exception e) {
}
MonthDayHolder h = new MonthDayHolder(monthday);
MonthDay actual = binding.methodMonthDay(sendValue, h);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodMonthDay Exception caught: " + re );
}
try {
String sendValue = "Sent String";
StringHolder sh = new StringHolder(sendValue);
String actual = binding.methodSoapString(sendValue, sh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapString Exception caught: " + re );
}
try {
java.lang.Boolean sendValue = new java.lang.Boolean(true);
BooleanWrapperHolder bh = new BooleanWrapperHolder(sendValue);
java.lang.Boolean actual = binding.methodSoapBoolean(sendValue, bh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapBoolean Exception caught: " + re );
}
try {
java.lang.Float sendValue = new java.lang.Float(93049.0394F);
FloatWrapperHolder fh = new FloatWrapperHolder(sendValue);
java.lang.Float actual = binding.methodSoapFloat(sendValue, fh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapFloat Exception caught: " + re );
}
try {
java.lang.Double sendValue = new java.lang.Double(193049.0394D);
DoubleWrapperHolder dh = new DoubleWrapperHolder(sendValue);
java.lang.Double actual = binding.methodSoapDouble(sendValue, dh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapDouble Exception caught: " + re );
}
try {
java.math.BigDecimal sendValue = new java.math.BigDecimal("1205.258");
BigDecimalHolder bdh = new BigDecimalHolder(sendValue);
java.math.BigDecimal actual = binding.methodDecimal(sendValue, bdh);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodDecimal Exception caught: " + re );
}
try {
java.lang.Integer sendValue = new java.lang.Integer(94);
IntegerWrapperHolder ich = new IntegerWrapperHolder(sendValue);
java.lang.Integer actual = binding.methodSoapInt(sendValue, ich);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapInt Exception caught: " + re );
}
try {
java.lang.Short sendValue = new java.lang.Short((short) 5);
ShortWrapperHolder sch = new ShortWrapperHolder(sendValue);
java.lang.Short actual = binding.methodSoapShort(sendValue, sch);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("methodSoapShort Exception caught: " + re );
}
}
}
| 6,576 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/types | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/types/comprehensive_service/TypeTestServiceTestCase.java | /**
* TypeTestServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.2alpha Dec 15, 2003 (12:04:17 EST) WSDL2Java emitter.
*/
package test.wsdl.types.comprehensive_service;
import test.HttpTestUtil;
public class TypeTestServiceTestCase extends junit.framework.TestCase {
public TypeTestServiceTestCase(java.lang.String name) {
super(name);
}
/* FIXME: RUNTIME WSDL broken.
public void testTypeTestWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getTypeTestAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.types.comprehensive_service.TypeTestServiceLocator().getServiceName());
assertTrue(service != null);
}
*/
public void test1TypeTestAllPrimitivesIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.allPrimitivesIn(new java.lang.String(), new java.math.BigInteger("0"), 0, 0, (short)0, new java.math.BigDecimal(0), 0, 0, true, (byte)0, new javax.xml.namespace.QName("http://double-double", "toil-and-trouble"), java.util.Calendar.getInstance(), new byte[0], new byte[0], new java.lang.String(), new java.lang.Boolean(false), new java.lang.Float(0), new java.lang.Double(0), new java.math.BigDecimal(0), new java.lang.Integer(0), new java.lang.Short((short)0), new byte[0], new org.apache.axis.types.Time("15:45:45.275Z"), new org.apache.axis.types.UnsignedLong(0), new org.apache.axis.types.UnsignedInt(0), new org.apache.axis.types.UnsignedShort(0), new org.apache.axis.types.UnsignedByte(0), new org.apache.axis.types.NonNegativeInteger("0"), new org.apache.axis.types.PositiveInteger("1"), new org.apache.axis.types.NonPositiveInteger("0"), new org.apache.axis.types.NegativeInteger("-1"), new org.apache.axis.types.URI("urn:testing"), new org.apache.axis.types.Year(2000), new org.apache.axis.types.Month(1), new org.apache.axis.types.Day(1), new org.apache.axis.types.YearMonth(2000,1), new org.apache.axis.types.MonthDay(1, 1));
// TBD - validate results
}
public void test2TypeTestAllPrimitivesInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.allPrimitivesInout(new javax.xml.rpc.holders.StringHolder(new java.lang.String()), new javax.xml.rpc.holders.BigIntegerHolder(new java.math.BigInteger("0")), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.LongHolder(0), new javax.xml.rpc.holders.ShortHolder((short)0), new javax.xml.rpc.holders.BigDecimalHolder(new java.math.BigDecimal(0)), new javax.xml.rpc.holders.FloatHolder(0), new javax.xml.rpc.holders.DoubleHolder(0), new javax.xml.rpc.holders.BooleanHolder(true), new javax.xml.rpc.holders.ByteHolder((byte)0), new javax.xml.rpc.holders.QNameHolder(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble")), new javax.xml.rpc.holders.CalendarHolder(java.util.Calendar.getInstance()), new javax.xml.rpc.holders.ByteArrayHolder(new byte[0]), new javax.xml.rpc.holders.ByteArrayHolder(new byte[0]), new javax.xml.rpc.holders.StringHolder(new java.lang.String()), new javax.xml.rpc.holders.BooleanWrapperHolder(new java.lang.Boolean(false)), new javax.xml.rpc.holders.FloatWrapperHolder(new java.lang.Float(0)), new javax.xml.rpc.holders.DoubleWrapperHolder(new java.lang.Double(0)), new javax.xml.rpc.holders.BigDecimalHolder(new java.math.BigDecimal(0)), new javax.xml.rpc.holders.IntegerWrapperHolder(new java.lang.Integer(0)), new javax.xml.rpc.holders.ShortWrapperHolder(new java.lang.Short((short)0)), new javax.xml.rpc.holders.ByteArrayHolder(new byte[0]), new org.apache.axis.holders.TimeHolder(new org.apache.axis.types.Time("15:45:45.275Z")), new org.apache.axis.holders.UnsignedLongHolder(new org.apache.axis.types.UnsignedLong(0)), new org.apache.axis.holders.UnsignedIntHolder(new org.apache.axis.types.UnsignedInt(0)), new org.apache.axis.holders.UnsignedShortHolder(new org.apache.axis.types.UnsignedShort(0)), new org.apache.axis.holders.UnsignedByteHolder(new org.apache.axis.types.UnsignedByte(0)), new org.apache.axis.holders.NonNegativeIntegerHolder(new org.apache.axis.types.NonNegativeInteger("0")), new org.apache.axis.holders.PositiveIntegerHolder(new org.apache.axis.types.PositiveInteger("1")), new org.apache.axis.holders.NonPositiveIntegerHolder(new org.apache.axis.types.NonPositiveInteger("0")), new org.apache.axis.holders.NegativeIntegerHolder(new org.apache.axis.types.NegativeInteger("-1")), new org.apache.axis.holders.URIHolder(new org.apache.axis.types.URI("urn:testing")), new org.apache.axis.holders.YearHolder(new org.apache.axis.types.Year(2000)), new org.apache.axis.holders.MonthHolder(new org.apache.axis.types.Month(1)), new org.apache.axis.holders.DayHolder(new org.apache.axis.types.Day(1)), new org.apache.axis.holders.YearMonthHolder(new org.apache.axis.types.YearMonth(2000,1)), new org.apache.axis.holders.MonthDayHolder(new org.apache.axis.types.MonthDay(1, 1)));
// TBD - validate results
}
public void test3TypeTestAllPrimitivesOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.allPrimitivesOut(new javax.xml.rpc.holders.StringHolder(), new javax.xml.rpc.holders.BigIntegerHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.LongHolder(), new javax.xml.rpc.holders.ShortHolder(), new javax.xml.rpc.holders.BigDecimalHolder(), new javax.xml.rpc.holders.FloatHolder(), new javax.xml.rpc.holders.DoubleHolder(), new javax.xml.rpc.holders.BooleanHolder(), new javax.xml.rpc.holders.ByteHolder(), new javax.xml.rpc.holders.QNameHolder(), new javax.xml.rpc.holders.CalendarHolder(), new javax.xml.rpc.holders.ByteArrayHolder(), new javax.xml.rpc.holders.ByteArrayHolder(), new javax.xml.rpc.holders.StringHolder(), new javax.xml.rpc.holders.BooleanWrapperHolder(), new javax.xml.rpc.holders.FloatWrapperHolder(), new javax.xml.rpc.holders.DoubleWrapperHolder(), new javax.xml.rpc.holders.BigDecimalHolder(), new javax.xml.rpc.holders.IntegerWrapperHolder(), new javax.xml.rpc.holders.ShortWrapperHolder(), new javax.xml.rpc.holders.ByteArrayHolder(), new org.apache.axis.holders.TimeHolder(), new org.apache.axis.holders.UnsignedLongHolder(), new org.apache.axis.holders.UnsignedIntHolder(), new org.apache.axis.holders.UnsignedShortHolder(), new org.apache.axis.holders.UnsignedByteHolder(), new org.apache.axis.holders.NonNegativeIntegerHolder(), new org.apache.axis.holders.PositiveIntegerHolder(), new org.apache.axis.holders.NonPositiveIntegerHolder(), new org.apache.axis.holders.NegativeIntegerHolder(), new org.apache.axis.holders.URIHolder(), new org.apache.axis.holders.YearHolder(), new org.apache.axis.holders.MonthHolder(), new org.apache.axis.holders.DayHolder(), new org.apache.axis.holders.YearMonthHolder(), new org.apache.axis.holders.MonthDayHolder());
// TBD - validate results
}
public void test4TypeTestEnumIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumIn(test.wsdl.types.comprehensive_types.Enum.one);
// TBD - validate results
}
public void test5TypeTestEnumInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumInout(new test.wsdl.types.comprehensive_types.holders.EnumHolder(test.wsdl.types.comprehensive_types.Enum.one));
// TBD - validate results
}
public void test6TypeTestEnumOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumOut(new test.wsdl.types.comprehensive_types.holders.EnumHolder());
// TBD - validate results
}
public void test7TypeTestEnumReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.Enum value = null;
value = binding.enumReturn();
// TBD - validate results
}
public void test8TypeTestEnumIntIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumIntIn(test.wsdl.types.comprehensive_types.EnumInt.value1);
// TBD - validate results
}
public void test9TypeTestEnumIntInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumIntInout(new test.wsdl.types.comprehensive_types.holders.EnumIntHolder(test.wsdl.types.comprehensive_types.EnumInt.value1));
// TBD - validate results
}
public void test10TypeTestEnumIntOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.enumIntOut(new test.wsdl.types.comprehensive_types.holders.EnumIntHolder());
// TBD - validate results
}
public void test11TypeTestEnumIntReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.EnumInt value = null;
value = binding.enumIntReturn();
// TBD - validate results
}
public void test12TypeTestArrayIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayIn(new java.lang.String[0]);
// TBD - validate results
}
public void test13TypeTestArrayInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayInout(new test.wsdl.types.comprehensive_types.holders.ArrayHolder(new java.lang.String[0]));
// TBD - validate results
}
public void test14TypeTestArrayOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayOut(new test.wsdl.types.comprehensive_types.holders.ArrayHolder());
// TBD - validate results
}
public void test15TypeTestArrayReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.String[] value = null;
value = binding.arrayReturn();
// TBD - validate results
}
public void test16TypeTestArrayMIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayMIn(new int[0][0][0]);
// TBD - validate results
}
public void test17TypeTestArrayMInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayMInout(new test.wsdl.types.comprehensive_types.holders.ArrayMHolder(new int[0][0][0]));
// TBD - validate results
}
public void test18TypeTestArrayMOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.arrayMOut(new test.wsdl.types.comprehensive_types.holders.ArrayMHolder());
// TBD - validate results
}
public void test19TypeTestArrayMReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
int[][][] value = null;
value = binding.arrayMReturn();
// TBD - validate results
}
public void test20TypeTestComplexAllIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexAllIn(new test.wsdl.types.comprehensive_types.ComplexAll());
// TBD - validate results
}
public void test21TypeTestComplexAllInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexAllInout(new test.wsdl.types.comprehensive_types.holders.ComplexAllHolder(new test.wsdl.types.comprehensive_types.ComplexAll()));
// TBD - validate results
}
public void test22TypeTestComplexAllOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexAllOut(new test.wsdl.types.comprehensive_types.holders.ComplexAllHolder());
// TBD - validate results
}
public void test23TypeTestComplexAllReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.ComplexAll value = null;
value = binding.complexAllReturn();
// TBD - validate results
}
public void test24TypeTestComplexSequenceIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexSequenceIn(new test.wsdl.types.comprehensive_types.ComplexSequence());
// TBD - validate results
}
public void test25TypeTestComplexSequenceInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexSequenceInout(new test.wsdl.types.comprehensive_types.holders.ComplexSequenceHolder(new test.wsdl.types.comprehensive_types.ComplexSequence()));
// TBD - validate results
}
public void test26TypeTestComplexSequenceOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexSequenceOut(new test.wsdl.types.comprehensive_types.holders.ComplexSequenceHolder());
// TBD - validate results
}
public void test27TypeTestComplexSequenceReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.ComplexSequence value = null;
value = binding.complexSequenceReturn();
// TBD - validate results
}
public void test32TypeTestComplexWComplexIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexWComplexIn(new test.wsdl.types.comprehensive_types.ComplexWComplex());
// TBD - validate results
}
public void test33TypeTestComplexWComplexInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexWComplexInout(new test.wsdl.types.comprehensive_types.holders.ComplexWComplexHolder(new test.wsdl.types.comprehensive_types.ComplexWComplex()));
// TBD - validate results
}
public void test34TypeTestComplexWComplexOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.complexWComplexOut(new test.wsdl.types.comprehensive_types.holders.ComplexWComplexHolder());
// TBD - validate results
}
public void test35TypeTestComplexWComplexReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.ComplexWComplex value = null;
value = binding.complexWComplexReturn();
// TBD - validate results
}
public void test36TypeTestEmptyComplexTypeIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
try {
binding.emptyComplexTypeIn(new test.wsdl.types.comprehensive_types.EmptyComplexType());
}
catch (test.wsdl.types.comprehensive_types.EmptyFault e1) {
throw new junit.framework.AssertionFailedError("emptyFault Exception caught: " + e1);
}
// TBD - validate results
}
public void test37TypeTestEmptyComplexTypeInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
try {
binding.emptyComplexTypeInout(new test.wsdl.types.comprehensive_types.holders.EmptyComplexTypeHolder(new test.wsdl.types.comprehensive_types.EmptyComplexType()));
}
catch (test.wsdl.types.comprehensive_types.EmptyFault e1) {
throw new junit.framework.AssertionFailedError("emptyFault Exception caught: " + e1);
}
// TBD - validate results
}
public void test38TypeTestEmptyComplexTypeOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
try {
binding.emptyComplexTypeOut(new test.wsdl.types.comprehensive_types.holders.EmptyComplexTypeHolder());
}
catch (test.wsdl.types.comprehensive_types.EmptyFault e1) {
throw new junit.framework.AssertionFailedError("emptyFault Exception caught: " + e1);
}
// TBD - validate results
}
public void test39TypeTestEmptyComplexTypeReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
try {
test.wsdl.types.comprehensive_types.EmptyComplexType value = null;
value = binding.emptyComplexTypeReturn();
}
catch (test.wsdl.types.comprehensive_types.EmptyFault e1) {
throw new junit.framework.AssertionFailedError("emptyFault Exception caught: " + e1);
}
// TBD - validate results
}
public void test40TypeTestAnyIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.anyIn(new java.lang.String());
// TBD - validate results
}
public void test41TypeTestAnyInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.anyInout(new javax.xml.rpc.holders.ObjectHolder(new java.lang.String()));
// TBD - validate results
}
public void test42TypeTestAnyOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.anyOut(new javax.xml.rpc.holders.ObjectHolder());
// TBD - validate results
}
public void test43TypeTestAnyReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Object value = null;
value = binding.anyReturn();
// TBD - validate results
}
public void test44TypeTestAnimalIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.animalIn(new test.wsdl.types.comprehensive_types.Animal());
// TBD - validate results
}
public void test45TypeTestAnimalInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.animalInout(new test.wsdl.types.comprehensive_types.holders.AnimalHolder(new test.wsdl.types.comprehensive_types.Animal()));
// TBD - validate results
}
public void test46TypeTestAnimalOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.animalOut(new test.wsdl.types.comprehensive_types.holders.AnimalHolder());
// TBD - validate results
}
public void test47TypeTestAnimalReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.Animal value = null;
value = binding.animalReturn();
// TBD - validate results
}
public void test48TypeTestCatIn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.catIn(new test.wsdl.types.comprehensive_types.Cat());
// TBD - validate results
}
public void test49TypeTestCatInout() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.catInout(new test.wsdl.types.comprehensive_types.holders.CatHolder(new test.wsdl.types.comprehensive_types.Cat()));
// TBD - validate results
}
public void test50TypeTestCatOut() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
binding.catOut(new test.wsdl.types.comprehensive_types.holders.CatHolder());
// TBD - validate results
}
public void test51TypeTestCatReturn() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types.Cat value = null;
value = binding.catReturn();
// TBD - validate results
}
public void test52TypeTestMethodBoolean() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
boolean value = false;
value = binding.methodBoolean(true, new javax.xml.rpc.holders.BooleanHolder(true));
// TBD - validate results
}
public void test53TypeTestMethodByte() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
byte value = -3;
value = binding.methodByte((byte)0, new javax.xml.rpc.holders.ByteHolder((byte)0));
// TBD - validate results
}
public void test54TypeTestMethodShort() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
short value = -3;
value = binding.methodShort((short)0, new javax.xml.rpc.holders.ShortHolder((short)0));
// TBD - validate results
}
public void test55TypeTestMethodInt() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
int value = -3;
value = binding.methodInt(0, new javax.xml.rpc.holders.IntHolder(0));
// TBD - validate results
}
public void test56TypeTestMethodLong() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
long value = -3;
value = binding.methodLong(0, new javax.xml.rpc.holders.LongHolder(0));
// TBD - validate results
}
public void test57TypeTestMethodFloat() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
float value = -3;
value = binding.methodFloat(0, new javax.xml.rpc.holders.FloatHolder(0));
// TBD - validate results
}
public void test58TypeTestMethodDouble() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
double value = -3;
value = binding.methodDouble(0, new javax.xml.rpc.holders.DoubleHolder(0));
// TBD - validate results
}
public void test59TypeTestMethodString() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.String value = null;
value = binding.methodString(new java.lang.String(), new javax.xml.rpc.holders.StringHolder(new java.lang.String()));
// TBD - validate results
}
public void test60TypeTestMethodInteger() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.math.BigInteger value = null;
value = binding.methodInteger(new java.math.BigInteger("0"), new javax.xml.rpc.holders.BigIntegerHolder(new java.math.BigInteger("0")));
// TBD - validate results
}
public void test61TypeTestMethodDecimal() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.math.BigDecimal value = null;
value = binding.methodDecimal(new java.math.BigDecimal(0), new javax.xml.rpc.holders.BigDecimalHolder(new java.math.BigDecimal(0)));
// TBD - validate results
}
public void test62TypeTestMethodDateTime() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.util.Calendar value = null;
value = binding.methodDateTime(java.util.Calendar.getInstance(), new javax.xml.rpc.holders.CalendarHolder(java.util.Calendar.getInstance()));
// TBD - validate results
}
public void test63TypeTestMethodQName() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
javax.xml.namespace.QName value = null;
value = binding.methodQName(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble"), new javax.xml.rpc.holders.QNameHolder(new javax.xml.namespace.QName("http://double-double", "toil-and-trouble")));
// TBD - validate results
}
public void test64TypeTestMethodTime() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.Time value = null;
value = binding.methodTime(new org.apache.axis.types.Time("15:45:45.275Z"), new org.apache.axis.holders.TimeHolder(new org.apache.axis.types.Time("15:45:45.275Z")));
// TBD - validate results
}
public void test65TypeTestMethodUnsignedLong() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.UnsignedLong value = null;
value = binding.methodUnsignedLong(new org.apache.axis.types.UnsignedLong(0), new org.apache.axis.holders.UnsignedLongHolder(new org.apache.axis.types.UnsignedLong(0)));
// TBD - validate results
}
public void test66TypeTestMethodUnsignedInt() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.UnsignedInt value = null;
value = binding.methodUnsignedInt(new org.apache.axis.types.UnsignedInt(0), new org.apache.axis.holders.UnsignedIntHolder(new org.apache.axis.types.UnsignedInt(0)));
// TBD - validate results
}
public void test67TypeTestMethodUnsignedShort() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.UnsignedShort value = null;
value = binding.methodUnsignedShort(new org.apache.axis.types.UnsignedShort(0), new org.apache.axis.holders.UnsignedShortHolder(new org.apache.axis.types.UnsignedShort(0)));
// TBD - validate results
}
public void test68TypeTestMethodUnsignedByte() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.UnsignedByte value = null;
value = binding.methodUnsignedByte(new org.apache.axis.types.UnsignedByte(0), new org.apache.axis.holders.UnsignedByteHolder(new org.apache.axis.types.UnsignedByte(0)));
// TBD - validate results
}
public void test69TypeTestMethodNonNegativeInteger() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.NonNegativeInteger value = null;
value = binding.methodNonNegativeInteger(new org.apache.axis.types.NonNegativeInteger("0"), new org.apache.axis.holders.NonNegativeIntegerHolder(new org.apache.axis.types.NonNegativeInteger("0")));
// TBD - validate results
}
public void test70TypeTestMethodPositiveInteger() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.PositiveInteger value = null;
value = binding.methodPositiveInteger(new org.apache.axis.types.PositiveInteger("1"), new org.apache.axis.holders.PositiveIntegerHolder(new org.apache.axis.types.PositiveInteger("1")));
// TBD - validate results
}
public void test71TypeTestMethodNonPositiveInteger() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.NonPositiveInteger value = null;
value = binding.methodNonPositiveInteger(new org.apache.axis.types.NonPositiveInteger("0"), new org.apache.axis.holders.NonPositiveIntegerHolder(new org.apache.axis.types.NonPositiveInteger("0")));
// TBD - validate results
}
public void test72TypeTestMethodNegativeInteger() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.NegativeInteger value = null;
value = binding.methodNegativeInteger(new org.apache.axis.types.NegativeInteger("-1"), new org.apache.axis.holders.NegativeIntegerHolder(new org.apache.axis.types.NegativeInteger("-1")));
// TBD - validate results
}
public void test73TypeTestMethodAnyURI() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.URI value = null;
value = binding.methodAnyURI(new org.apache.axis.types.URI("urn:testing"), new org.apache.axis.holders.URIHolder(new org.apache.axis.types.URI("urn:testing")));
// TBD - validate results
}
public void test74TypeTestMethodSimpleAnyURI() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.types.comprehensive_types2.SimpleAnyURIType actual = binding.methodSimpleAnyURI(new test.wsdl.types.comprehensive_types2.SimpleAnyURIType("urn:foo"), new test.wsdl.types.comprehensive_types2.holders.SimpleAnyURITypeHolder(new test.wsdl.types.comprehensive_types2.SimpleAnyURIType("urn:foo")));
// TBD - validate results
}
public void test75TypeTestMethodYear() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.Year value = null;
value = binding.methodYear(new org.apache.axis.types.Year(2000), new org.apache.axis.holders.YearHolder(new org.apache.axis.types.Year(2000)));
// TBD - validate results
}
public void test76TypeTestMethodMonth() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.Month value = null;
value = binding.methodMonth(new org.apache.axis.types.Month(1), new org.apache.axis.holders.MonthHolder(new org.apache.axis.types.Month(1)));
// TBD - validate results
}
public void test77TypeTestMethodDay() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.Day value = null;
value = binding.methodDay(new org.apache.axis.types.Day(1), new org.apache.axis.holders.DayHolder(new org.apache.axis.types.Day(1)));
// TBD - validate results
}
public void test78TypeTestMethodYearMonth() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.YearMonth value = null;
value = binding.methodYearMonth(new org.apache.axis.types.YearMonth(2000,1), new org.apache.axis.holders.YearMonthHolder(new org.apache.axis.types.YearMonth(2000,1)));
// TBD - validate results
}
public void test79TypeTestMethodMonthDay() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
org.apache.axis.types.MonthDay value = null;
value = binding.methodMonthDay(new org.apache.axis.types.MonthDay(1, 1), new org.apache.axis.holders.MonthDayHolder(new org.apache.axis.types.MonthDay(1, 1)));
// TBD - validate results
}
public void test80TypeTestMethodSoapString() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.String value = null;
value = binding.methodSoapString(new java.lang.String(), new javax.xml.rpc.holders.StringHolder(new java.lang.String()));
// TBD - validate results
}
public void test81TypeTestMethodSoapBoolean() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Boolean value = null;
value = binding.methodSoapBoolean(new java.lang.Boolean(false), new javax.xml.rpc.holders.BooleanWrapperHolder(new java.lang.Boolean(false)));
// TBD - validate results
}
public void test82TypeTestMethodSoapFloat() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Float value = null;
value = binding.methodSoapFloat(new java.lang.Float(0), new javax.xml.rpc.holders.FloatWrapperHolder(new java.lang.Float(0)));
// TBD - validate results
}
public void test83TypeTestMethodSoapDouble() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Double value = null;
value = binding.methodSoapDouble(new java.lang.Double(0), new javax.xml.rpc.holders.DoubleWrapperHolder(new java.lang.Double(0)));
// TBD - validate results
}
public void test84TypeTestMethodSoapDecimal() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.math.BigDecimal value = null;
value = binding.methodSoapDecimal(new java.math.BigDecimal(0), new javax.xml.rpc.holders.BigDecimalHolder(new java.math.BigDecimal(0)));
// TBD - validate results
}
public void test85TypeTestMethodSoapInt() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Integer value = null;
value = binding.methodSoapInt(new java.lang.Integer(0), new javax.xml.rpc.holders.IntegerWrapperHolder(new java.lang.Integer(0)));
// TBD - validate results
}
public void test86TypeTestMethodSoapShort() throws Exception {
test.wsdl.types.comprehensive_service.TypeTestBindingStub binding;
try {
TypeTestServiceLocator loc = new TypeTestServiceLocator();
binding = (TypeTestBindingStub)loc.getTypeTest(HttpTestUtil.getTestEndpoint(loc.getTypeTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
java.lang.Short value = null;
value = binding.methodSoapShort(new java.lang.Short((short)0), new javax.xml.rpc.holders.ShortWrapperHolder(new java.lang.Short((short)0)));
// TBD - validate results
}
}
| 6,577 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/refattr/RefTestServiceTestCase.java | /**
* RefTestServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter, and
* then modified by Rich Scheuerle to add testcase info.
*/
package test.wsdl.refattr;
import org.apache.axis.utils.ClassUtils;
import test.HttpTestUtil;
public class RefTestServiceTestCase extends junit.framework.TestCase {
public RefTestServiceTestCase(String name) {
super(name);
}
public void testRefTest() throws Exception {
test.wsdl.refattr.RefTest binding;
try {
RefTestServiceLocator loc = new RefTestServiceLocator();
binding = new RefTestServiceLocator().getRefTest(HttpTestUtil.getTestEndpoint(loc.getRefTestAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre );
}
// The following declarations are used to verify that unmangled classes
// are generated by Wsdl2Java (not a mangled class like Phone_Type).
Info info = new Info();
Phone phone = new Phone();
phone.setAreaCode(51);
phone.setExchange("555");
phone.setNumber(new PhoneNumber());
info.setPhone(new Phone[] { phone });
Enum en = Enum.fromValue("one");
info.setEnum(en);
Forward forward = new Forward();
forward.setAddress("test");
info.setForward(forward);
NoMangle noMangle = new NoMangle();
noMangle.setAddress("test");
info.setNoMangle2(noMangle);
Example example = new Example();
example.setAddress("test");
example.setNumber(new ExampleNumber());
info.setNoMangle(example);
// The following code ensures that mangling occurred for the Mangle class
// Mangle_Type mangle_type = new Mangle_Type();
// TODO: Right now wsdl2java only changes the class name for the element, not the type.
// The JAX-RPC spec doen't clearly say if all class names need to be changed or if
// one of the conflicting classes can retain its original name.
Mangle mangle_type = new Mangle();
// JAX-RPC 1.1 specifies "_Element" as suffix
Mangle_Element mangle_element = new Mangle_Element();
mangle_element.setTwo("test");
info.setMangle(mangle_element);
// try {
// Class cls = ClassUtils.forName("test.wsdl.refattr.Mangle");
// assertTrue("Found unmangled class test.wsdl.refattr.Mangle", false);
// } catch (Exception e) {
// // Okay expect to get an exception
// }
assertTrue("binding is null", binding != null);
try {
binding.test(info);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
}
}
| 6,578 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/echo/ComplexEchoServiceTestCase.java | /**
* ComplexEchoServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.echo;
import test.HttpTestUtil;
public class ComplexEchoServiceTestCase extends junit.framework.TestCase {
public ComplexEchoServiceTestCase(String name) {
super(name);
}
public void testComplexEchoServiceWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.echo.ComplexEchoServiceLocator().getComplexEchoServiceAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.echo.ComplexEchoServiceLocator().getServiceName());
assertTrue(service != null);
}
public void test1ComplexEchoServiceEcho() throws Exception {
test.wsdl.echo.Echo binding;
try {
ComplexEchoServiceLocator loc = new ComplexEchoServiceLocator();
binding = loc.getComplexEchoService(HttpTestUtil.getTestEndpoint(loc.getComplexEchoServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
test.wsdl.echo.MyComplexType complexType = new test.wsdl.echo.MyComplexType();
test.wsdl.echo.holders.MyComplexTypeHolder complexTypeHolder =
new test.wsdl.echo.holders.MyComplexTypeHolder(complexType);
binding.echo(complexTypeHolder);
assertTrue(complexTypeHolder.value.getSimpleItem().equals("MY_SIMPLE_ITEM"));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test2ComplexEchoServiceEcho2() throws Exception {
test.wsdl.echo.ComplexEchoServiceSoapBindingStub binding;
try {
ComplexEchoServiceLocator loc = new ComplexEchoServiceLocator();
binding = (ComplexEchoServiceSoapBindingStub)loc.getComplexEchoService(HttpTestUtil.getTestEndpoint(loc.getComplexEchoServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if (jre.getLinkedCause() != null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
test.wsdl.echo.MyComplexType2 request = new test.wsdl.echo.MyComplexType2();
request.setUsername("xxx");
request.setPassword("yyy");
request.setOptions(new NamedValue[]{
new NamedValue("dummy1", "dummy_val1"),
new NamedValue("dummy2",
new NamedValueSet (new NamedValue[]{
new NamedValue("dummy2-1", "val2-1"),
new NamedValue("dummy2-2", new Integer(314))
}))
});
// Test operation
test.wsdl.echo.NamedValue[] value = null;
value = binding.echo2(request);
// TBD - validate results
}
public void test2ComplexEchoServiceEcho21() throws Exception {
test.wsdl.echo.ComplexEchoServiceSoapBindingStub binding;
try {
ComplexEchoServiceLocator loc = new ComplexEchoServiceLocator();
binding = (ComplexEchoServiceSoapBindingStub)loc.getComplexEchoService(HttpTestUtil.getTestEndpoint(loc.getComplexEchoServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if (jre.getLinkedCause() != null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
test.wsdl.echo.MyComplexType2 request = new test.wsdl.echo.MyComplexType2();
request.setUsername("xxx");
request.setPassword("yyy");
request.setOptions(new NamedValue[]{
new NamedValue("dummy1", "dummy_val1"),
new NamedValue("dummy2", new NamedValue[]{
new NamedValue("dummy2-1", "val2-1"),
new NamedValue("dummy2-2", new Integer(314))
})
});
// Test operation
test.wsdl.echo.NamedValue[] value = null;
value = binding.echo2(request);
// TBD - validate results
}
}
| 6,579 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/echo/ComplexEchoServiceSoapBindingImpl.java | /**
* ComplexEchoServiceSoapBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.echo;
public class ComplexEchoServiceSoapBindingImpl implements Echo{
public void echo(test.wsdl.echo.holders.MyComplexTypeHolder myElement) throws java.rmi.RemoteException {
myElement.value.setSimpleItem("MY_SIMPLE_ITEM");
}
public test.wsdl.echo.NamedValue[] echo2(test.wsdl.echo.MyComplexType2 options) throws java.rmi.RemoteException {
return options.getOptions();
}
}
| 6,580 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multiref/MultiRefTestSOAPBindingImpl.java | /*
* Copyright 2000,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.multiref;
/**
* MultiRefTestSOAPBindingImpl.java
*
* @author Rich Scheuerle (scheu@us.ibm.com)
*/
public class MultiRefTestSOAPBindingImpl implements test.wsdl.multiref.MultiRefTest {
/**
* Tests for the following arrangement of nodes:
* 0
* / \
* 1 2
*/
public int testSimpleTree(test.wsdl.multiref.holders.NodeHolder root) throws java.rmi.RemoteException {
Node t = root.value; // Root of tree
Node l = t.getLeft(); // Left side
Node r = t.getRight(); // Right side
if (t != null && l != null && r != null &&
r != l &&
l.getLeft() == null &&
l.getRight()== null &&
r.getLeft() == null &&
r.getRight()== null)
return 0; // Great
return 1; // Bad
}
/**
* Tests for the following arrangement of nodes:
* 0
* / \
* 1 2
* \ /
* 3
*/
public int testDiamond(test.wsdl.multiref.holders.NodeHolder root) throws java.rmi.RemoteException {
Node t = root.value; // Root of tree
Node l = t.getLeft(); // Left side
Node r = t.getRight(); // Right side
if (t != null && l != null && r != null &&
r != l &&
l.getLeft() == null &&
r.getRight()== null &&
l.getRight()!= null &&
l.getRight()== r.getLeft())
return 0; // Great
return 1; // Bad
}
/**
* Tests for the following arrangement of nodes:
* 0
* / \
* 1 2 and the children of 1 & 2 are backward references to 0
*/
public int testLoop(test.wsdl.multiref.holders.NodeHolder root) throws java.rmi.RemoteException {
Node t = root.value; // Root of tree
Node l = t.getLeft(); // Left side
Node r = t.getRight(); // Right side
if (t != null && l != null && r != null &&
r != l &&
l.getLeft() == t &&
l.getRight()== t &&
r.getLeft() == t &&
r.getRight()== t)
return 0; // Great
return 1; // Bad
}
/**
* Tests for the following arrangement of nodes:
* 0
* and the children of 0 are backward references to 0
*/
public int testSelfRef(test.wsdl.multiref.holders.NodeHolder root) throws java.rmi.RemoteException {
Node t = root.value; // Root of tree
Node l = t.getLeft(); // Left side
Node r = t.getRight(); // Right side
if (t != null && l != null && r != null &&
t == l && t == r)
return 0; // Great
return 1; // Bad
}
/**
* Tests that both arguments are the same node & the nodes don't have children
*/
public int testSameArgs(test.wsdl.multiref.holders.NodeHolder root1,test.wsdl.multiref.holders.NodeHolder root2)
throws java.rmi.RemoteException {
Node t1 = root1.value; // Root1 of tree
Node t2 = root2.value; // Root2 of tree
if (t1 != null && t2 != null &&
t1 == t2 &&
t1.getRight() == null &&
t1.getLeft() == null)
return 0; // Great
return 1; // Bad
}
/**
* Tests for the following arrangement of nodes:
* 0 1
* \ /
* 2 where 0 and 1 are the argument nodes.
*/
public int testArgsRefSameNode(test.wsdl.multiref.holders.NodeHolder root1,test.wsdl.multiref.holders.NodeHolder root2)
throws java.rmi.RemoteException {
Node t1 = root1.value; // Root1 of tree
Node t2 = root2.value; // Root2 of tree
if (t1 != null && t2 != null &&
t1 != t2 &&
t1.getLeft() == null &&
t2.getRight() == null &&
t1.getRight() != null &&
t1.getRight() == t2.getLeft() &&
t1.getRight().getRight() == null &&
t1.getRight().getLeft() == null)
return 0; // Great
return 1; // Bad
}
/**
* Tests for two node arguments that reference each other.
*/
public int testArgsRefEachOther(test.wsdl.multiref.holders.NodeHolder root1,test.wsdl.multiref.holders.NodeHolder root2)
throws java.rmi.RemoteException {
Node t1 = root1.value; // Root1 of tree
Node t2 = root2.value; // Root2 of tree
if (t1 != null && t2 != null &&
t1 != t2 &&
t1.getLeft() == t2 &&
t1.getRight() == t2 &&
t2.getLeft() == t1 &&
t2.getRight() == t1)
return 0; // Great
return 1; // Bad
}
}
| 6,581 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multiref/Main.java | /*
* Copyright 2000,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.multiref;
import org.apache.axis.utils.Options;
import test.HttpTestUtil;
import test.wsdl.multiref.holders.NodeHolder;
import java.net.URL;
/**
* This class shows/tests how multi-referenced objects are preserved.
*
* @author Rich Scheuerle (scheu@us.ibm.com)
*/
public class Main {
public static void main (String[] args) throws Exception {
Options opts = new Options(args);
MultiRefTestService service = new MultiRefTestServiceLocator();
opts.setDefaultURL(HttpTestUtil.getTestEndpoint(service.getMultiRefTestAddress()).toString());
URL serviceURL = new URL(opts.getURL());
if (serviceURL == null)
serviceURL = new URL(service.getMultiRefTestAddress());
MultiRefTest remoteTest = service.getMultiRefTest(serviceURL);
// ----------------------
// Create a simple tree
Node t = new Node();
t.setData(0);
Node l = new Node();
l.setData(1);
Node r = new Node();
r.setData(2);
t.setLeft(l);
t.setRight(r);
NodeHolder holder = new NodeHolder(t);
// Test for simple tree
int rc = remoteTest.testSimpleTree(holder);
if (rc == 0) {
// System.err.println("Passed testSimpleTree 1");
} else {
System.err.println("Failed testSimpleTree 1");
throw new Exception("Failed testSimpleTree 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testSimpleTree(holder);
if (rc == 0) {
// System.err.println("Passed testSimpleTree 2");
} else {
System.err.println("Failed testSimpleTree 2");
throw new Exception("Failed testSimpleTree 2 with "+rc);
}
// ----------------------
// Create a diamond
t = new Node();
t.setData(0);
l = new Node();
l.setData(1);
r = new Node();
r.setData(2);
t.setLeft(l);
t.setRight(r);
Node d = new Node();
d.setData(3);
t.getLeft().setRight(d);
t.getRight().setLeft(d);
holder = new NodeHolder(t);
// Test for a diamond
rc = remoteTest.testDiamond(holder);
if (rc == 0) {
// System.err.println("Passed testDiamond 1");
} else {
System.err.println("Failed testDiamond 1");
throw new Exception("Failed testDiamond 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testDiamond(holder);
if (rc == 0) {
// System.err.println("Passed testDiamond 2");
} else {
System.err.println("Failed testDiamond 2");
throw new Exception("Failed testDiamond 2 with "+rc);
}
// ----------------------
// Create a 'loop' tree. The children of the root have children that reference the root.
t = new Node();
t.setData(0);
l = new Node();
l.setData(1);
r = new Node();
r.setData(2);
t.setLeft(l);
t.setRight(r);
l.setLeft(t);
l.setRight(t);
r.setLeft(t);
r.setRight(t);
holder = new NodeHolder(t);
// Test for loops
rc = remoteTest.testLoop(holder);
if (rc == 0) {
// System.err.println("Passed testLoop 1");
} else {
System.err.println("Failed testLoop 1");
throw new Exception("Failed testLoop 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testLoop(holder);
if (rc == 0) {
// System.err.println("Passed testLoop 2");
} else {
System.err.println("Failed testLoop 2");
throw new Exception("Failed testLoop 2 with "+rc);
}
// ----------------------
// Create a 'loop' tree. The children of the root have children that reference the root.
// In this test both children have the same data (thus the same equals()).
// There should still be separate nodes passed over the wire
t = new Node();
t.setData(0);
l = new Node();
l.setData(1);
r = new Node();
r.setData(1);
t.setLeft(l);
t.setRight(r);
l.setLeft(t);
l.setRight(t);
r.setLeft(t);
r.setRight(t);
holder = new NodeHolder(t);
// Test for loops
rc = remoteTest.testLoop(holder);
if (rc == 0) {
// System.err.println("Passed testLoop 1B");
} else {
System.err.println("Failed testLoop 1B");
throw new Exception("Failed testLoop 1B with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testLoop(holder);
if (rc == 0) {
// System.err.println("Passed testLoop 2B");
} else {
System.err.println("Failed testLoop 2B");
throw new Exception("Failed testLoop 2B with "+rc);
}
// ----------------------
// Test passing of the same node argument.
t = new Node();
t.setData(0);
NodeHolder holder1 = new NodeHolder(t);
NodeHolder holder2 = new NodeHolder(t);
// Test
rc = remoteTest.testSameArgs(holder1, holder2);
if (rc == 0) {
// System.err.println("Passed testSameArgs 1");
} else {
System.err.println("Failed testSameArgs 1");
throw new Exception("Failed testSameArgs 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testSameArgs(holder1,holder2);
if (rc == 0) {
// System.err.println("Passed testSameArgs 2");
} else {
System.err.println("Failed testSameArgs 2");
throw new Exception("Failed testSameArgs 2 with "+rc);
}
// ----------------------
// Test args referencing same node.
Node t1 = new Node();
t1.setData(0);
Node t2 = new Node();
t2.setData(1);
Node s = new Node();
s.setData(1);
t1.setRight(s);
t2.setLeft(s);
holder1 = new NodeHolder(t1);
holder2 = new NodeHolder(t2);
// Test
rc = remoteTest.testArgsRefSameNode(holder1, holder2);
if (rc == 0) {
// System.err.println("Passed testArgsRefSameNode 1");
} else {
System.err.println("Failed testArgsRefSameNode 1");
throw new Exception("Failed testArgsRefSameNode 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testArgsRefSameNode(holder1,holder2);
if (rc == 0) {
// System.err.println("Passed testArgsRefSameNode 2");
} else {
System.err.println("Failed testArgsRefSameNode 2");
throw new Exception("Failed testArgsRefSameNode 2 with "+rc);
}
// ----------------------
// Test args referencing each other.
t1 = new Node();
t1.setData(0);
t2 = new Node();
t2.setData(1);
t2.setLeft(t1);
t2.setRight(t1);
t1.setRight(t2);
t1.setLeft(t2);
holder1 = new NodeHolder(t1);
holder2 = new NodeHolder(t2);
// Test
rc = remoteTest.testArgsRefEachOther(holder1, holder2);
if (rc == 0) {
// System.err.println("Passed testArgsRefEachOther 1");
} else {
System.err.println("Failed testArgsRefEachOther 1");
throw new Exception("Failed testArgsRefEachOther 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testArgsRefEachOther(holder1,holder2);
if (rc == 0) {
// System.err.println("Passed testArgsRefEachOther 2");
} else {
System.err.println("Failed testArgsRefEachOther 2");
throw new Exception("Failed testArgsRefEachOther 2 with "+rc);
}
// ----------------------
// Create self referencing node
t = new Node();
t.setData(0);
t.setLeft(t);
t.setRight(t);
holder = new NodeHolder(t);
// Self-Ref Test
rc = remoteTest.testSelfRef(holder);
if (rc == 0) {
// System.err.println("Passed testSelfRef 1");
} else {
System.err.println("Failed testSelfRef 1");
throw new Exception("Failed testSelfRef 1 with "+rc);
}
// Test returns the tree. To make sure it returned it successfully,
// invoke the test again!
rc = remoteTest.testSelfRef(holder);
if (rc == 0) {
// System.err.println("Passed testSelfRef 2");
} else {
System.err.println("Failed testSelfRef 2");
throw new Exception("Failed testSelfRef 2 with "+rc);
}
return;
}
}
| 6,582 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multiref/MultiRefTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.multiref;
import junit.framework.TestCase;
/** Test the multiref sample code.
*/
public class MultiRefTestCase extends TestCase {
public MultiRefTestCase(String name) {
super(name);
}
public void doTest () throws Exception {
String[] args = {};
test.wsdl.multiref.Main.main(args);
}
public void testMultiRefService () throws Exception {
try {
doTest();
}
catch( Exception e ) {
e.printStackTrace();
throw new Exception("Fault returned from test: "+e);
}
}
}
| 6,583 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/extension/PlanWSTestCase.java | /**
* PlanWSTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.extension;
import test.HttpTestUtil;
public class PlanWSTestCase extends junit.framework.TestCase {
public PlanWSTestCase(java.lang.String name) {
super(name);
}
public void testPlanWSSoapWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.extension.PlanWSLocator().getPlanWSSoapAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.extension.PlanWSLocator().getServiceName());
assertTrue(service != null);
}
public void test1PlanWSSoapGetPlan() throws Exception {
test.wsdl.extension.PlanWSSoapStub binding;
try {
PlanWSLocator loc = new PlanWSLocator();
binding = (PlanWSSoapStub)loc.getPlanWSSoap(HttpTestUtil.getTestEndpoint(loc.getPlanWSSoapAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.extension.Plan value = null;
value = binding.getPlan();
// TBD - validate results
assertEquals(value.getDisposition().getCode(),"CODE #1");
assertEquals(value.getDisposition().getDescription(),"CODE #1 Description");
}
}
| 6,584 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/extension/PlanWSSoapImpl.java | /**
* PlanWSSoapImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.extension;
public class PlanWSSoapImpl implements test.wsdl.extension.PlanWSSoap{
public test.wsdl.extension.Plan getPlan() throws java.rmi.RemoteException {
test.wsdl.extension.Disposition disposition = new test.wsdl.extension.Disposition();
disposition.setCode("CODE #1");
disposition.setDescription("CODE #1 Description");
test.wsdl.extension.Plan plan = new test.wsdl.extension.Plan();
plan.setDisposition(disposition);
return plan;
}
}
| 6,585 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/faults/FaultServiceSoapBindingImpl.java | /**
* FaultServiceSoapBindingImpl.java
*
* This service always returns an InvalidTcikerFault.
*
* Author: Tom Jordahl (tomj@macromedia.com)
*/
package test.wsdl.faults;
import org.apache.axis.message.MessageElement;
import org.apache.axis.utils.XMLUtils;
public class FaultServiceSoapBindingImpl implements test.wsdl.faults.FaultServicePortType {
public float getQuote(java.lang.String tickerSymbol) throws java.rmi.RemoteException, InvalidTickerFaultMessage {
throw new InvalidTickerFaultMessage(tickerSymbol);
}
public int throwFault(int a, java.lang.String b, float c) throws java.rmi.RemoteException, test.wsdl.faults.DerivedFault {
throw new DerivedFault2(a, b, c);
}
public int throwExtensionFault(java.lang.String description) throws java.rmi.RemoteException, test.wsdl.faults.ExtensionFault {
ExtensionType extension = new ExtensionType();
try {
extension.set_any(new MessageElement[] {new MessageElement(XMLUtils.newDocument().createElementNS(null,description))});
} catch (Exception e) {
throw new java.rmi.RemoteException(e.getMessage());
}
throw new ExtensionFault(extension);
}
}
| 6,586 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/faults/FaultServiceTestCase.java | /**
* FaultServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.faults;
import test.HttpTestUtil;
public class FaultServiceTestCase extends junit.framework.TestCase {
public FaultServiceTestCase(String name) {
super(name);
}
/* FIXME: RUNTIME WSDL broken.
public void testFaultServiceWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = new java.net.URL(new test.wsdl.faults.FaultServiceLocator().getFaultServiceAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.faults.FaultServiceLocator().getServiceName());
assertTrue(service != null);
}
*/
public void testFaultServiceGetQuote() throws Exception {
test.wsdl.faults.FaultServicePortType binding;
try {
FaultServiceLocator loc = new FaultServiceLocator();
binding = loc.getFaultService(HttpTestUtil.getTestEndpoint(loc.getFaultServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.
AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
String symbol = new String("MACR");
try {
float value = 0;
value = binding.getQuote(symbol);
fail("Should raise an InvalidTickerFault");
}
catch (InvalidTickerFaultMessage tickerFault) {
assertEquals("Ticker Symbol in Fault doesn't match original argument",
symbol, tickerFault.getTickerSymbol());
}
catch (org.apache.axis.AxisFault e) {
throw new junit.framework.
AssertionFailedError("AxisFault caught: " + e);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.
AssertionFailedError("Remote Exception caught: " + re );
}
}
public void testFaultServiceThrowFault() throws Exception {
test.wsdl.faults.FaultServicePortType binding;
try {
FaultServiceLocator loc = new FaultServiceLocator();
binding = loc.getFaultService(HttpTestUtil.getTestEndpoint(loc.getFaultServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.
AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
int a = 7;
String b = "test";
float c = 3.14F;
try {
float value = 0;
value = binding.throwFault(a,b,c);
fail("Should raise a DerivedFault");
}
// We are expecting DerivedFault2 (the operation indicates
// that it throws a DerivedFault, but we know the impl actually
// throws DerivedFault2 which extends DerivedFault)
catch (DerivedFault2 e) {
assertEquals("Param A in DerivedFault2 doesn't match original",
a, e.getA());
assertEquals("Param B in DerivedFault2 doesn't match original",
b, e.getB());
assertEquals("Param C in DerivedFault2 doesn't match original",
c, e.getC(), 0.01F);
}
catch (DerivedFault e) {
throw new junit.framework.
AssertionFailedError("DerivedFault caught: " + e);
}
catch (BaseFault e) {
throw new junit.framework.
AssertionFailedError("BaseFault caught: " + e);
}
}
public void testFaultServiceThrowExtensionFault() throws Exception {
test.wsdl.faults.FaultServicePortType binding;
try {
FaultServiceLocator loc = new FaultServiceLocator();
binding = loc.getFaultService(HttpTestUtil.getTestEndpoint(loc.getFaultServiceAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.
AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
String description = "test";
try {
int value = 0;
value = binding.throwExtensionFault(description);
fail("Should raise an ExtensionFault");
}
catch (ExtensionFault e) {
try {
assertEquals("ExtensionFault extension element does not match original",
description, e.getExtension().get_any()[0].getAsDOM().getTagName());
} catch (Exception domError) {
throw new junit.framework.
AssertionFailedError("DOM Exception caught: " + domError);
}
}
catch (org.apache.axis.AxisFault e) {
throw new junit.framework.
AssertionFailedError("AxisFault caught: " + e);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.
AssertionFailedError("Remote Exception caught: " + re );
}
}
}
| 6,587 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/parameterOrder/VerifyTestCase.java | package test.wsdl.parameterOrder;
import test.HttpTestUtil;
/**
* This class is taken from the generated TestCase. The generated test case is still generated
* to verify that the generated test case is always compilable. THIS test case exists
* because I know this is correct. If the generation of the bindings changes, it's likely that
* the generation of the TestCase will change as well, so we wouldn't know whether they changed
* for the worse if they all changed the same. This test case should fail to compile if generated
* stuff changed for the worse.
*/
public class VerifyTestCase extends junit.framework.TestCase {
public VerifyTestCase(String name) {
super(name);
}
public void testParameterOrder() throws Exception {
test.wsdl.parameterOrder.ParameterOrderTest binding;
try {
ParameterOrderServiceLocator loc = new ParameterOrderServiceLocator();
binding = loc.getParameterOrder(HttpTestUtil.getTestEndpoint(loc.getParameterOrderAddress()));
} catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.oneIn(0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.oneInout(new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.oneOut(new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInNoOrder(0, 0, 0, 0, 0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInoutNoOrder(new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveOutNoOrder(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveIn(0, 0, 0, 0, 0);
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveInout(new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fiveOut(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
int value = -3;
value = binding.someInoutPartialOrder1(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0));
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.someInoutPartialOrder2(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(0), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
binding.fourOutPartialOrder(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
try {
int value = -3;
value = binding.oneReturn(new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.IntHolder());
} catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re );
}
}
}
| 6,588 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/inout/InoutSOAPBindingImpl.java | package test.wsdl.inout;
import org.apache.axis.holders.DateHolder;
import test.wsdl.inout.holders.AddressHolder;
import test.wsdl.inout.holders.PhoneHolder;
import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.StringHolder;
import java.util.Date;
public class InoutSOAPBindingImpl implements Inout
{
public InoutSOAPBindingImpl() {
expectedAddress = new Address();
expectedPhone = new Phone();
expectedDate = new Date(2002-1900, 6, 23);
expectedAddress.setStreetNum(1);
expectedAddress.setStreetName("University Drive");
expectedAddress.setCity("West Lafayette");
expectedAddress.setState("IN");
expectedAddress.setZip(47907);
expectedPhone.setAreaCode(765);
expectedPhone.setExchange("494");
expectedPhone.setNumber("4900");
expectedAddress.setPhoneNumber(expectedPhone);
returnAddress = new Address();
returnPhone = new Phone();
returnDate = new Date(1998-1900, 3, 9);
returnAddress.setStreetNum(555);
returnAddress.setStreetName("Monroe Street");
returnAddress.setCity("Madison");
returnAddress.setState("WI");
returnAddress.setZip(54444);
returnPhone.setAreaCode(999);
returnPhone.setExchange("one");
returnPhone.setNumber("two");
returnAddress.setPhoneNumber(returnPhone);
}
private String printAddress (Address ad) {
String out;
if (ad == null)
out = "\t[ADDRESS NOT FOUND!]";
else
out ="\t" + ad.getStreetNum () + " " + ad.getStreetName () + "\n\t" + ad.getCity () + ", " + ad.getState () + " " + ad.getZip () + "\n\t" + printPhone (ad.getPhoneNumber ());
return out;
}
private String printPhone (Phone ph)
{
String out;
if (ph == null)
out = "[PHONE NUMBER NOT FOUND!}";
else
out ="Phone: (" + ph.getAreaCode () + ") " + ph.getExchange () + "-" + ph.getNumber ();
return out;
}
public boolean equals (Address a1, Address a2)
{
try
{
return a1.getStreetNum() == a2.getStreetNum() && a1.getZip() == a2.getZip() && equals (a1.getPhoneNumber(), a2.getPhoneNumber()) && ((a1.getStreetName() == null && a2.getStreetName() == null) || a1.getStreetName().equals (a2.getStreetName())) && ((a1.getCity() == null && a2.getCity() == null) || a1.getCity().equals (a2.getCity())) && ((a1.getState() == null && a2.getState() == null) || a1.getState().equals (a2.getState()));
}
catch (Throwable t)
{
return false;
}
}
public boolean equals (Phone p1, Phone p2)
{
try
{
return p1.getAreaCode() == p2.getAreaCode() && ((p1.getExchange() == null && p2.getExchange() == null) || p1.getExchange().equals (p2.getExchange())) && ((p1.getNumber() == null && p2.getNumber() == null) || p1.getNumber().equals (p2.getNumber()));
}
catch (Throwable t)
{
return false;
}
}
private Phone expectedPhone;
private Address expectedAddress;
private Date expectedDate;
private int expectedNumber = 99;
private Phone returnPhone;
private Address returnAddress;
private Date returnDate;
private int returnNumber = 66;
public void out0Inout0In0 () throws org.apache.axis.AxisFault, TestFailed
{
}
public void out0Inout0In1 (String name) throws org.apache.axis.AxisFault, TestFailed
{
if (!"out0Inout0In1".equals (name))
{
System.err.println ("Test failure: out0Inout0In1");
System.err.println ("expected name = out0Inout0In1");
System.err.println ("actual name = " + name);
throw new TestFailed ();
}
}
public void out0Inout0InMany (String name, Address address) throws org.apache.axis.AxisFault, TestFailed
{
if (!"out0Inout0InMany".equals (name) || !equals (address, expectedAddress))
{
System.err.println ("Test failure: out0Inout0InMany");
System.err.println ("expected name = out0Inout0InMany");
System.err.println ("actual name = " + name);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
throw new TestFailed ();
}
}
public void out0Inout1In0 (PhoneHolder phone) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone.value, expectedPhone))
phone.value = returnPhone;
else
{
System.err.println ("Test failure: out0Inout1In0");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone.value));
throw new TestFailed ();
}
}
public void out0Inout1In1 (StringHolder name, Address address) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (address, expectedAddress) && "out0Inout1In1".equals (name.value))
name.value = name.value + " yo ho ho!";
else
{
System.err.println ("Test failure: out0Inout1In1");
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected name = out0Inout1In1");
System.err.println ("actual name = " + name.value);
throw new TestFailed ();
}
}
public void out0Inout1InMany (String name, Address address, PhoneHolder phone) throws org.apache.axis.AxisFault, TestFailed
{
if ("out0Inout1InMany".equals (name) && equals (address, expectedAddress) && equals (phone.value, expectedPhone))
phone.value = returnPhone;
else
{
System.err.println ("Test failure: out0Inout1InMany");
System.err.println ("expected name = out0Inout1InMany");
System.err.println ("actual name = " + name);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone.value));
throw new TestFailed ();
}
}
public void out0InoutManyIn0 (StringHolder name, AddressHolder address) throws org.apache.axis.AxisFault, TestFailed
{
if ("out0InoutManyIn0".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
}
else
{
System.err.println ("Test failure: out0InoutManyIn0");
System.err.println ("expected name = out0InoutManyIn0");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void out0InoutManyIn1 (StringHolder name, AddressHolder address, Phone phone) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && "out0InoutManyIn1".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
}
else
{
System.err.println ("Test failure: out0InoutManyIn1");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected name = out0InoutManyIn1");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void out0InoutManyInMany (StringHolder name, AddressHolder address, Phone phone, int number) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && expectedNumber == number && "out0InoutManyInMany".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
}
else
{
System.err.println ("Test failure: out0InoutManyInMany");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected number = " + expectedNumber);
System.err.println ("actual number = " + number);
System.err.println ("expected name = out0InoutManyInMany");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public int out1Inout0In0 () throws org.apache.axis.AxisFault, TestFailed
{
return returnNumber;
}
public int out1Inout0In1 (String name) throws org.apache.axis.AxisFault, TestFailed
{
if ("out1Inout0In1".equals (name))
{
return returnNumber;
}
else
{
System.err.println ("Test failure: out1Inout0In1");
System.err.println ("expected name = out1Inout0In1");
System.err.println ("actual name = " + name);
throw new TestFailed ();
}
}
public int out1Inout0InMany (String name, Address address) throws org.apache.axis.AxisFault, TestFailed
{
if ("out1Inout0InMany".equals (name) && equals (address, expectedAddress))
{
return returnNumber;
}
else
{
System.err.println ("Test failure: out1Inout0InMany");
System.err.println ("expected name = out1Inout0InMany");
System.err.println ("actual name = " + name);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
throw new TestFailed ();
}
}
public Address out1Inout1In0 (StringHolder name) throws org.apache.axis.AxisFault, TestFailed
{
if ("out1Inout1In0".equals (name.value))
{
name.value = name.value + " yo ho ho!";
return returnAddress;
}
else
{
System.err.println ("Test failure: out1Inout1In0");
System.err.println ("expected name = out1Inout1In0");
System.err.println ("actual name = " + name.value);
throw new TestFailed ();
}
}
public String out1Inout1In1 (StringHolder name, Address address) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (address, expectedAddress) && "out1Inout1In1".equals (name.value))
{
name.value = name.value + " yo ho ho!";
return "out1Inout1In1 arghhh!";
}
else
{
System.err.println ("Test failure: out1Inout1In1");
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected name = out1Inout1In1");
System.err.println ("actual name = " + name.value);
throw new TestFailed ();
}
}
public String out1Inout1InMany (StringHolder name, Address address, Phone phone) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (address, expectedAddress) && equals (phone, expectedPhone) && "out1Inout1InMany".equals (name.value))
{
name.value = name.value + " yo ho ho!";
return "out1Inout1InMany arghhh!";
}
else
{
System.err.println ("Test failure: out1Inout1InMany");
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected name = out1Inout1InMany");
System.err.println ("actual name = " + name.value);
throw new TestFailed ();
}
}
public String out1InoutManyIn0 (StringHolder name, AddressHolder address) throws org.apache.axis.AxisFault, TestFailed
{
if ("out1InoutManyIn0".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
return "out1InoutManyIn0 arghhh!";
}
else
{
System.err.println ("Test failure: out1InoutManyIn0");
System.err.println ("expected name = out1InoutManyIn0");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public String out1InoutManyIn1 (StringHolder name, AddressHolder address, Phone phone) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && "out1InoutManyIn1".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
return "out1InoutManyIn1 arghhh!";
}
else
{
System.err.println ("Test failure: out1InoutManyIn1");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected name = out1InoutManyIn1");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public String out1InoutManyInMany (StringHolder name, AddressHolder address, Phone phone, int number) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && expectedNumber == number && "out1InoutManyInMany".equals (name.value) && equals (address.value, expectedAddress))
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
return "out1InoutManyInMany arghhh!";
}
else
{
System.err.println ("Test failure: out1InoutManyInMany");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected number = " + expectedNumber);
System.err.println ("actual number = " + number);
System.err.println ("expected name = out1InoutManyInMany");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void outManyInout0In0 (StringHolder name, AddressHolder address) throws org.apache.axis.AxisFault, TestFailed
{
if (name.value == null && address.value == null) {
name.value = " arghhh!";
address.value = returnAddress;
}
else
throw new TestFailed ();
}
public void outManyInout0In1 (String name, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout0In1".equals (name) && otherName.value == null)
{
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInout0In1");
System.err.println ("expected name = outManyInout0In1");
System.err.println ("actual name = " + name);
throw new TestFailed ();
}
}
public void outManyInout0InMany (String name, Address address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout0InMany".equals (name) && equals (address, expectedAddress) && otherName.value == null)
{
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInout0InMany");
System.err.println ("expected name = outManyInout0InMany");
System.err.println ("actual name = " + name);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
throw new TestFailed ();
}
}
public void outManyInout1In0 (StringHolder name, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout1In0".equals (name.value) && otherName.value == null)
{
number.value = returnNumber;
name.value = name.value + " yo ho ho!";
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInout1In0");
System.err.println ("expected name = outManyInout1In0");
System.err.println ("actual name = " + name.value);
throw new TestFailed ();
}
}
public void outManyInout1In1 (StringHolder name, Address address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (address, expectedAddress) && "outManyInout1In1".equals (name.value) && otherName.value == null)
{
number.value = returnNumber;
name.value = name.value + " yo ho ho!";
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInout1In1");
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected name = out1InoutManyInMany");
System.err.println ("actual name = " + name.value);
System.err.println ("expected otherName = null");
System.err.println ("actual otherName = " + otherName.value);
throw new TestFailed ();
}
}
public void outManyInout1InMany (String name, Address address, PhoneHolder phone, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInout1InMany".equals (name) && equals (address, expectedAddress) && equals (phone.value, expectedPhone) && otherName.value == null)
{
phone.value = returnPhone;
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInout1InMany");
System.err.println ("expected name = outManyInout1InMany");
System.err.println ("actual name = " + name);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address));
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone.value));
throw new TestFailed ();
}
}
public void outManyInoutManyIn0 (StringHolder name, AddressHolder address, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if ("outManyInoutManyIn0".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInoutManyIn0");
System.err.println ("expected name = outManyInoutManyIn0");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void outManyInoutManyIn1 (StringHolder name, AddressHolder address, Phone phone, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && "outManyInoutManyIn1".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInoutManyIn1");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected name = out1InoutManyInMany");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void outManyInoutManyInMany (StringHolder name, AddressHolder address, Phone phone, int otherNumber, IntHolder number, StringHolder otherName) throws org.apache.axis.AxisFault, TestFailed
{
if (equals (phone, expectedPhone) && expectedNumber == otherNumber && "outManyInoutManyInMany".equals (name.value) && equals (address.value, expectedAddress) && otherName.value == null)
{
name.value = name.value + " yo ho ho!";
address.value = returnAddress;
number.value = returnNumber;
otherName.value = " yo ho ho!";
}
else
{
System.err.println ("Test failure: outManyInoutManyInMany");
System.err.println ("expected phone = " + printPhone (expectedPhone));
System.err.println ("actual phone = " + printPhone (phone));
System.err.println ("expected number = " + expectedNumber);
System.err.println ("actual number = " + otherNumber);
System.err.println ("expected name = outManyInoutManyInMany");
System.err.println ("actual name = " + name.value);
System.err.println ("expected address =\n" + printAddress (expectedAddress));
System.err.println ("actual address =\n" + printAddress (address.value));
throw new TestFailed ();
}
}
public void dateInout (DateHolder dateHolder) throws org.apache.axis.AxisFault, TestFailed
{
Date inDate = dateHolder.value;
if (inDate.equals(expectedDate))
{
dateHolder.value = returnDate;
} else {
System.err.println ("Test failure: dateInout");
System.err.println ("expected Date = " + expectedDate);
System.err.println ("actual Date = " + inDate);
throw new TestFailed ();
}
}
}
| 6,589 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/inout/DetailedInoutTestCase.java | package test.wsdl.inout;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.axis.holders.DateHolder;
import test.HttpTestUtil;
import test.wsdl.inout.holders.AddressHolder;
import test.wsdl.inout.holders.PhoneHolder;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.holders.IntHolder;
import javax.xml.rpc.holders.StringHolder;
import java.util.Date;
/**
* This class shows how to use the ServiceClient's ability to
* become session aware.
*
* @author Rob Jellinghaus (robj@unrealities.com)
* @author Sanjiva Weerawarana <sanjiva@watson.ibm.com>
*/
public class DetailedInoutTestCase extends TestCase
{
private static Inout io;
public DetailedInoutTestCase(String name) {
super(name);
expectedAddress = new Address();
expectedPhone = new Phone();
expectedDate = new Date(2002-1900, 6, 23);
expectedAddress.setStreetNum(1);
expectedAddress.setStreetName("University Drive");
expectedAddress.setCity("West Lafayette");
expectedAddress.setState("IN");
expectedAddress.setZip(47907);
expectedPhone.setAreaCode(765);
expectedPhone.setExchange("494");
expectedPhone.setNumber("4900");
expectedAddress.setPhoneNumber(expectedPhone);
returnAddress = new Address();
returnPhone = new Phone();
returnDate = new Date(1998-1900, 3, 9);
returnAddress.setStreetNum(555);
returnAddress.setStreetName("Monroe Street");
returnAddress.setCity("Madison");
returnAddress.setState("WI");
returnAddress.setZip(54444);
returnPhone.setAreaCode(999);
returnPhone.setExchange("one");
returnPhone.setNumber("two");
returnAddress.setPhoneNumber(returnPhone);
try {
InoutServiceLocator loc = new InoutServiceLocator();
io = loc.getInoutService(HttpTestUtil.getTestEndpoint(loc.getInoutServiceAddress()));
}
catch (Exception jre) {
throw new AssertionFailedError("JAX-RPC ServiceException: " + jre);
}
}
private String printAddress (Address ad) {
String out;
if (ad == null)
out = "\t[ADDRESS NOT FOUND!]";
else
out ="\t" + ad.getStreetNum () + " " + ad.getStreetName () + "\n\t" + ad.getCity () + ", " + ad.getState () + " " + ad.getZip () + "\n\t" + printPhone (ad.getPhoneNumber ());
return out;
}
private String printPhone (Phone ph)
{
String out;
if (ph == null)
out = "[PHONE NUMBER NOT FOUND!]";
else
out ="Phone: (" + ph.getAreaCode () + ") " + ph.getExchange () + "-" + ph.getNumber ();
return out;
}
public boolean equals (Address a1, Address a2)
{
try
{
return a1.getStreetNum() == a2.getStreetNum() && a1.getZip() == a2.getZip() && equals (a1.getPhoneNumber(), a2.getPhoneNumber()) && ((a1.getStreetName() == null && a2.getStreetName() == null) || a1.getStreetName().equals (a2.getStreetName())) && ((a1.getCity() == null && a2.getCity() == null) || a1.getCity().equals (a2.getCity())) && ((a1.getState() == null && a2.getState() == null) || a1.getState().equals (a2.getState()));
}
catch (Throwable t)
{
return false;
}
}
public boolean equals (Phone p1, Phone p2)
{
try
{
return p1.getAreaCode() == p2.getAreaCode() && ((p1.getExchange() == null && p2.getExchange() == null) || p1.getExchange().equals (p2.getExchange())) && ((p1.getNumber() == null && p2.getNumber() == null) || p1.getNumber().equals (p2.getNumber()));
}
catch (Throwable t)
{
return false;
}
}
private Phone expectedPhone;
private Address expectedAddress;
private Date expectedDate;
private int expectedNumber = 99;
private Phone returnPhone;
private Address returnAddress;
private Date returnDate;
private int returnNumber = 66;
public void testOut0Inout0In0 ()
{
try
{
io.out0Inout0In0 ();
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout0In0: " + t.getMessage());
}
}
public void testOut0Inout0In1 ()
{
try
{
io.out0Inout0In1 ("out0Inout0In1");
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout0In1" + t.getMessage());
}
}
public void testOut0Inout0InMany ()
{
try
{
io.out0Inout0InMany ("out0Inout0InMany", expectedAddress);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout0InMany" + t.getMessage());
}
}
public void testOut0Inout1In0 ()
{
PhoneHolder ph = new PhoneHolder (expectedPhone);
try
{
io.out0Inout1In0 (ph);
assertTrue("out0Inout1In0 returned bad value", equals(ph.value, returnPhone));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout1In0\nexpected phone = "
+ printPhone (returnPhone) + "\nactual phone = "
+ printPhone (ph.value) + t.getMessage());
}
}
public void testOut0Inout1In1 ()
{
StringHolder sh = new StringHolder ("out0Inout1In1");
try
{
io.out0Inout1In1 (sh, expectedAddress);
assertEquals("StringHolder returned bad value", "out0Inout1In1 yo ho ho!", sh.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout1In1\nexpected string = out0Inout1In1 yo ho ho!\nactual string = "
+ sh.value + t.getMessage());
}
}
public void testOut0Inout1InMany ()
{
PhoneHolder ph = new PhoneHolder (expectedPhone);
try
{
io.out0Inout1InMany ("out0Inout1InMany", expectedAddress, ph);
assertTrue("out0Inout1InMany returned bad value", equals(ph.value, returnPhone));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0Inout1InMany\nexpected phone = "
+ printPhone (returnPhone) + "\nactual phone = "
+ printPhone (ph.value) + t.getMessage());
}
}
public void testOut0InoutManyIn0 ()
{
StringHolder sh = new StringHolder ("out0InoutManyIn0");
AddressHolder ah = new AddressHolder (expectedAddress);
try
{
io.out0InoutManyIn0 (sh, ah);
assertEquals("out0InoutManyIn0 yo ho ho!", sh.value);
assertTrue("out0InoutManyIn0 returned bad value", equals (ah.value, returnAddress));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0InoutManyIn0\nexpected string = out0InoutManyIn0 yo ho ho!\nactual string = "
+ sh.value + "\nexpected address =\n" + printAddress (returnAddress)
+ "\nactual address =\n" + printAddress (ah.value) + t.getMessage());
}
}
public void testOut0InoutManyIn1 ()
{
try
{
StringHolder sh = new StringHolder ("out0InoutManyIn1");
AddressHolder ah = new AddressHolder (expectedAddress);
io.out0InoutManyIn1 (sh, ah, expectedPhone);
assertEquals("out0InoutManyIn1 yo ho ho!", sh.value);
assertTrue("testOut0InoutManyIn1 returned bad value", equals (ah.value, returnAddress));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0InoutManyIn1\n" + t.getMessage());
}
}
public void testOut0InoutManyInMany ()
{
StringHolder sh = new StringHolder ("out0InoutManyInMany");
AddressHolder ah = new AddressHolder (expectedAddress);
try
{
io.out0InoutManyInMany (sh, ah, expectedPhone, expectedNumber);
assertEquals("out0InoutManyInMany yo ho ho!", sh.value);
assertTrue(equals (ah.value, returnAddress));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out0InoutManyInMany\nexpected string = out0InoutManyInMany yo ho ho!\nactual string = "
+ sh.value + "\nexpected address =\n" + printAddress (returnAddress)
+ "\nactual address =\n" + printAddress (ah.value) + t.getMessage());
}
}
public void testOut1Inout0In0 ()
{
int ret = 0;
try
{
ret = io.out1Inout0In0 ();
assertEquals("out1Inout0In0 returned wrong value", returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout0In0\nexpected number = "
+ returnNumber + "\nactual number = " + ret + t.getMessage());
}
}
public void testOut1Inout0In1 ()
{
int ret = 0;
try
{
ret = io.out1Inout0In1 ("out1Inout0In1");
assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout0In1\nexpected number = "
+ returnNumber + "\nactual number = " + ret + t.getMessage());
}
}
public void testOut1Inout0InMany ()
{
int ret = 0;
try
{
ret = io.out1Inout0InMany ("out1Inout0InMany", expectedAddress);
assertEquals(returnNumber, ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout0InMany\nexpected number = "
+ returnNumber + "\nactual number = " + ret + t.getMessage());
}
}
public void testOut1Inout1In0 ()
{
StringHolder sh = new StringHolder ("out1Inout1In0");
Address ret = null;
try
{
ret = io.out1Inout1In0 (sh);
assertEquals("out1Inout1In0 yo ho ho!", sh.value);
assertTrue(equals (ret, returnAddress));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout1In0\nexpected string = out1Inout1In0 yo ho ho!\nactual string = "
+ sh.value + "\nexpected address =\n" + printAddress (returnAddress)
+ "\nactual address =\n" + printAddress (ret) + t.getMessage());
}
}
public void testOut1Inout1In1 ()
{
StringHolder sh = new StringHolder ("out1Inout1In1");
String ret = null;
try
{
ret = io.out1Inout1In1 (sh, expectedAddress);
assertEquals("out1Inout1In1 yo ho ho!", sh.value);
assertEquals("out1Inout1In1 arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout1In1\nexpected string1 = out1Inout1In1 yo ho ho!\nactual string1 = "
+ sh.value + "\nexpected string2 = out1Inout1In1 arghhh!\nactual string2 = " + ret);
}
}
public void testOut1Inout1InMany ()
{
StringHolder sh = new StringHolder ("out1Inout1InMany");
String ret = null;
try
{
ret = io.out1Inout1InMany (sh, expectedAddress, expectedPhone);
assertEquals("out1Inout1InMany yo ho ho!", sh.value);
assertEquals("out1Inout1InMany arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1Inout1InMany\nexpected string1 = out1Inout1InMany yo ho ho!\nactual string1 = "
+ sh.value + "\nexpected string2 = out1Inout1InMany arghhh!\nactual string2 = " + ret + t.getMessage());
}
}
public void testOut1InoutManyIn0 ()
{
StringHolder sh = new StringHolder ("out1InoutManyIn0");
AddressHolder ah = new AddressHolder (expectedAddress);
String ret = null;
try
{
ret = io.out1InoutManyIn0 (sh, ah);
assertEquals("out1InoutManyIn0 yo ho ho!", sh.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals("out1InoutManyIn0 arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1InoutManyIn0\nexpected string1 = out1InoutManyIn0 yo ho ho!\nactual string1 = "
+ sh.value + "\nexpected address = " + printAddress (returnAddress)
+ "\nactual address = " + printAddress (ah.value)
+ "\nexpected string2 = out1InoutManyIn0 arghhh!\nactual string2 = " + ret + t.getMessage());
}
}
public void testOut1InoutManyIn1 ()
{
StringHolder sh = new StringHolder ("out1InoutManyIn1");
AddressHolder ah = new AddressHolder (expectedAddress);
String ret = null;
try
{
ret = io.out1InoutManyIn1 (sh, ah, expectedPhone);
assertEquals("out1InoutManyIn1 yo ho ho!", sh.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals("out1InoutManyIn1 arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1InoutManyIn1\nexpected string1 = out1InoutManyIn1 yo ho ho!\nactual string1 = "
+ sh.value + "\nexpected address = " + printAddress (returnAddress)
+ "\nactual address = " + printAddress (ah.value)
+ "\nexpected string2 = out1InoutManyIn1 arghhh!\nactual string2 = " + ret + t.getMessage());
}
}
public void testOut1InoutManyInMany ()
{
StringHolder sh = new StringHolder ("out1InoutManyInMany");
AddressHolder ah = new AddressHolder (expectedAddress);
String ret = null;
try
{
ret = io.out1InoutManyInMany (sh, ah, expectedPhone, expectedNumber);
assertEquals("out1InoutManyInMany yo ho ho!", sh.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals("out1InoutManyInMany arghhh!", ret);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: out1InoutManyInMany\nexpected string1 = out1InoutManyInMany yo ho ho!\nactual string1 = "
+ sh.value + "\nexpected address = " + printAddress (returnAddress)
+ "\nactual address = " + printAddress (ah.value)
+ "\nexpected string2 = out1InoutManyInMany arghhh!\nactual string2 = " + ret + t.getMessage());
}
}
public void testOutManyInout0In0 ()
{
StringHolder sh = new StringHolder("outManyInout0In0");
AddressHolder ah = new AddressHolder (expectedAddress);
try
{
io.outManyInout0In0 (sh, ah);
assertEquals (sh.value, " arghhh!");
assertTrue(equals (ah.value, returnAddress));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0In0\nexpected address = "
+ printAddress (returnAddress) + "\nactual address = "
+ printAddress (ah.value)
+ "\nexpected string = arghhh!\nactual string = "
+ sh.value + " " + t.getMessage());
}
}
public void testOutManyInout0In1 ()
{
IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
try
{
io.outManyInout0In1 ("outManyInout0In1", ih, sh);
assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0In1\nexpected string = yo ho ho!\nactual string = "
+ sh.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ih.value + " " + t.getMessage());
}
}
public void testOutManyInout0InMany ()
{
IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
try
{
io.outManyInout0InMany ("outManyInout0InMany", expectedAddress, ih, sh);
assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout0InMany\nexpected string = yo ho ho!\nactual string = "
+ sh.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ih.value + " " + t.getMessage());
}
}
public void testOutManyInout1In0 ()
{
StringHolder shinout = new StringHolder ("outManyInout1In0");
IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
try
{
io.outManyInout1In0 (shinout, ihout, shout);
assertEquals("outManyInout1In0 yo ho ho!", shinout.value);
assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1In0\nexpected string1 = outManyInout1In0 yo ho ho!\nactual string1 = "
+ shinout.value
+ "\nexpected string2 = yo ho ho!\nactual string2 = "
+ shout.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ihout.value + " "
+ t.getMessage());
}
}
public void testOutManyInout1In1 ()
{
StringHolder shinout = new StringHolder ("outManyInout1In1");
IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
try
{
io.outManyInout1In1 (shinout, expectedAddress, ihout, shout);
assertEquals("outManyInout1In1 yo ho ho!", shinout.value);
assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1In1\nexpected string1 = outManyInout1In1 yo ho ho!\nactual string = "
+ shinout.value
+ "\nexpected string2 = yo ho ho!\nactual string2 = "
+ shout.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ihout.value + " "
+ t.getMessage());
}
}
public void testOutManyInout1InMany ()
{
PhoneHolder ph = new PhoneHolder (expectedPhone);
IntHolder ih = new IntHolder();
StringHolder sh = new StringHolder ();
try
{
io.outManyInout1InMany ("outManyInout1InMany", expectedAddress, ph, ih, sh);
assertTrue(equals (ph.value, returnPhone));
assertEquals(returnNumber, ih.value);
assertEquals(" yo ho ho!", sh.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInout1InMany\nexpected phone = "
+ printPhone (returnPhone) + "\nactual phone = "
+ printPhone (ph.value)
+ "\nexpected string = yo ho ho!\nactual string = "
+ sh.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ih.value + " " + t.getMessage());
}
}
public void testOutManyInoutManyIn0 ()
{
StringHolder shinout = new StringHolder ("outManyInoutManyIn0");
AddressHolder ah = new AddressHolder (expectedAddress);
IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
try
{
io.outManyInoutManyIn0 (shinout, ah, ihout, shout);
assertEquals("outManyInoutManyIn0 yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyIn0\nexpected string1 = outManyInoutManyIn0 yo ho ho!\nactual string1 = "
+ shinout.value + "\nexpected address = "
+ printAddress (returnAddress) + "\nactual address = "
+ printAddress (ah.value)
+ "\nexpected string2 = yo ho ho!\nactual string2 = "
+ shout.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ihout.value + " "
+ t.getMessage());
}
}
public void testOutManyInoutManyIn1 ()
{
StringHolder shinout = new StringHolder ("outManyInoutManyIn1");
AddressHolder ah = new AddressHolder (expectedAddress);
IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
try
{
io.outManyInoutManyIn1 (shinout, ah, expectedPhone, ihout, shout);
assertEquals("outManyInoutManyIn1 yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyIn1\nexpected string1 = outManyInoutManyIn1 yo ho ho!\nactual string1 = "
+ shinout.value + "\nexpected address = "
+ printAddress (returnAddress) + "\nactual address = "
+ printAddress (ah.value)
+ "\nexpected string2 = yo ho ho!\nactual string2 = "
+ shout.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ihout.value + " "
+ t.getMessage());
}
}
public void testOutManyInoutManyInMany ()
{
StringHolder shinout = new StringHolder ("outManyInoutManyInMany");
AddressHolder ah = new AddressHolder (expectedAddress);
IntHolder ihout = new IntHolder();
StringHolder shout = new StringHolder ();
try
{
io.outManyInoutManyInMany (shinout, ah, expectedPhone, expectedNumber, ihout, shout);
assertEquals("outManyInoutManyInMany yo ho ho!", shinout.value);
assertTrue(equals (ah.value, returnAddress));
assertEquals(returnNumber, ihout.value);
assertEquals(" yo ho ho!", shout.value);
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: outManyInoutManyInMany\nexpected string1 = outManyInoutManyInMany yo ho ho!\nactual string1 = "
+ shinout.value + "\nexpected address = "
+ printAddress (returnAddress) + "\nactual address = "
+ printAddress (ah.value)
+ "\nexpected string2 = yo ho ho!\nactual string2 = "
+ shout.value + "\nexpected number = " + returnNumber
+ "\nactual number = " + ihout.value + " "
+ t.getMessage());
}
}
public void testDateInout ()
{
org.apache.axis.holders.DateHolder dh = new DateHolder(expectedDate);
try
{
io.dateInout (dh);
assertTrue("Output date does not match", returnDate.equals(dh.value));
}
catch (Throwable t)
{
throw new AssertionFailedError("Test failure: dateInout: " + t.getMessage());
}
}
}
| 6,590 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/dataset/DataServiceTestCase.java | /**
* DataServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.dataset;
import org.apache.axis.AxisFault;
import java.net.ConnectException;
import java.io.IOException;
public class DataServiceTestCase extends junit.framework.TestCase {
public DataServiceTestCase(java.lang.String name) {
super(name);
}
public void test1DataServiceSoapGetTitleAuthors() throws Exception {
test.wsdl.dataset.DataServiceSoapStub binding;
try {
binding = (test.wsdl.dataset.DataServiceSoapStub)
new test.wsdl.dataset.DataServiceLocator().getDataServiceSoap();
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
binding.setTimeout(60000);
try {
// Test operation
test.wsdl.dataset.GetTitleAuthorsResponseGetTitleAuthorsResult value = null;
value = binding.getTitleAuthors();
assertTrue(value != null);
// TBD - validate results
} catch (java.rmi.RemoteException re) {
if (re instanceof AxisFault) {
AxisFault fault = (AxisFault) re;
if (fault.detail instanceof ConnectException ||
fault.getFaultCode().getLocalPart().equals("HTTP")) {
System.err.println("DataService HTTP error: " + fault);
return;
}
if (fault.detail instanceof IOException) {
System.err.println("DataService IO error: " + fault);
return;
}
}
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
}
| 6,591 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/oneway/OnewayImpl.java | /**
* AddressBookSOAPBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.oneway;
import java.rmi.RemoteException;
import java.util.Hashtable;
public class OnewayImpl implements Oneway {
private Hashtable ht = new Hashtable();
public void addEntry(String name, Address address) throws RemoteException {
ht.put(name, address);
}
public Address getAddressFromName(String name) throws RemoteException {
return (Address) ht.get(name);
}
public void throwException() throws RemoteException {
throw new RemoteException("OnewayImpl throws RemoteException");
}
}
| 6,592 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/oneway/OnewayTestCase.java | /*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.wsdl.oneway;
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.Stub;
import test.HttpTestUtil;
import java.rmi.RemoteException;
/**
* This tests various oneway operation features.
*/
public class OnewayTestCase extends TestCase {
public OnewayTestCase(String name) {
super(name);
}
/**
* Sessions shouldn't work with oneway operations, so the call to getAddressFromName
* should return null.
*/
public void test1NoSessionOnOneway() throws Exception {
Oneway binding;
try {
OnewayServiceLocator loc = new OnewayServiceLocator();
binding = loc.getOneway(HttpTestUtil.getTestEndpoint(loc.getOnewayAddress()));
}
catch (ServiceException jre) {
throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
((Stub) binding)._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
binding.addEntry("hi", new Address());
Address address = binding.getAddressFromName("hi");
assertTrue("session doesn't work on oneway operations, address should have been null", address == null);
}
catch (RemoteException re) {
throw new AssertionFailedError("Remote Exception caught: " + re);
}
}
/**
* binding.throwException will cause the server impl to throw an exception,
* but since this is a oneway operation, that exception should not propagate
* back to the client.
*/
public void test2NoExceptionOnOneway() throws Exception {
Oneway binding;
try {
OnewayServiceLocator loc = new OnewayServiceLocator();
binding = loc.getOneway(HttpTestUtil.getTestEndpoint(loc.getOnewayAddress()));
}
catch (ServiceException jre) {
throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
binding.throwException();
}
catch (Throwable t) {
throw new AssertionFailedError("Throwable: " + t);
}
}
}
| 6,593 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/datatypes/DataTypes_BindingImpl.java | /**
* DataTypesSoapImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.datatypes;
public class DataTypes_BindingImpl implements DataTypes_PortType {
public java.lang.String sayHello() throws java.rmi.RemoteException {
return "Hello World!";
}
public java.lang.String sayHelloName(java.lang.String name) throws java.rmi.RemoteException {
return "Hello " + name;
}
public ArrayOfInt getIntArray() throws java.rmi.RemoteException {
int[] a = new int[5];
for (int i=0; i<5; i++)
a[i] = i*10;
ArrayOfInt array = new ArrayOfInt();
array.set_int(a);
return array;
}
public Mode getMode() throws java.rmi.RemoteException {
return new Mode(Mode._Off);
}
public Order getOrder() throws java.rmi.RemoteException {
Order myOrder = new Order();
myOrder.setPrice(34.5);
myOrder.setOrderID(323232);
return myOrder;
}
public ArrayOfOrder getOrders() throws java.rmi.RemoteException {
Order [] myOrders = new Order[2];
myOrders[0] = new Order();
myOrders[0].setPrice(34.5);
myOrders[0].setOrderID(323232);
myOrders[1] = new Order();
myOrders[1].setPrice(99.4);
myOrders[1].setOrderID(645645);
ArrayOfOrder array = new ArrayOfOrder();
array.setOrder(myOrders);
return array;
}
public java.lang.String[] getSimpleList(java.lang.String[] inputList) throws java.rmi.RemoteException {
java.lang.String[] outputList;
if (inputList == null) {
outputList = null;
}
else {
outputList = new java.lang.String[inputList.length];
for (int i = 0; i < inputList.length; i++) {
outputList[i] = inputList[i] + "_response";
}
}
return outputList;
}
public test.wsdl.datatypes.UsageType getUsageType() throws java.rmi.RemoteException {
return new test.wsdl.datatypes.UsageType(test.wsdl.datatypes.UsageType._value1);
}
}
| 6,594 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/datatypes/DataTypesTestCase.java | /**
* DataTypesTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.datatypes;
import javax.xml.namespace.QName;
import test.HttpTestUtil;
public class DataTypesTestCase extends junit.framework.TestCase {
public DataTypesTestCase(String name) {
super(name);
}
public void test1DataTypesSoapSayHello() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.lang.String value = null;
value = binding.sayHello();
assertTrue("sayHello should be \"Hello World!\", but instead is " + value, "Hello World!".equals(value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test2DataTypesSoapSayHelloName() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.lang.String value = null;
value = binding.sayHelloName(new java.lang.String("Axis"));
assertTrue("sayHelloName should be \"Hello Axis\", but instead is " + value, "Hello Axis".equals(value));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test3DataTypesSoapGetIntArray() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
ArrayOfInt value = null;
value = binding.getIntArray();
int[] array = value.get_int();
assertTrue("getIntArray size should be 5, instead is " + array.length, array.length == 5);
for(int i=0;i<array.length;i++) {
assertTrue("getIntArray[" + i + "] should be " + (i * 10) + ", instead is " + array[i], array[i] == i * 10);
}
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test4DataTypesSoapGetMode() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Mode value = null;
value = binding.getMode();
assertTrue("getMode should be Off, instead it is " + value.toString(), "Off".equals(value.toString()));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test5DataTypesSoapGetOrder() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
Order value = null;
value = binding.getOrder();
assertTrue("getOrder.getOrderID should be 323232, instead it is " + value.getOrderID(), value.getOrderID() == 323232);
assertTrue("getOrder.getPrice should be 34.5, instead it is " + value.getPrice(), value.getPrice() == 34.5);
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test6DataTypesSoapGetOrders() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
ArrayOfOrder value = null;
value = binding.getOrders();
Order[] orders = value.getOrder();
assertTrue("getOrders size should be 2, instead is " + orders.length, orders.length == 2);
for(int i=0;i<orders.length;i++) {
if (i == 0) {
assertTrue("getOrders[0].getOrderID should be 323232, instead it is " + orders[i].getOrderID(), orders[i].getOrderID() == 323232);
assertTrue("getOrders[0].getPrice should be 34.5, instead it is " + orders[i].getPrice(), orders[i].getPrice() == 34.5);
}
else if (i == 1) {
assertTrue("getOrders[1].getOrderID should be 645645, instead it is " + orders[i].getOrderID(), orders[i].getOrderID() == 645645);
assertTrue("getOrders[1].getPrice should be 99.4, instead it is " + orders[i].getPrice(), orders[i].getPrice() == 99.4);
}
}
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test7DataTypesSoapGetSimpleList() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
try {
java.lang.String[] inputList = new java.lang.String[3];
inputList[0] = "one";
inputList[1] = "two";
inputList[2] = "three";
java.lang.String[] outputList = binding.getSimpleList(inputList);
assertTrue("outputList[0] should be \"one_response\", but instead is " + outputList[0],
"one_response".equals(outputList[0]));
assertTrue("outputList[1] should be \"two_response\", but instead is " + outputList[1],
"two_response".equals(outputList[1]));
assertTrue("outputList[2] should be \"three_response\", but instead is " + outputList[2],
"three_response".equals(outputList[2]));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public void test5DataTypesGetUsageType() throws Exception {
DataTypes_PortType binding;
try {
DataTypes_ServiceLocator loc = new DataTypes_ServiceLocator();
binding = loc.getDataTypes(HttpTestUtil.getTestEndpoint(loc.getDataTypesAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Test operation
UsageType value = null;
value = binding.getUsageType();
System.out.println(value);
assertEquals(value.getValue(), new QName("http://schemas.xmlsoap.org/ws/2002/12/policy","Required"));
// TBD - validate results
}
}
| 6,595 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/date/MyServiceServiceTestCase.java | /**
* MyServiceServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.2alpha Dec 06, 2003 (10:46:24 EST) WSDL2Java emitter.
*/
package test.wsdl.date;
import test.HttpTestUtil;
public class MyServiceServiceTestCase extends junit.framework.TestCase {
public MyServiceServiceTestCase(java.lang.String name) {
super(name);
}
public void testtestdateWSDL() throws Exception {
javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.date.MyServiceServiceLocator().gettestdateAddress() + "?WSDL");
javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.date.MyServiceServiceLocator().getServiceName());
assertTrue(service != null);
}
public void test1testdateGetInfo() throws Exception {
test.wsdl.date.TestdateSoapBindingStub binding;
try {
MyServiceServiceLocator loc = new MyServiceServiceLocator();
binding = (TestdateSoapBindingStub)loc.gettestdate(HttpTestUtil.getTestEndpoint(loc.gettestdateAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertNotNull("binding is null", binding);
// Time out after a minute
binding.setTimeout(60000);
// Test operation
test.wsdl.date.MyBean value = null;
value = binding.getInfo();
// TBD - validate results
System.out.println(value.getDate());
}
}
| 6,596 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/date/TestdateSoapBindingImpl.java | /**
* TestdateSoapBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.2alpha Dec 06, 2003 (10:46:24 EST) WSDL2Java emitter.
*/
package test.wsdl.date;
import java.util.*;
public class TestdateSoapBindingImpl implements test.wsdl.date.MyService{
public test.wsdl.date.MyBean getInfo() throws java.rmi.RemoteException {
MyBean b = new MyBean();
Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
Date date = xmas.getTime();
b.setDate(new Date());
return b;
}
}
| 6,597 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped_holders/Wrapped_HoldersTestCase.java | /**
* Wrapped_HoldersTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.wrapped_holders;
import test.HttpTestUtil;
/**
* This test verify's that arrays in a wrapped doc/lit service get holders
* generated for them, and that they work.
*
* @author Tom Jordahl
*/
public class Wrapped_HoldersTestCase extends junit.framework.TestCase {
public Wrapped_HoldersTestCase(java.lang.String name) {
super(name);
}
public void test1ThingFind_aThing() throws Exception {
test.wsdl.wrapped_holders.Thing binding;
try {
Wrapped_holdersLocator loc = new Wrapped_holdersLocator();
binding = loc.getThing(HttpTestUtil.getTestEndpoint(loc.getThingAddress()));
}
catch (javax.xml.rpc.ServiceException jre) {
if(jre.getLinkedCause()!=null)
jre.getLinkedCause().printStackTrace();
throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
}
assertTrue("binding is null", binding != null);
// expected results
String[] things = new String[2];
things[0] = new String("Thing one");
things[1] = new String("Thing two");
String[] others = new String[2];
others[0] = new String("Other 1");
others[1] = new String("Other 2");
// input arguments
String AthingInput = new String("This is a test");
test.wsdl.wrapped_holders.holders.AThingArrayHolder AThingsOut = new test.wsdl.wrapped_holders.holders.AThingArrayHolder();
test.wsdl.wrapped_holders.holders.OtherDataArrayHolder OtherDataOut = new test.wsdl.wrapped_holders.holders.OtherDataArrayHolder();
// call the operation
binding.find_aThing(AthingInput, AThingsOut, OtherDataOut);
// verify results
assertEquals("Output argument (Things) does not match expected", things[0], AThingsOut.value[0]);
assertEquals("Output argument (Things) does not match expected", things[1], AThingsOut.value[1]);
assertEquals("Output argument (OtherData) does not match expected", others[0], OtherDataOut.value[0]);
assertEquals("Output argument (OtherData) does not match expected", others[1], OtherDataOut.value[1]);
}
}
| 6,598 |
0 | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl | Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped_holders/ThingImpl.java | /**
* ThingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis WSDL2Java emitter.
*/
package test.wsdl.wrapped_holders;
/**
* This test verify's that arrays in a wrapped doc/lit service get holders
* generated for them, and that they work.
*
* @author Tom Jordahl
*/
public class ThingImpl implements test.wsdl.wrapped_holders.Thing{
public void find_aThing(String aThing,
test.wsdl.wrapped_holders.holders.AThingArrayHolder aThingUnbounded,
test.wsdl.wrapped_holders.holders.OtherDataArrayHolder otherDataUnbounded)
throws java.rmi.RemoteException {
// Verify we get a string in aThing input argument
String input = aThing;
if (input == null || !input.equals("This is a test")) {
String error = "Input argument did not match expected string, got: ";
error += input != null ? "'" + input + "'" : "NULL";
error += " Expected: 'This is a test'";
throw new java.rmi.RemoteException(error);
}
// now send something back
String[] things = new String[2];
things[0] = new String("Thing one");
things[1] = new String("Thing two");
aThingUnbounded.value = things;
String[] others = new String[2];
others[0] = new String("Other 1");
others[1] = new String("Other 2");
otherDataUnbounded.value = others;
}
}
| 6,599 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.