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/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/anytype/AnyServiceSoapBindingImpl.java
/** * AnyServiceSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.anytype; public class AnyServiceSoapBindingImpl implements test.wsdl.anytype.AnyService{ public java.lang.Object run() throws java.rmi.RemoteException { return new String("hello"); } }
6,600
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/anytype/AnyServiceServiceTestCase.java
/** * AnyServiceServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.anytype; import test.HttpTestUtil; public class AnyServiceServiceTestCase extends junit.framework.TestCase { public AnyServiceServiceTestCase(java.lang.String name) { super(name); } public void test1AnyServiceRun() throws Exception { test.wsdl.anytype.AnyService binding; try { AnyServiceServiceLocator loc = new AnyServiceServiceLocator(); binding = loc.getAnyService(HttpTestUtil.getTestEndpoint(loc.getAnyServiceAddress())); } 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 java.lang.Object value = null; value = binding.run(); System.out.println("Got:" + value); } }
6,601
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/polymorphism/C.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. */ /** * C is a class which extends A, but HAS NO TYPE MAPPING associated with it * directly. * * We use this to make sure that such a class can still be serialized as an * A without any trouble. * * @author Glen Daniels (gdaniels@apache.org) */ package test.wsdl.polymorphism; public class C extends A { private float floatField = 0.5F; public float getFloatField() { return floatField; } public void setFloatField(float floatField) { this.floatField = floatField; } }
6,602
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/polymorphism/PolymorphismTestSoapImpl.java
/** * PolymorphismTestSoapImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.polymorphism; public class PolymorphismTestSoapImpl implements test.wsdl.polymorphism.PolymorphismTest_PortType{ public static final String B_TEXT = "this is my B field"; public static final String A_TEXT = "this is my A field"; public test.wsdl.polymorphism.A getBAsA(boolean sendC) throws java.rmi.RemoteException { if (sendC) { C myC = new C(); myC.setA(A_TEXT); return myC; } else { B myB = new B(); myB.setB(B_TEXT); myB.setA(A_TEXT); return myB; } } }
6,603
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/polymorphism/PolymorphismTest_ServiceTestCase.java
/** * PolymorphismTest_ServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.polymorphism; import test.HttpTestUtil; public class PolymorphismTest_ServiceTestCase extends junit.framework.TestCase { public PolymorphismTest_ServiceTestCase(String name) { super(name); } public void testPolymorphismTestWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getPolymorphismTestAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getServiceName()); assertTrue(service != null); } public void test1PolymorphismTestGetBAsA() throws Exception { test.wsdl.polymorphism.PolymorphismTest_PortType binding; try { PolymorphismTest_ServiceLocator loc = new PolymorphismTest_ServiceLocator(); binding = loc.getPolymorphismTest(HttpTestUtil.getTestEndpoint(loc.getPolymorphismTestAddress())); } 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.polymorphism.A value = null; // Passing false here gets us a "B" value = binding.getBAsA(false); // Check out the return value for correctness. assertTrue("Return value wasn't a 'B'!", value instanceof B); B myB = (B)value; assertEquals("B field didn't match", PolymorphismTestSoapImpl.B_TEXT, myB.getB()); assertEquals("A field didn't match", PolymorphismTestSoapImpl.A_TEXT, myB.getA()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public void test1PolymorphismTestGetCAsA() throws Exception { test.wsdl.polymorphism.PolymorphismTest_PortType binding; try { PolymorphismTest_ServiceLocator loc = new PolymorphismTest_ServiceLocator(); binding = loc.getPolymorphismTest(HttpTestUtil.getTestEndpoint(loc.getPolymorphismTestAddress())); } 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.polymorphism.A value = null; // Passing true here gets us a "C" on the server side, but since // there's no type mapping for that we should just get the "A" // part. value = binding.getBAsA(true); // Check out the return value for correctness. assertTrue("Return value wasn't an 'A'!", value instanceof A); assertEquals("A field didn't match", PolymorphismTestSoapImpl.A_TEXT, value.getA()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } }
6,604
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/choice/ChoiceServiceSoapImpl.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.wsdl.choice; public class ChoiceServiceSoapImpl implements test.wsdl.choice.ChoiceServiceSoap { public test.wsdl.choice.Record2 get(test.wsdl.choice.Record1 parameters) throws java.rmi.RemoteException { Record2 r = new Record2(); r.setElem(parameters.getElem()); return r; } }
6,605
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/choice/ChoiceServiceTestCase.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.wsdl.choice; import test.HttpTestUtil; import junit.framework.TestCase; import junit.framework.AssertionFailedError; public class ChoiceServiceTestCase extends TestCase { public ChoiceServiceTestCase(String name) { super(name); } public void testSerialization() throws Exception { ChoiceServiceSoap binding; try { ChoiceServiceLocator locator = new ChoiceServiceLocator(); binding = locator.getChoiceServiceSoap(HttpTestUtil.getTestEndpoint(locator.getChoiceServiceSoapAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } catch (Exception e) { throw new AssertionFailedError("Binding initialization Exception caught: " + e); } assertTrue("binding is null", binding != null); FaultPropertyType fp1; FaultPropertyType fp2; Record1 r1; Record2 r2; // test 1 FaultType f1 = new FaultType(); f1.setDescription("foo"); f1.setCommand("bar"); fp1 = new FaultPropertyType(); fp1.setFault1(f1); r1 = new Record1(); r1.setElem(fp1); r2 = binding.get(r1); assertTrue(r2 != null); fp2 = r2.getElem(); assertTrue(fp2 != null); assertTrue(fp2.getFault1() != null); assertTrue(fp2.getFault1() instanceof FaultType); assertEquals("foo", ((FaultType)fp2.getFault1()).getDescription()); assertEquals("bar", ((FaultType)fp2.getFault1()).getCommand()); // test 2 StagingFaultType f2 = new StagingFaultType(); f2.setDescription("foo1"); f2.setCommand("bar1"); f2.setAttribute("moo"); fp1 = new FaultPropertyType(); fp1.setFault2(f2); r1 = new Record1(); r1.setElem(fp1); r2 = binding.get(r1); assertTrue(r2 != null); fp2 = r2.getElem(); assertTrue(fp2 != null); assertTrue(fp2.getFault2() != null); assertTrue(fp2.getFault2() instanceof StagingFaultType); assertEquals("foo1", ((FaultType)fp2.getFault2()).getDescription()); assertEquals("bar1", ((FaultType)fp2.getFault2()).getCommand()); assertEquals("moo", ((StagingFaultType)fp2.getFault2()).getAttribute()); } public void testChoiceSerialization() throws Exception { ChoiceServiceSoap binding; try { ChoiceServiceLocator locator = new ChoiceServiceLocator(); binding = locator.getChoiceServiceSoap(HttpTestUtil.getTestEndpoint(locator.getChoiceServiceSoapAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } catch (Exception e) { throw new AssertionFailedError("Binding initialization Exception caught: " + e); } assertTrue("binding is null", binding != null); FaultPropertyType fp1; Record1 r1; Record2 r2; // serialize f1 FaultType f1 = new FaultType(); f1.setDescription("foo"); f1.setCommand("bar"); fp1 = new FaultPropertyType(); fp1.setFault1(f1); r1 = new Record1(); r1.setElem(fp1); r2 = binding.get(r1); assertTrue(r2 != null); // serialize f2 StagingFaultType f2 = new StagingFaultType(); f2.setDescription("foo1"); f2.setCommand("bar1"); f2.setAttribute("moo"); fp1 = new FaultPropertyType(); fp1.setFault2(f2); r1 = new Record1(); r1.setElem(fp1); r2 = binding.get(r1); assertTrue(r2 != null); } }
6,606
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/webref/DoubleBackServiceTestCase.java
/** * DoubleBackPortTypeServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2beta May 06, 2004 (03:41:36 CEST) WSDL2Java emitter. */ package test.wsdl.webref; import test.HttpTestUtil; public class DoubleBackServiceTestCase extends junit.framework.TestCase { public DoubleBackServiceTestCase(java.lang.String name) { super(name); } public void testDoubleBackServiceWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new DoubleBackPortTypeServiceLocator().getDoubleBackServiceAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new DoubleBackPortTypeServiceLocator().getServiceName()); assertTrue(service != null); } public void test1DoubleBackServiceEcho() throws Exception { test.wsdl.webref.DoubleBackServiceSoapBindingStub binding; try { DoubleBackPortTypeServiceLocator loc = new DoubleBackPortTypeServiceLocator(); binding = (DoubleBackServiceSoapBindingStub)loc.getDoubleBackService(HttpTestUtil.getTestEndpoint(loc.getDoubleBackServiceAddress())); } 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.echo( "hello" ); assertEquals( "hellohello", value); } }
6,607
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/echo2/Echo2SoapBindingImpl.java
/** * Echo2SoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Mar 22, 2005 (05:08:41 CET) WSDL2Java emitter. */ package test.wsdl.echo2; import java.rmi.RemoteException; public class Echo2SoapBindingImpl implements test.wsdl.echo2.Echo2PT{ public test.wsdl.echo2.MyBase64Bean echoMyBase64Bean(test.wsdl.echo2.MyBase64Bean input) throws java.rmi.RemoteException { return input; } public test.wsdl.echo2.MyBase64Bean[] echoArrayOfMyBase64Bean(test.wsdl.echo2.MyBase64Bean[] input) throws java.rmi.RemoteException { return input; } public String[] echoArrayOfString_MaxOccursUnbounded(String[] input) throws java.rmi.RemoteException { return input; } public java.lang.String[] echoArrayOfString_SoapEncArray(java.lang.String[] input) throws java.rmi.RemoteException { return input; } }
6,608
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/echo2/Echo2ServiceTestCase.java
/** * Echo2ServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Mar 22, 2005 (05:08:41 CET) WSDL2Java emitter. */ package test.wsdl.echo2; import java.util.Iterator; import javax.xml.namespace.QName; import org.apache.axis.MessageContext; import org.apache.axis.message.MessageElement; import org.apache.axis.message.PrefixedQName; import org.apache.axis.message.SOAPBody; import test.HttpTestUtil; public class Echo2ServiceTestCase extends junit.framework.TestCase { public Echo2ServiceTestCase(java.lang.String name) { super(name); } public void testEcho2WSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory .newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint( new test.wsdl.echo2.Echo2ServiceLocator().getEcho2Address() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.echo2.Echo2ServiceLocator().getServiceName()); assertTrue(service != null); } public void test1Echo2EchoMyBase64Bean() throws Exception { test.wsdl.echo2.Echo2SoapBindingStub binding; Echo2ServiceLocator loc = new Echo2ServiceLocator(); binding = (Echo2SoapBindingStub)loc.getEcho2(HttpTestUtil.getTestEndpoint(loc.getEcho2Address())); assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // message is more clear without multiref //binding._setProperty("sendMultiRefs", Boolean.FALSE); // Test operation test.wsdl.echo2.MyBase64Bean input = new test.wsdl.echo2.MyBase64Bean(); fillMyBase64Bean(input); test.wsdl.echo2.MyBase64Bean ret = binding.echoMyBase64Bean(input); // Body // echoMyBase64BeanResponse // return HREF // multiRef : 1 element, no child // Check message format binding._getCall().getResponseMessage().writeTo(System.out); SOAPBody body = (SOAPBody) binding._getCall().getResponseMessage().getSOAPBody(); QName responseQName = new QName("urn:echo2.wsdl.test", "echoMyBase64BeanResponse"); QName returnQName = new QName("", "return"); QName xsdByteQName = new QName("", "varXsdByte"); QName soapByteQName = new QName("", "varSoapByte"); QName xsdBase64BinQName = new QName("", "varXsdBase64Binary"); QName soapBase64BinQName = new QName("", "varSoapBase64Binary"); QName xsdHexBinQName = new QName("", "varXsdHexBinary"); QName soapBase64QName = new QName("", "varSoapBase64"); MessageElement response = body.getChildElement(responseQName); assertNotNull("no <ns1:echoMyBase64BeanResponse> found", response); MessageElement return1 = response.getChildElement(returnQName); assertNotNull("no <return> found", return1); MessageElement realRet = return1.getRealElement(); Iterator it = realRet.getChildElements(xsdByteQName); // only 1 element MessageElement one = null; while (it.hasNext()) { assertNull("only 1 element named " + xsdByteQName, one); one = (MessageElement) it.next(); } assertNull(xsdByteQName + " is nil and shouldn't have any children", one.getChildren()); it = realRet.getChildElements(soapByteQName); // only 1 element one = null; while (it.hasNext()) { assertNull("only 1 element named " + soapByteQName, one); one = (MessageElement) it.next(); } assertNull(soapByteQName + " is nil and shouldn't have any children", one.getChildren()); it = realRet.getChildElements(xsdBase64BinQName); // only 1 element one = null; while (it.hasNext()) { assertNull("only 1 element named " + xsdBase64BinQName, one); one = (MessageElement) it.next(); } assertEquals(xsdBase64BinQName + " have wrong value", "fwCB", one.getFirstChild().getNodeValue()); it = realRet.getChildElements(soapBase64BinQName); // only 1 element one = null; while (it.hasNext()) { assertNull("only 1 element named " + soapBase64BinQName, one); one = (MessageElement) it.next(); } assertEquals(soapBase64BinQName + " have wrong value", "fwCB", one.getFirstChild().getNodeValue()); it = realRet.getChildElements(xsdHexBinQName); // only 1 element one = null; while (it.hasNext()) { assertNull("only 1 element named " + xsdHexBinQName, one); one = (MessageElement) it.next(); } assertEquals(xsdHexBinQName + " have wrong value", "7f0081", one.getFirstChild().getNodeValue()); it = realRet.getChildElements(soapBase64QName); // only 1 element one = null; while (it.hasNext()) { assertNull("only 1 element named " + soapBase64QName, one); one = (MessageElement) it.next(); } assertEquals(soapBase64QName + " have wrong value", "fwCB", one.getFirstChild().getNodeValue()); } public void test1Echo2EchoArrayOfMyBase64Bean() throws Exception { test.wsdl.echo2.Echo2SoapBindingStub binding; Echo2ServiceLocator loc = new Echo2ServiceLocator(); binding = (Echo2SoapBindingStub)loc.getEcho2(HttpTestUtil.getTestEndpoint(loc.getEcho2Address())); assertNotNull("binding is null", binding); // Time out after a minute binding.setTimeout(60000); // Test operation MyBase64Bean[] value = null; MyBase64Bean[] array = new MyBase64Bean[2]; array[0] = new MyBase64Bean(); fillMyBase64Bean(array[0]); array[1] = new MyBase64Bean(); fillMyBase64Bean(array[1]); value = binding.echoArrayOfMyBase64Bean(array); // TBD - validate results } /** * @param bean */ private void fillMyBase64Bean(MyBase64Bean bean) { bean.setVarSoapBase64(new byte[] {127, 0, -127}); bean.setVarSoapBase64Binary(new byte[] {127, 0, -127}); bean.setVarXsdBase64Binary(new byte[] {127, 0, -127}); bean.setVarXsdHexBinary(new byte[] {127, 0, -127}); } public void test2Echo2EchoArrayOfString_MaxOccursUnbounded() throws Exception { test.wsdl.echo2.Echo2SoapBindingStub binding; Echo2ServiceLocator loc = new test.wsdl.echo2.Echo2ServiceLocator(); try { binding = (Echo2SoapBindingStub)loc.getEcho2(HttpTestUtil.getTestEndpoint(loc.getEcho2Address())); } 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 String [] args = new String[] {"one", "two", "", null}; java.lang.String[] value = null; value = binding .echoArrayOfString_MaxOccursUnbounded(args); // Validate results - NOTE: This checks the XML directly, so if // any changes are made to the WSDL/code for this test, equivalent // changes must be made in this code. SOAPBody body = (SOAPBody)binding._getCall().getResponseMessage().getSOAPBody(); MessageElement element; QName responseQName = new QName("urn:echo2.wsdl.test", "echoArrayOfString_MaxOccursUnboundedResponse"); QName returnQName = new QName("", "return"); QName itemQName = new QName("", "varStringArray"); element = body.getChildElement(responseQName); assertNotNull("Couldn't find response element", element); element = element.getChildElement(returnQName); assertNotNull("Couldn't find return element", element); Iterator elements = element.getChildElements(itemQName); assertNotNull("Couldn't find items", elements); int count = 0; while (elements.hasNext()) { element = (MessageElement) elements.next(); count++; } assertEquals("Wrong # of items", 4, count); // OK, now that we know the XML looked right, just for yuks check the values for (int i = 0; i < value.length; i++) { assertEquals("Item " + i + " didn't match!", args[i], value[i]); } } public void test3Echo2EchoArrayOfString_SoapEncArray() throws Exception { test.wsdl.echo2.Echo2SoapBindingStub binding; try { Echo2ServiceLocator loc = new Echo2ServiceLocator(); binding = (Echo2SoapBindingStub)loc.getEcho2(HttpTestUtil.getTestEndpoint(loc.getEcho2Address())); } 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.echoArrayOfString_SoapEncArray(new java.lang.String[] { "one", "two", "three", "", null }); // TBD - validate results } public static void main(String[] argv) throws Exception { Echo2ServiceTestCase tc = new Echo2ServiceTestCase("somehging;"); tc.test1Echo2EchoMyBase64Bean(); } }
6,609
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marshall2/Marshall2ServiceTestCase.java
/** * Marshall2ServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Feb 14, 2005 (08:56:33 EST) WSDL2Java emitter. */ package test.wsdl.marshall2; import org.apache.axis.Constants; import javax.xml.namespace.QName; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Calendar; import java.util.GregorianCalendar; import java.net.URI; import test.HttpTestUtil; import test.wsdl.marshall2.types.JavaBean; import test.wsdl.marshall2.types.JavaBean2; public class Marshall2ServiceTestCase extends junit.framework.TestCase { public Marshall2ServiceTestCase(java.lang.String name) { super(name); } public void testMarshall2PortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.marshall2.Marshall2ServiceLocator().getMarshall2PortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.marshall2.Marshall2ServiceLocator().getServiceName()); assertTrue(service != null); } public void test1Marshall2PortBigDecimalArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BigDecimalArrayTestResponse value = null; value = binding.bigDecimalArrayTest(new test.wsdl.marshall2.types.BigDecimalArrayTest(new BigDecimal[]{new BigDecimal("5.0"), new BigDecimal("3512359.1456"), new BigDecimal("3512360.1456"), null })); } public void test2Marshall2PortBigDecimalTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BigDecimalTestResponse value = null; value = binding.bigDecimalTest(new test.wsdl.marshall2.types.BigDecimalTest(new BigDecimal("5.0"))); // TBD - validate results } public void test3Marshall2PortBigIntegerArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BigIntegerArrayTestResponse value = null; value = binding.bigIntegerArrayTest(new test.wsdl.marshall2.types.BigIntegerArrayTest(new BigInteger[]{new BigInteger("5"), new BigInteger("3512359"), new BigInteger("3512360"), null })); // TBD - validate results } public void test4Marshall2PortBigIntegerTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BigIntegerTestResponse value = null; value = binding.bigIntegerTest(new test.wsdl.marshall2.types.BigIntegerTest(new BigInteger("8"))); // TBD - validate results } public void test5Marshall2PortBooleanArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BooleanArrayTestResponse value = null; value = binding.booleanArrayTest(new test.wsdl.marshall2.types.BooleanArrayTest(new boolean[]{true,false})); // TBD - validate results } public void test6Marshall2PortBooleanTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.BooleanTestResponse value = null; value = binding.booleanTest(new test.wsdl.marshall2.types.BooleanTest(true)); // TBD - validate results } public void test7Marshall2PortByteArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.ByteArrayTestResponse value = null; value = binding.byteArrayTest(new test.wsdl.marshall2.types.ByteArrayTest("hello".getBytes())); // TBD - validate results } public void test8Marshall2PortByteTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.ByteTestResponse value = null; value = binding.byteTest(new test.wsdl.marshall2.types.ByteTest("x".getBytes()[0])); // TBD - validate results } public void test9Marshall2PortDoubleArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.DoubleArrayTestResponse value = null; value = binding.doubleArrayTest(new test.wsdl.marshall2.types.DoubleArrayTest(new double[]{4,5})); // TBD - validate results } public void test10Marshall2PortDoubleTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.DoubleTestResponse value = null; value = binding.doubleTest(new test.wsdl.marshall2.types.DoubleTest(4)); // TBD - validate results } public void test11Marshall2PortFloatArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.FloatArrayTestResponse value = null; value = binding.floatArrayTest(new test.wsdl.marshall2.types.FloatArrayTest(new float[]{67,75})); // TBD - validate results } public void test12Marshall2PortFloatTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.FloatTestResponse value = null; value = binding.floatTest(new test.wsdl.marshall2.types.FloatTest(56)); // TBD - validate results } public void test13Marshall2PortIntArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.IntArrayTestResponse value = null; value = binding.intArrayTest(new test.wsdl.marshall2.types.IntArrayTest(new int[]{3,4})); // TBD - validate results } public void test14Marshall2PortIntTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.IntTestResponse value = null; value = binding.intTest(new test.wsdl.marshall2.types.IntTest(3)); // TBD - validate results } public void test15Marshall2PortLongArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.LongArrayTestResponse value = null; value = binding.longArrayTest(new test.wsdl.marshall2.types.LongArrayTest(new long[]{3,4})); // TBD - validate results } public void test16Marshall2PortLongTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.LongTestResponse value = null; value = binding.longTest(new test.wsdl.marshall2.types.LongTest(5467)); // TBD - validate results } public void test17Marshall2PortShortArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.ShortArrayTestResponse value = null; value = binding.shortArrayTest(new test.wsdl.marshall2.types.ShortArrayTest(new short[]{(short)3,(short)4})); // TBD - validate results } public void test18Marshall2PortShortTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.ShortTestResponse value = null; value = binding.shortTest(new test.wsdl.marshall2.types.ShortTest((short)4)); // TBD - validate results } public void test19Marshall2PortStringArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.StringArrayTestResponse value = null; value = binding.stringArrayTest(new test.wsdl.marshall2.types.StringArrayTest(new String[]{ "foo1", "foo2", "foo3", "", null })); // TBD - validate results } public void test20Marshall2PortStringTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.StringTestResponse value = null; value = binding.stringTest(new test.wsdl.marshall2.types.StringTest("foo")); // TBD - validate results } public void test21Marshall2PortQnameTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.QNameTestResponse value = null; value = binding.qnameTest(new test.wsdl.marshall2.types.QNameTest(Constants.QNAME_FAULTDETAIL_HOSTNAME)); // TBD - validate results } public void test22Marshall2PortQnameArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.QNameArrayTestResponse value = null; value = binding.qnameArrayTest(new test.wsdl.marshall2.types.QNameArrayTest(new QName[]{Constants.QNAME_FAULTDETAIL_HOSTNAME,Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME, new QName("someLocalPart"), new QName("http://someURI.org/", "someLocalPart"), null })); // TBD - validate results } public void test23Marshall2PortCalendarArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.CalendarArrayTestResponse value = null; value = binding.calendarArrayTest(new test.wsdl.marshall2.types.CalendarArrayTest(new Calendar[]{Calendar.getInstance(), new GregorianCalendar(96,5,1), new GregorianCalendar(99,10,25), null })); } public void test24Marshall2PortCalendarTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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.marshall2.types.CalendarTestResponse value = null; value = binding.calendarTest(new test.wsdl.marshall2.types.CalendarTest(Calendar.getInstance())); // TBD - validate results } public void test25Marshall2PortJavaBeanArrayTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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); JavaBean b = new JavaBean(); b.setMyBigDecimal(new BigDecimal(4)); b.setMyBigInteger(new BigInteger("5")); b.setMyBoolean(false); b.setMyByte((byte)0x1); b.setMyCalendar(Calendar.getInstance()); b.setMyDouble(4); b.setMyFloat(5); b.setMyInt(6); b.setMyLong(3); b.setMyString("sdfsdf"); b.setMyJavaBean(new JavaBean2(new BigDecimal(5), (double)5, (long)2, (short)1, (int)1, Calendar.getInstance(), (byte)0x1, true, "xxx", new BigInteger("4"), (float)3)); JavaBean b2 = new JavaBean(); b2.setMyBigDecimal(new BigDecimal(4)); b2.setMyBigInteger(new BigInteger("5")); b2.setMyBoolean(false); b2.setMyByte((byte)0x1); b2.setMyCalendar(Calendar.getInstance()); b2.setMyDouble(4); b2.setMyFloat(5); b2.setMyInt(6); b2.setMyLong(3); b2.setMyString("sdfsdf"); b2.setMyJavaBean(new JavaBean2(new BigDecimal(5), (double)5, (long)2, (short)1, (int)1, Calendar.getInstance(), (byte)0x1, true, "xxx", new BigInteger("4"), (float)3)); // Test operation test.wsdl.marshall2.types.JavaBeanArrayTestResponse value = null; value = binding.javaBeanArrayTest(new test.wsdl.marshall2.types.JavaBeanArrayTest(new JavaBean[]{b,b2})); // TBD - validate results } public void test26Marshall2PortJavaBeanTest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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); JavaBean b = new JavaBean(); b.setMyBigDecimal(new BigDecimal(4)); b.setMyBigInteger(new BigInteger("5")); b.setMyBoolean(false); b.setMyByte((byte)0x1); b.setMyCalendar(Calendar.getInstance()); b.setMyDouble(4); b.setMyFloat(5); b.setMyInt(6); b.setMyLong(3); b.setMyString("sdfsdf"); b.setMyJavaBean(new JavaBean2(new BigDecimal(5), (double)5, (long)2, (short)1, (int)1, Calendar.getInstance(), (byte)0x1, true, "xxx", new BigInteger("4"), (float)3)); // Time out after a minute binding.setTimeout(60000); // Test operation test.wsdl.marshall2.types.JavaBeanTestResponse value = null; value = binding.javaBeanTest(new test.wsdl.marshall2.types.JavaBeanTest(b)); // TBD - validate results } public void test27Marshall2PortAnyURITest() throws Exception { test.wsdl.marshall2.MarshallTestSoapBindingStub binding; try { Marshall2ServiceLocator loc = new Marshall2ServiceLocator(); binding = (MarshallTestSoapBindingStub)loc.getMarshall2Port(HttpTestUtil.getTestEndpoint(loc.getMarshall2PortAddress())); } 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); URI b = new URI("urn:something"); // Time out after a minute binding.setTimeout(60000); // Test operation test.wsdl.marshall2.types.FooAnyURITypeResponse value = null; value = binding.fooAnyURITest(new test.wsdl.marshall2.types.FooAnyURIType(b)); // TBD - validate results } }
6,610
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marshall2/MarshallTestSoapBindingImpl.java
/** * MarshallTestSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC3 Feb 14, 2005 (08:56:33 EST) WSDL2Java emitter. */ package test.wsdl.marshall2; import test.wsdl.marshall2.types.BigDecimalArrayTestResponse; import test.wsdl.marshall2.types.BigDecimalTestResponse; import test.wsdl.marshall2.types.BigIntegerArrayTestResponse; import test.wsdl.marshall2.types.BigIntegerTestResponse; import test.wsdl.marshall2.types.BooleanArrayTestResponse; import test.wsdl.marshall2.types.BooleanTestResponse; import test.wsdl.marshall2.types.ByteArrayTestResponse; import test.wsdl.marshall2.types.ByteTestResponse; import test.wsdl.marshall2.types.CalendarArrayTestResponse; import test.wsdl.marshall2.types.CalendarTestResponse; import test.wsdl.marshall2.types.DoubleArrayTestResponse; import test.wsdl.marshall2.types.DoubleTestResponse; import test.wsdl.marshall2.types.FloatArrayTestResponse; import test.wsdl.marshall2.types.FloatTestResponse; import test.wsdl.marshall2.types.FooAnyURIType; import test.wsdl.marshall2.types.FooAnyURITypeResponse; import test.wsdl.marshall2.types.IntArrayTestResponse; import test.wsdl.marshall2.types.IntTestResponse; import test.wsdl.marshall2.types.JavaBeanArrayTestResponse; import test.wsdl.marshall2.types.JavaBeanTestResponse; import test.wsdl.marshall2.types.LongArrayTestResponse; import test.wsdl.marshall2.types.LongTestResponse; import test.wsdl.marshall2.types.QNameArrayTestResponse; import test.wsdl.marshall2.types.QNameTestResponse; import test.wsdl.marshall2.types.ShortArrayTestResponse; import test.wsdl.marshall2.types.ShortTestResponse; import test.wsdl.marshall2.types.StringArrayTestResponse; import test.wsdl.marshall2.types.StringTestResponse; import java.rmi.RemoteException; public class MarshallTestSoapBindingImpl implements test.wsdl.marshall2. MarshallTest { public test.wsdl.marshall2.types.BigDecimalArrayTestResponse bigDecimalArrayTest(test.wsdl.marshall2.types.BigDecimalArrayTest parameters) throws java.rmi.RemoteException { if(parameters.getBigDecimalArray()==null) { throw new RemoteException("BigDecimalArray is null"); } return new BigDecimalArrayTestResponse(parameters.getBigDecimalArray()); } public test.wsdl.marshall2.types.BigDecimalTestResponse bigDecimalTest(test.wsdl.marshall2.types.BigDecimalTest parameters) throws java.rmi.RemoteException { return new BigDecimalTestResponse(parameters.getBigDecimal()); } public test.wsdl.marshall2.types.BigIntegerArrayTestResponse bigIntegerArrayTest(test.wsdl.marshall2.types.BigIntegerArrayTest parameters) throws java.rmi.RemoteException { if(parameters.getBigIntegerArray()==null) { throw new RemoteException("BigIntegerArray is null"); } return new BigIntegerArrayTestResponse(parameters.getBigIntegerArray()); } public test.wsdl.marshall2.types.BigIntegerTestResponse bigIntegerTest(test.wsdl.marshall2.types.BigIntegerTest parameters) throws java.rmi.RemoteException { return new BigIntegerTestResponse(parameters.getBigInteger()); } public test.wsdl.marshall2.types.BooleanArrayTestResponse booleanArrayTest(test.wsdl.marshall2.types.BooleanArrayTest parameters) throws java.rmi.RemoteException { return new BooleanArrayTestResponse(parameters.getBooleanArray()); } public test.wsdl.marshall2.types.BooleanTestResponse booleanTest(test.wsdl.marshall2.types.BooleanTest parameters) throws java.rmi.RemoteException { return new BooleanTestResponse(parameters.isBooleanValue()); } public test.wsdl.marshall2.types.ByteArrayTestResponse byteArrayTest(test.wsdl.marshall2.types.ByteArrayTest parameters) throws java.rmi.RemoteException { return new ByteArrayTestResponse(parameters.getByteArray()); } public test.wsdl.marshall2.types.ByteTestResponse byteTest(test.wsdl.marshall2.types.ByteTest parameters) throws java.rmi.RemoteException { return new ByteTestResponse(parameters.getByteValue()); } public test.wsdl.marshall2.types.DoubleArrayTestResponse doubleArrayTest(test.wsdl.marshall2.types.DoubleArrayTest parameters) throws java.rmi.RemoteException { return new DoubleArrayTestResponse(parameters.getDoubleArray()); } public test.wsdl.marshall2.types.DoubleTestResponse doubleTest(test.wsdl.marshall2.types.DoubleTest parameters) throws java.rmi.RemoteException { return new DoubleTestResponse(parameters.getDoubleValue()); } public test.wsdl.marshall2.types.FloatArrayTestResponse floatArrayTest(test.wsdl.marshall2.types.FloatArrayTest parameters) throws java.rmi.RemoteException { return new FloatArrayTestResponse(parameters.getFloatArray()); } public test.wsdl.marshall2.types.FloatTestResponse floatTest(test.wsdl.marshall2.types.FloatTest parameters) throws java.rmi.RemoteException { return new FloatTestResponse(parameters.getFloatValue()); } public test.wsdl.marshall2.types.IntArrayTestResponse intArrayTest(test.wsdl.marshall2.types.IntArrayTest parameters) throws java.rmi.RemoteException { return new IntArrayTestResponse(parameters.getIntArray()); } public test.wsdl.marshall2.types.IntTestResponse intTest(test.wsdl.marshall2.types.IntTest parameters) throws java.rmi.RemoteException { return new IntTestResponse(parameters.getIntValue()); } public test.wsdl.marshall2.types.LongArrayTestResponse longArrayTest(test.wsdl.marshall2.types.LongArrayTest parameters) throws java.rmi.RemoteException { return new LongArrayTestResponse(parameters.getLongArray()); } public test.wsdl.marshall2.types.LongTestResponse longTest(test.wsdl.marshall2.types.LongTest parameters) throws java.rmi.RemoteException { return new LongTestResponse(parameters.getLongValue()); } public test.wsdl.marshall2.types.ShortArrayTestResponse shortArrayTest(test.wsdl.marshall2.types.ShortArrayTest parameters) throws java.rmi.RemoteException { return new ShortArrayTestResponse(parameters.getShortArray()); } public test.wsdl.marshall2.types.ShortTestResponse shortTest(test.wsdl.marshall2.types.ShortTest parameters) throws java.rmi.RemoteException { return new ShortTestResponse(parameters.getShortValue()); } public test.wsdl.marshall2.types.StringArrayTestResponse stringArrayTest(test.wsdl.marshall2.types.StringArrayTest parameters) throws java.rmi.RemoteException { if(parameters.getStringArray()==null) { throw new RemoteException("StringArray is null"); } return new StringArrayTestResponse(parameters.getStringArray()); } public test.wsdl.marshall2.types.StringTestResponse stringTest(test.wsdl.marshall2.types.StringTest parameters) throws java.rmi.RemoteException { return new StringTestResponse(parameters.getStringValue()); } public test.wsdl.marshall2.types.QNameTestResponse qnameTest(test.wsdl.marshall2.types.QNameTest parameters) throws java.rmi.RemoteException { return new QNameTestResponse(parameters.getQname_1()); } public test.wsdl.marshall2.types.QNameArrayTestResponse qnameArrayTest(test.wsdl.marshall2.types.QNameArrayTest parameters) throws java.rmi.RemoteException { if(parameters.getQnameArray_1()==null) { throw new RemoteException("QnameArray_1 is null"); } return new QNameArrayTestResponse(parameters.getQnameArray_1()); } public test.wsdl.marshall2.types.CalendarArrayTestResponse calendarArrayTest(test.wsdl.marshall2.types.CalendarArrayTest parameters) throws java.rmi.RemoteException { if(parameters.getCalendarArray()==null) { throw new RemoteException("CalendarArray is null"); } return new CalendarArrayTestResponse(parameters.getCalendarArray()); } public test.wsdl.marshall2.types.CalendarTestResponse calendarTest(test.wsdl.marshall2.types.CalendarTest parameters) throws java.rmi.RemoteException { return new CalendarTestResponse(parameters.getCalendar()); } public test.wsdl.marshall2.types.JavaBeanArrayTestResponse javaBeanArrayTest(test.wsdl.marshall2.types.JavaBeanArrayTest parameters) throws java.rmi.RemoteException { return new JavaBeanArrayTestResponse(parameters.getJavaBeanArray()); } public test.wsdl.marshall2.types.JavaBeanTestResponse javaBeanTest(test.wsdl.marshall2.types.JavaBeanTest parameters) throws java.rmi.RemoteException { return new JavaBeanTestResponse(parameters.getJavaBean()); } public test.wsdl.marshall2.types.FooAnyURITypeResponse fooAnyURITest(test.wsdl.marshall2.types.FooAnyURIType parameters) throws java.rmi.RemoteException { return new FooAnyURITypeResponse(parameters.getFooAnyURIType()); } }
6,611
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/document/TestServiceServiceTestCase.java
/** * TestServiceServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.document; import org.apache.axis.utils.XMLUtils; import org.w3c.dom.Element; import test.HttpTestUtil; public class TestServiceServiceTestCase extends junit.framework.TestCase { String xml = "<hello>world</hello>"; public TestServiceServiceTestCase(java.lang.String name) { super(name); } public void testDocumentTestWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.document.TestServiceServiceLocator().getDocumentTestAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.document.TestServiceServiceLocator().getServiceName()); assertTrue(service != null); } public void test1DocumentTestGetElement() throws Exception { test.wsdl.document.DocumentTestSoapBindingStub binding; try { TestServiceServiceLocator loc = new TestServiceServiceLocator(); binding = (DocumentTestSoapBindingStub)loc.getDocumentTest(HttpTestUtil.getTestEndpoint(loc.getDocumentTestAddress())); } 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.w3c.dom.Element value = null; value = binding.getElement(); // TBD - validate results assertTrue(value != null); assertTrue(XMLUtils.ElementToString(value).indexOf(xml)!=-1); } public void test2DocumentTestGetDocument() throws Exception { test.wsdl.document.DocumentTestSoapBindingStub binding; try { TestServiceServiceLocator loc = new TestServiceServiceLocator(); binding = (DocumentTestSoapBindingStub)loc.getDocumentTest(HttpTestUtil.getTestEndpoint(loc.getDocumentTestAddress())); } 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.w3c.dom.Document value = null; value = binding.getDocument(); // TBD - validate results assertTrue(value != null); assertTrue(XMLUtils.DocumentToString(value).indexOf(xml)!=-1); } }
6,612
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/document/DocumentTestSoapBindingImpl.java
/** * DocumentTestSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.document; import org.apache.axis.AxisFault; import org.apache.axis.utils.XMLUtils; import java.io.ByteArrayInputStream; public class DocumentTestSoapBindingImpl implements test.wsdl.document.TestService{ String xml = "<hello>world</hello>"; public org.w3c.dom.Element getElement() throws java.rmi.RemoteException { try { return XMLUtils.newDocument(new ByteArrayInputStream(xml.getBytes())).getDocumentElement(); } catch (Exception e) { throw AxisFault.makeFault(e); } } public org.w3c.dom.Document getDocument() throws java.rmi.RemoteException { try { return XMLUtils.newDocument(new ByteArrayInputStream(xml.getBytes())); } catch (Exception e) { throw AxisFault.makeFault(e); } } }
6,613
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/rpcParams/RpcParamsBindingImpl.java
/** * RpcParamsBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.rpcParams; public class RpcParamsBindingImpl implements RpcParamsTest { /** * Just return a struct with the first and second fields * filled out with the arguments. */ public EchoStruct echo(String first, String second) { final EchoStruct result = new EchoStruct(); result.setFirst(first); result.setSecond(second); return result; } }
6,614
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/rpcParams/RpcParamsServiceTestCase.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.wsdl.rpcParams; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.apache.axis.client.Call; import org.apache.axis.constants.Style; import org.apache.axis.constants.Use; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ParameterDesc; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.soap.SOAPConstants; import test.HttpTestUtil; import junit.framework.TestCase; /** * Simple test case to test parameter handling in an RPC/Encoded web service. It tests two * scenarios: * <ol> * <li>Null parameters to an operation may be ommitted. * <li>Parameters to an operation may be sent in any order. * </ol> * To accomplish this, the test uses the {@link Call} API instead of a generated stub, since * wsdl2Java never reorders or omits null parameters. * <p> * The test case was originally created to validate bug <a * href="https://issues.apache.org/jira/browse/AXIS-928">AXIS-928</a>. */ public class RpcParamsServiceTestCase extends TestCase { private static EchoStruct callEcho(String first, String second, boolean reverse) throws Exception { OperationDesc operation = new OperationDesc(); operation.setName("echo"); if (!reverse) { if (first != null) { operation.addParameter(new QName("", "first"), new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, ParameterDesc.IN, false, false); } if (second != null) { operation.addParameter(new QName("", "second"), new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, ParameterDesc.IN, false, false); } } else { if (second != null) { operation.addParameter(new QName("", "second"), new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, ParameterDesc.IN, false, false); } if (first != null) { operation.addParameter(new QName("", "first"), new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, ParameterDesc.IN, false, false); } } operation.setReturnType(new QName("urn:rpcParams.wsdl.test", "EchoStruct")); operation.setReturnClass(EchoStruct.class); operation.setReturnQName(new QName("", "echoReturn")); operation.setStyle(Style.RPC); operation.setUse(Use.ENCODED); Call call = new Call(HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/RpcParams")); call.setOperation(operation); call.setUseSOAPAction(true); call.setSOAPActionURI(""); call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); call.setOperationName(new QName("urn:rpcParams.wsdl.test", "echo")); call.registerTypeMapping(EchoStruct.class, new QName("urn:rpcParams.wsdl.test", "EchoStruct"), BeanSerializerFactory.class, BeanDeserializerFactory.class, false); // add the params we're actually going to send, again ommitting nulls List params = new ArrayList(2); if (!reverse) { if (first != null) { params.add(first); } if (second != null) { params.add(second); } } else { if (second != null) { params.add(second); } if (first != null) { params.add(first); } } return (EchoStruct)call.invoke(params.toArray()); } /** * Send parameters in the order that they are specified in * the wsdl. Also omits null parameters. */ public void testEcho() throws Exception { EchoStruct result; // test sending both result = callEcho("first", "second", false); assertNotNull("returned struct is null", result); assertEquals("first parameter marshalled wrong when both sent", "first", result.getFirst()); assertEquals("second parameter marshalled wrong when both sent", "second", result.getSecond()); // test ommitting the first, since it's null result = callEcho(null, "second", false); assertNotNull("returned struct is null", result); assertNull("first parameter should be null", result.getFirst()); assertEquals("second parameter marshalled wrong first is null", "second", result.getSecond()); // test ommitting the second, since it's null result = callEcho("first", null, false); assertNotNull("returned struct is null", result); assertEquals("first parameter marshalled wrong when second is null", "first", result.getFirst()); assertNull("second parameter should be null", result.getSecond()); // test ommitting both, since they're null result = callEcho(null, null, false); assertNotNull("returned struct is null", result); assertNull("first parameter should be null", result.getFirst()); assertNull("second parameter should be null", result.getSecond()); } /** * Send parameters in the reverse order that they are specified in * the wsdl. Also omits null parameters. */ public void testEchoReverse() throws Exception { EchoStruct result; // test sending both result = callEcho("first", "second", true); assertNotNull("returned struct is null", result); assertEquals("first parameter marshalled wrong when both sent", "first", result.getFirst()); assertEquals("second parameter marshalled wrong when both sent", "second", result.getSecond()); // test ommitting the first, since it's null result = callEcho(null, "second", true); assertNotNull("returned struct is null", result); assertNull("first parameter should be null", result.getFirst()); assertEquals("second parameter marshalled wrong first is null", "second", result.getSecond()); // test ommitting the second, since it's null result = callEcho("first", null, true); assertNotNull("returned struct is null", result); assertEquals("first parameter marshalled wrong when second is null", "first", result.getFirst()); assertNull("second parameter should be null", result.getSecond()); // test ommitting both, since they're null result = callEcho(null, null, true); assertNotNull("returned struct is null", result); assertNull("first parameter should be null", result.getFirst()); assertNull("second parameter should be null", result.getSecond()); } }
6,615
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/omit/OmitImpl.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. */ /** * OmitImpl.java * */ package test.wsdl.omit; public class OmitImpl implements test.wsdl.omit.Omit { public test.wsdl.omit.Phone echoPhone(test.wsdl.omit.Phone in) throws java.rmi.RemoteException { return in; } }
6,616
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/omit/OmitTestCase.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. */ /** * OmitTestCase.java * * This tests the omitting of elements when minOccurs=0 and the value * of the element is Null. * * For instance: * <Phone> * <prefix>555</prefix> * <number>1212</number> * </Phone> * * This would normally have the additional areaCode element: * <areaCode xsi:nil=true/> * */ package test.wsdl.omit; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.w3c.dom.Element; import org.xml.sax.SAXException; import test.HttpTestUtil; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; /** * Test nillable elements. * * @author Tom Jordahl (tomj@macromedia.com) * @author Dominik Kacprzak (dominik@opentoolbox.com) */ public class OmitTestCase extends junit.framework.TestCase { private static final String AREA_CODE = "111"; public OmitTestCase(String name) { super(name); } /** * Optimistic scenario: * - area code is echoed successfully * - prefix is not part of XML exchanged between the client and servers * - number is passed as null. * There does not seem to be a good way to verify what's exchanged over the wire. */ public void test1OmitEchoPhone() throws Exception { test.wsdl.omit.Omit binding; try { OmitTestLocator loc = new OmitTestLocator(); binding = loc.getomit(HttpTestUtil.getTestEndpoint(loc.getomitAddress())); } 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.omit.Phone input = new test.wsdl.omit.Phone(); input.setAreaCode(AREA_CODE); test.wsdl.omit.Phone out = binding.echoPhone(input); assertNotNull("The return value from the operation was null", out); assertEquals("area code is incorrect", AREA_CODE, out.getAreaCode()); assertNull("prefix is not null", out.getPrefix()); assertNull("number is not null", out.getNumber()); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } /** * Testing if an exception is thrown when a required elemen is null. */ public void test2OmitEchoPhone() throws Exception { test.wsdl.omit.Omit binding; try { OmitTestLocator loc = new OmitTestLocator(); binding = loc.getomit(HttpTestUtil.getTestEndpoint(loc.getomitAddress())); } 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.omit.Phone input = new test.wsdl.omit.Phone(); test.wsdl.omit.Phone out = binding.echoPhone(input); throw new junit.framework.AssertionFailedError("web services call succeeded despite of AreaCode being null."); } catch (java.rmi.RemoteException re) { // this is desired System.out.println(re); } } /** * A simple test to validate if WSDL generated by Axis' ?WSDL properly * generates nillable properties. */ public void testGeneratedWSDL() throws Exception { boolean testedAreaCode = false; boolean testedPrefix = false; boolean testedNumber = false; // URL for omit's wsdl String url = HttpTestUtil.getTestEndpoint(new test.wsdl.omit.OmitTestLocator().getomitAddress()) + "?WSDL"; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { throw new junit.framework.AssertionFailedError(e.getLocalizedMessage()); } try { Document document = builder.parse(url); assertNotNull("WSDL document is null", document); NodeList nodes = document.getDocumentElement().getElementsByTagName("element"); assertTrue("There are no \"elements\" in WSDL document", nodes.getLength() > 0); // test elements for (int i = 0; i < nodes.getLength(); i++) { Element element = (Element) nodes.item(i); String name = element.getAttribute("name"); String nillable = element.getAttribute("nillable"); if (name.equals("areaCode")) { testedAreaCode = true; assertTrue("nillable attribute for \"areaCode\" element should be empty", nillable.length() == 0); } if (name.equals("prefix")) { testedPrefix = true; assertTrue("nillable attribute for \"prefix\" element should be empty", nillable.length() == 0); } if (name.equals("number")) { testedNumber = true; assertTrue("nillable attribute for \"number\" element should be set to \"true\"", nillable.equals("true")); } } // check if all elements were tested assertTrue("areaCode element was not validated", testedAreaCode); assertTrue("prefix element was not validated", testedPrefix); assertTrue("number element was not validated", testedNumber); } catch (SAXException e) { throw new junit.framework.AssertionFailedError(e.getLocalizedMessage()); } catch (IOException e) { throw new junit.framework.AssertionFailedError(e.getLocalizedMessage()); } } public static void main(String[] args) throws Exception { OmitTestCase tester = new OmitTestCase("tester"); tester.test1OmitEchoPhone(); } }
6,617
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays3/AddrBookServiceImplServiceTestCase.java
/** * AddrBookServiceImplServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis #axisVersion# #today# WSDL2Java emitter. */ package test.wsdl.arrays3; import test.HttpTestUtil; import test.wsdl.arrays3.testclient.AddrBookServiceImplServiceLocator; import test.wsdl.arrays3.testclient.Arrays3SoapBindingStub; import junit.framework.AssertionFailedError; public class AddrBookServiceImplServiceTestCase extends junit.framework.TestCase { public AddrBookServiceImplServiceTestCase(java.lang.String name) { super(name); } public void testAddressBookWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.arrays3.testclient.AddrBookServiceImplServiceLocator().getarrays3Address() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.arrays3.testclient.AddrBookServiceImplServiceLocator().getServiceName()); assertTrue(service != null); } public void testFunctional() throws Exception { test.wsdl.arrays3.testclient.Arrays3SoapBindingStub binding; try { AddrBookServiceImplServiceLocator loc = new AddrBookServiceImplServiceLocator(); binding = (Arrays3SoapBindingStub)loc.getarrays3(HttpTestUtil.getTestEndpoint(loc.getarrays3Address())); } 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.wsdl.arrays3.testclient.Phone ph1 = new test.wsdl.arrays3.testclient.Phone(); ph1.setAreaCode(765); ph1.setExchange("494"); ph1.setNumber("4900"); test.wsdl.arrays3.testclient.Phone ph2 = new test.wsdl.arrays3.testclient.Phone(); ph2.setAreaCode(765); ph2.setExchange("494"); ph2.setNumber("4901"); test.wsdl.arrays3.testclient.Phone ph3 = new test.wsdl.arrays3.testclient.Phone(); ph3.setAreaCode(765); ph3.setExchange("494"); ph3.setNumber("4902"); test.wsdl.arrays3.testclient.StateType state = new test.wsdl.arrays3.testclient.StateType(); state.setState("IN"); test.wsdl.arrays3.testclient.Address addr = new test.wsdl.arrays3.testclient.Address(); addr.setCity("West Lafayette"); addr.setState(state); addr.setStreetName("University Drive"); addr.setStreetNum(1); addr.setZip(47907); addr.setPhoneNumber(ph1); addr.setOtherPhones(new test.wsdl.arrays3.testclient.Phone[] { ph2, ph3}); test.wsdl.arrays3.testclient.Address[] addrs = null; addrs = binding.getAddressFromNames(null); assertNull("addrs is not null", addrs); // if (addrs != null) System.out.println("addrs.length = " + addrs.length); addrs = binding.getAddressFromNames(new String[] { }); assertNull("addrs is not null", addrs); // if (addrs != null) System.out.println("addrs.length = " + addrs.length); addrs = binding.getAddressFromNames(new String[] { "unknown", "unregistered" }); assertEquals("addrs.length should be 2", addrs.length, 2); System.out.println("addrs.length = " + addrs.length); binding.addEntry("Purdue Boilermaker", addr); test.wsdl.arrays3.testclient.Address retAddr1 = binding.getAddressFromName("Purdue Boilermaker"); binding.addEntry("Boilermaker Purdue", addr); test.wsdl.arrays3.testclient.Address retAddrs[] = binding.getAddressFromNames(new String[] { "Purdue Boilermaker", "Boilermaker Purdue" }); retAddrs = binding.echoAddresses(null); assertNull("retAddrs is not null", retAddrs); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { }); assertNull("retAddrs is not null", retAddrs); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr }); assertEquals("retAddrs.length should be 1", 1, retAddrs.length); assertTrue("addr does not match", compareAddress(addr, retAddrs[0])); addr.setOtherPhones(null); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr }); assertEquals("retAddrs.length should be 1", 1, retAddrs.length); assertTrue("addr does not match", compareAddress(addr, retAddrs[0])); assertNull("retAddrs[0].getOtherPhones() should be null", retAddrs[0].getOtherPhones()); test.wsdl.arrays3.testclient.Phone[] arrph = new test.wsdl.arrays3.testclient.Phone[] { }; addr.setOtherPhones(arrph); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr }); assertEquals("retAddrs.length should be 1", 1, retAddrs.length); assertTrue("addr does not match", compareAddress(addr, retAddrs[0])); //assertNull("retAddrs[0].getOtherPhones() should be null", retAddrs[0].getOtherPhones()); addr.setOtherPhones(arrph); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr }); assertEquals("addrs.length should be 1", 1, retAddrs.length); assertTrue("addr does not match", compareAddress(addr, retAddrs[0])); retAddrs = binding.echoAddresses(new test.wsdl.arrays3.testclient.Address[] { addr, addr }); assertEquals("addrs.length should be 2", 2, retAddrs.length); assertTrue("addr does not match", compareAddress(addr, retAddrs[0])); assertTrue("addr does not match", compareAddress(addr, retAddrs[1])); test.wsdl.arrays3.testclient.Address[] retAddrs2 = binding.echoAddresses(retAddrs); assertEquals("addrs.length should be 2", 2, retAddrs2.length); assertTrue("addr does not match", compareAddress(retAddrs[0], retAddrs2[0])); assertTrue("addr does not match", compareAddress(retAddrs[1], retAddrs2[1])); } public boolean compareAddress(test.wsdl.arrays3.testclient.Address addr1, test.wsdl.arrays3.testclient.Address addr2) { if (addr1 == null && addr2 != null) { throw new AssertionFailedError(""); } if (addr1 != null && addr2 == null) { throw new AssertionFailedError(""); } if (addr1 == null && addr2 == null) { return true; } if (!addr1.getCity().equals(addr2.getCity())) { throw new AssertionFailedError(""); } if (!addr1.getStreetName().equals(addr2.getStreetName())) { throw new AssertionFailedError(""); } if (addr1.getStreetNum() != addr2.getStreetNum()) { throw new AssertionFailedError(""); } if (addr1.getZip() != addr2.getZip()) { throw new AssertionFailedError(""); } if (!comparePhone(addr1.getPhoneNumber(), addr2.getPhoneNumber())) { throw new AssertionFailedError(""); } if (!compareStateType(addr1.getState(), addr2.getState())) { throw new AssertionFailedError(""); } if (!comparePhoneArray(addr1.getOtherPhones(), addr2.getOtherPhones())) { throw new AssertionFailedError(""); } return true; } public boolean comparePhoneArray(test.wsdl.arrays3.testclient.Phone[] arr1, test.wsdl.arrays3.testclient.Phone[] arr2) { if (arr1 == null && arr2 != null) { throw new AssertionFailedError(""); } if (arr1 != null && arr2 == null) { throw new AssertionFailedError(""); } if (arr1 == null && arr2 == null) { return true; } if (arr1.length != arr2.length) { throw new AssertionFailedError(""); } for (int i = 0; i < arr1.length; i++) { if (comparePhone(arr1[i], arr2[i]) == false) { throw new AssertionFailedError(""); } } return true; } public boolean comparePhone(test.wsdl.arrays3.testclient.Phone phone1, test.wsdl.arrays3.testclient.Phone phone2) { if (phone1 == null && phone2 != null) { throw new AssertionFailedError(""); } if (phone1 != null && phone2 == null) { throw new AssertionFailedError(""); } if (phone1 == null && phone2 == null) { return true; } if (phone1.getAreaCode() != phone2.getAreaCode()) { throw new AssertionFailedError(""); } if (!phone1.getExchange().equals(phone2.getExchange())) { throw new AssertionFailedError(""); } if (!phone1.getNumber().equals(phone2.getNumber())) { throw new AssertionFailedError(""); } return true; } public boolean compareStateType(test.wsdl.arrays3.testclient.StateType st1, test.wsdl.arrays3.testclient.StateType st2) { if (st1 == null && st2 != null) { throw new AssertionFailedError(""); } if (st1 != null && st2 == null) { throw new AssertionFailedError(""); } if (st1 == null && st2 == null) { return true; } if (!st1.getState().equals(st2.getState())) { throw new AssertionFailedError(""); } return true; } }
6,618
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/any/AnyTestCase.java
package test.wsdl.any; import test.HttpTestUtil; /** * @author Ashutosh Shahi * * Test to check if MessageElement [] for <any> * includes all elements */ public class AnyTestCase extends junit.framework.TestCase{ public AnyTestCase(java.lang.String name) { super(name); } public void testAny1() throws Exception{ AnyServiceLocator loc = new AnyServiceLocator(); Soap svc = loc.getSoap(HttpTestUtil.getTestEndpoint(loc.getSoapAddress())); QueryResult qr = svc.query("blah"); assertTrue("Records size mismatch", qr.getRecords().length == 1); for (int i =0; i < qr.getRecords().length; i++ ) { SObject s = qr.getRecords(i); System.out.println("id::" + s.getId()); org.apache.axis.message.MessageElement [] e= s.get_any(); System.out.println("MessageElement array size is " + e.length); for (int j = 0; j < e.length; j++ ){ System.out.print(" " + e[j].getValue()); } System.out.println(""); assertTrue("Any should have three elements", e.length == 3); } } public static void main(String[] args) throws Exception{ AnyTestCase at = new AnyTestCase("test"); at.testAny1(); } }
6,619
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/any/SoapBindingImpl.java
/** * SoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis axis-1_2_1 Jun 07, 2005 (05:25:16 IST) WSDL2Java emitter. */ package test.wsdl.any; import org.apache.axis.message.MessageElement; public class SoapBindingImpl implements test.wsdl.any.Soap{ public test.wsdl.any.QueryResult query(java.lang.String queryString) throws java.rmi.RemoteException { QueryResult qr = new QueryResult(); qr.setDone(true); SObject record = new SObject(); record.setType("Contact"); record.setId("00330000006jryXAAQ"); try{ MessageElement m1 = new MessageElement("Id", "sf", "urn:partner.soap.sforce.com"); MessageElement m2 = new MessageElement("FirstName", "sf", "urn:partner.soap.sforce.com"); MessageElement m3 = new MessageElement("LastName", "sf", "urn:partner.soap.sforce.com"); m1.addTextNode("00330000006jryXAAQ"); m2.addTextNode("Fred"); m3.addTextNode("A>B"); MessageElement[] me = new MessageElement[]{m1, m2, m3}; record.set_any(me); } catch(javax.xml.soap.SOAPException e){ } SObject[] records = new SObject[]{record}; qr.setRecords(records); qr.setSize(1); return qr; } }
6,620
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays4/ArrayTest4SOAPBindingImpl.java
/** * ArrayTest4SOAPBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2.1 Jun 12, 2005 (04:49:43 EDT) WSDL2Java emitter. */ package test.wsdl.arrays4; public class ArrayTest4SOAPBindingImpl implements test.wsdl.arrays4.ArrayTest4{ public test.wsdl.arrays4.StructureType echoStruct(test.wsdl.arrays4.StructureType s) throws java.rmi.RemoteException { return s; } }
6,621
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays4/StructureTypeTestCase.java
package test.wsdl.arrays4; import test.HttpTestUtil; /** * StructureTypeTestCase * <p/> * This test only needs to compile, as we are testing to make sure that the * Schema in the WSDL generates the correctly wrapped Integer arrays. */ public class StructureTypeTestCase extends junit.framework.TestCase { public StructureTypeTestCase(String name) { super(name); } public void testEchoStruct() throws Exception { ArrayTest4SOAPBindingStub binding; try { ArrayTest4ServiceLocator loc = new ArrayTest4ServiceLocator(); binding = (ArrayTest4SOAPBindingStub) loc.getArrayTest4(HttpTestUtil.getTestEndpoint(loc.getArrayTest4Address())); } 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); binding._setProperty("sendMultiRefs",Boolean.FALSE); // Test operation Integer a1[] = new Integer[]{new Integer(1), new Integer(2), new Integer(3)}; Integer a2[] = new Integer[] {new Integer(9), new Integer(8), new Integer(7)}; Integer a3[][] = new Integer[][] { {new Integer(1), new Integer(2), new Integer(3)}, {new Integer(9), new Integer(8), new Integer(7)} }; final StructureType inStruct = new StructureType(a1, a2, a3); StructureType value = null; value = binding.echoStruct(inStruct); Integer r1[] = value.getFld1(); assertEquals("return struct #1 didn't match", 1, r1[0].intValue() ); assertEquals("return struct #1 didn't match", 2, r1[1].intValue() ); assertEquals("return struct #1 didn't match", 3, r1[2].intValue() ); Integer r2[] = value.getFld2(); assertEquals("return struct #2 didn't match", 9, r2[0].intValue() ); assertEquals("return struct #2 didn't match", 8, r2[1].intValue() ); assertEquals("return struct #2 didn't match", 7, r2[2].intValue() ); Integer r3[][] = value.getFld3(); assertEquals("return struct #3 didn't match", 1, r3[0][0].intValue() ); assertEquals("return struct #3 didn't match", 2, r3[0][1].intValue() ); assertEquals("return struct #3 didn't match", 3, r3[0][2].intValue() ); assertEquals("return struct #3 didn't match", 9, r3[1][0].intValue() ); assertEquals("return struct #3 didn't match", 8, r3[1][1].intValue() ); assertEquals("return struct #3 didn't match", 7, r3[1][2].intValue() ); } }
6,622
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marshall/MarshallBindingImpl.java
/** * MarshallBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC2 Feb 06, 2005 (12:14:42 EST) WSDL2Java emitter. */ package test.wsdl.marshall; import java.math.BigInteger; public class MarshallBindingImpl implements test.wsdl.marshall.MarshallPortType{ public test.wsdl.marshall.types.MyBean[] myBeanArray(test.wsdl.marshall.types.MyBean[] arrayOfMyBean_1) throws java.rmi.RemoteException { return null; } public test.wsdl.marshall.types.MyBean[][] myBeanMultiArray(test.wsdl.marshall.types.MyBean[][] arrayOfarrayOfMyBean_1) throws java.rmi.RemoteException { return null; } public test.wsdl.marshall.types.MyBean myBean(test.wsdl.marshall.types.MyBean myBean_1) throws java.rmi.RemoteException { return null; } public String[] arrayOfSoapEncString(String[] parameter) throws java.rmi.RemoteException { return parameter; } public String[] arrayOfXsdString(String[] parameter) throws java.rmi.RemoteException { return parameter; } public String[][] arrayOfArrayOfSoapEncString(String[][] parameter) throws java.rmi.RemoteException { return parameter; } public BigInteger[][] arrayOfArrayOfinteger(BigInteger[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfbase64Binary(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfhexBinary(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfsoapencbase64(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfbase64BinaryUnbounded(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfhexBinaryUnbounded(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } public byte[][] arrayOfsoapencbase64Unbounded(byte[][] parameter) throws java.rmi.RemoteException { return parameter; } }
6,623
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marshall/MarshallTestCase.java
/** * MarshallTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC2 Feb 06, 2005 (12:14:42 EST) WSDL2Java emitter. */ package test.wsdl.marshall; import java.math.BigInteger; import java.util.Iterator; import javax.xml.namespace.QName; import org.apache.axis.Message; import org.apache.axis.message.MessageElement; import org.apache.axis.message.SOAPBody; import test.HttpTestUtil; public class MarshallTestCase extends junit.framework.TestCase { private static final String DIMS = "[3]"; public MarshallTestCase(java.lang.String name) { super(name); } public void testMarshallPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory .newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint( new MarshallLocator().getMarshallPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.marshall.MarshallLocator().getServiceName()); assertTrue(service != null); } public void test1MarshallPortMyBeanArray() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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.marshall.types.MyBean[] value = null; value = binding.myBeanArray(new test.wsdl.marshall.types.MyBean[0]); // TBD - validate results } public void test2MarshallPortMyBeanMultiArray() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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.marshall.types.MyBean[][] value = null; value = binding .myBeanMultiArray(new test.wsdl.marshall.types.MyBean[0][0]); // TBD - validate results } public void test3MarshallPortMyBean() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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.marshall.types.MyBean value = null; value = binding.myBean(new test.wsdl.marshall.types.MyBean()); // TBD - validate results } public void test4MarshallPortArrayOfSoapEncString() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 String[] value = new String[] { "1", "2", "", null, "5" }; String[] ret = null; ret = binding.arrayOfSoapEncString(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfSoapEncStringResponse"); QName returnQName = new QName("return"); Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); MessageElement response = body.getChildElement(responseQName); MessageElement returnE = response.getChildElement(returnQName); String arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "soapenc:string[5]", arrayType); // TBD - validate results } public void test5MarshallPortArrayOfXsdString() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 String[] value = new String[] { "1", "2", "", null, "5" }; String[] ret = null; ret = binding.arrayOfXsdString(value); // TBD - validate results QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfXsdStringResponse"); QName returnQName = new QName("return"); Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); MessageElement response = body.getChildElement(responseQName); MessageElement returnE = response.getChildElement(returnQName); String arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "xsd:string[5]", arrayType); } public void test6MarshallPortArrayOfbase64Binary() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding.arrayOfbase64Binary(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfbase64BinaryResponse"); String innerTypeString = "xsd:base64Binary"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test7MarshallPortArrayOfhexBinary() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding.arrayOfhexBinary(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfhexBinaryResponse"); String innerTypeString = "xsd:hexBinary"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test8MarshallPortArrayOfsoapencbase64() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding.arrayOfsoapencbase64(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfsoapencbase64Response"); String innerTypeString = "soapenc:base64"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test9MarshallPortArrayOfbase64BinaryUnbounded() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding .arrayOfbase64BinaryUnbounded(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfbase64BinaryUnboundedResponse"); String innerTypeString = "xsd:base64Binary"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test10MarshallPortArrayOfhexBinaryUnbounded() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding.arrayOfhexBinaryUnbounded(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfhexBinaryUnboundedResponse"); String innerTypeString = "xsd:hexBinary"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test11MarshallPortArrayOfsoapencbase64Unbounded() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 = null; value = binding .arrayOfsoapencbase64Unbounded(getBiDimensionnalByteArray()); // TBD - validate results checkArrayReturnValues(value); QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfsoapencbase64UnboundedResponse"); String innerTypeString = "soapenc:base64"; String arrayTypeString = innerTypeString + DIMS; Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); checkReturnMessage(body, responseQName, arrayTypeString, innerTypeString); } public void test12MarshallPortArrayOfArrayOfSoapEncString() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 String[] v1 = new String[] { "a1", "a2", "", null, "a5", null}; String[] v2 = new String[] { "b1", "b2", "", null, "b5", null }; String[] v3 = new String[] { "c1", "c2", "", null, "c5", null }; String[][] value = new String[][] {v1, v2, v3}; String[][] ret = null; ret = binding.arrayOfArrayOfSoapEncString(value); // print Array for(int i = 0; i < ret.length; i++) { System.out.print("["); for(int j = 0; j < ret[i].length; j++) { System.out.print("[" + ret[i][j] + "]"); } System.out.println("]"); } assertEquals("array size incorrect", value.length, ret.length); for(int i = 0; i < value.length; i++) { assertEquals("array size incorrect", value[i].length, ret[i].length); for(int j = 0; j < value[i].length; j++) { assertEquals("value not equals", value[i][j], ret[i][j]); } } QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfArrayOfSoapEncStringResponse"); QName returnQName = new QName("return"); Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); MessageElement response = body.getChildElement(responseQName); MessageElement returnE = response.getChildElement(returnQName); String arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "soapenc:string[][3]", arrayType); for (Iterator it = returnE.getChildElements(returnQName); it.hasNext();) { returnE = (MessageElement) it.next(); arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "soapenc:string[6]", arrayType); for (Iterator it2 = returnE.getChildElements(returnQName); it2.hasNext();) { returnE = (MessageElement) it2.next(); String xsiType = returnE.getAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type"); assertEquals("wrong xsi type", "soapenc:string", xsiType); } } // TBD - validate results } public void test13MarshallPortArrayOfArrayOfinteger() throws Exception { test.wsdl.marshall.MarshallBindingStub binding; try { MarshallLocator loc = new MarshallLocator(); binding = (MarshallBindingStub)loc.getMarshallPort(HttpTestUtil.getTestEndpoint(loc.getMarshallPortAddress())); } 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 BigInteger[] v1 = new BigInteger[] { new BigInteger("-3254687"), new BigInteger("0"), new BigInteger("3254687"), null}; BigInteger[] v2 = new BigInteger[] { new BigInteger("-3254688"), new BigInteger("0"), new BigInteger("3254688"), null}; BigInteger[] v3 = new BigInteger[] { new BigInteger("-3254689"), new BigInteger("0"), new BigInteger("3254689"), null}; BigInteger[][] value = new BigInteger[][] {v1, v2, v3}; BigInteger[][] ret = null; ret = binding.arrayOfArrayOfinteger(value); // print Array for(int i = 0; i < ret.length; i++) { System.out.print("["); for(int j = 0; j < ret[i].length; j++) { System.out.print("[" + ret[i][j] + "]"); } System.out.println("]"); } assertEquals("array size incorrect", value.length, ret.length); for(int i = 0; i < value.length; i++) { assertEquals("array size incorrect", value[i].length, ret[i].length); for(int j = 0; j < value[i].length; j++) { assertEquals("value not equals", value[i][j], ret[i][j]); } } QName responseQName = new QName("http://marshall.wsdl.test", "ArrayOfArrayOfintegerResponse"); QName returnQName = new QName("return"); Message m = binding._getCall().getResponseMessage(); SOAPBody body = (SOAPBody) m.getSOAPBody(); MessageElement response = body.getChildElement(responseQName); MessageElement returnE = response.getChildElement(returnQName); String arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "xsd:integer[][3]", arrayType); for (Iterator it = returnE.getChildElements(returnQName); it.hasNext();) { returnE = (MessageElement) it.next(); arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", "xsd:integer[4]", arrayType); for (Iterator it2 = returnE.getChildElements(returnQName); it2.hasNext();) { returnE = (MessageElement) it2.next(); // we have multiRef to follow here MessageElement real = returnE.getRealElement(); String xsiType = real.getAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type"); assertEquals("wrong xsi type", "xsd:integer", xsiType); } } // TBD - validate results } /** * @param m */ private void printMessage(Message m) throws Exception { System.out.println(); m.writeTo(System.out); System.out.println(); } /** * @param responseQName * @param arrayTypeString * @param innerTypeString */ private void checkReturnMessage(SOAPBody body, QName responseQName, String arrayTypeString, String innerTypeString) { // Message should looks like this : // ns:<methodName>Response // return @soapenc:arrayType // return @xsi:type QName returnQName = new QName("return"); MessageElement response = body.getChildElement(responseQName); // check arrayType attribute MessageElement returnE = response.getChildElement(returnQName); String arrayType = returnE.getAttributeNS( "http://schemas.xmlsoap.org/soap/encoding/", "arrayType"); assertEquals("wrong array type", arrayTypeString, arrayType); for (Iterator i = returnE.getChildElements(returnQName); i.hasNext();) { MessageElement ret = (MessageElement) i.next(); String xsiType = ret.getAttributeNS( "http://www.w3.org/2001/XMLSchema-instance", "type"); assertNotNull("should have an xsi:type attribute", xsiType); assertEquals("wrong xsi:type", innerTypeString, xsiType); } } /** * @param value */ private void checkArrayReturnValues(byte[][] value) { assertEquals("wrong array length", 3, value.length); assertEquals("wrong subarray length", 3, value[0].length); assertEquals("wrong subarray length", 3, value[1].length); assertEquals("wrong subarray length", 3, value[2].length); assertEquals("wrong value[0][0]", -127, value[0][0]); assertEquals("wrong value[0][1]", 0, value[0][1]); assertEquals("wrong value[0][2]", 127, value[0][2]); assertEquals("wrong value[1][0]", -127, value[1][0]); assertEquals("wrong value[1][1]", 0, value[1][1]); assertEquals("wrong value[1][2]", 127, value[1][2]); assertEquals("wrong value[2][0]", -127, value[2][0]); assertEquals("wrong value[2][1]", 0, value[2][1]); assertEquals("wrong value[2][2]", 127, value[2][2]); } /** * @return */ private byte[][] getBiDimensionnalByteArray() { byte[][] array = new byte[3][]; array[0] = new byte[3]; array[1] = new byte[3]; array[2] = new byte[3]; array[0][0] = -127; array[0][1] = 0; array[0][2] = 127; array[1][0] = -127; array[1][1] = 0; array[1][2] = 127; array[2][0] = -127; array[2][1] = 0; array[2][2] = 127; return array; } }
6,624
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/map/MapServiceSoapBindingImpl.java
/** * MapServiceSoapBindingImpl.java * * Implementation of the Map service used after we convert from Java to WSDL * then back to Java again. Should be identical to MapService.java */ package test.wsdl.map; import java.util.Map; import java.util.HashMap; public class MapServiceSoapBindingImpl implements test.wsdl.map.MapService{ /** * echo the input Map */ public HashMap echoMap(HashMap in) { return in; } }
6,625
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/map/MapServiceTestCase.java
/** * MapServiceServiceTestCase.java * */ package test.wsdl.map; import java.util.Map; import java.util.HashMap; import test.HttpTestUtil; public class MapServiceTestCase extends junit.framework.TestCase { public MapServiceTestCase(java.lang.String name) { super(name); } public void test1EchoMap() throws Exception { test.wsdl.map.MapService binding; try { MapServiceServiceLocator loc = new MapServiceServiceLocator(); binding = loc.getMapService(HttpTestUtil.getTestEndpoint(loc.getMapServiceAddress())); } 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); // populate test data HashMap m = new HashMap(); String stringKey = "stringKey"; String stringVal = "stringValue"; m.put(stringKey, stringVal); Integer intKey = new Integer(77); Double doubleVal = new Double(3.14159); m.put(intKey, doubleVal); Long longKey = new Long("1231231231"); Boolean boolVal = new Boolean(true); m.put(longKey, boolVal); String[] stringArrayKey = new String[] {"array1", "array2"}; Integer[] intArray = new Integer[] {new Integer(1), new Integer(2)}; m.put(stringArrayKey, intArray ); Long[] longArrayKey = new Long[] {new Long("1000001"), new Long(2000002)}; Boolean[] boolArray = new Boolean[]{ new Boolean(true), new Boolean(false)}; m.put(longArrayKey, boolArray); // Test operation Map outMap = binding.echoMap(m); // Verify return map Object value; value = outMap.get(stringKey); assertNotNull("Can not find entry for STRING key", value); assertEquals("The class of the map value does not match", String.class.getName(), value.getClass().getName()); assertEquals("The value does not match", stringVal, (String) value); value = outMap.get(intKey); assertNotNull("Can not find entry for INTEGER key", value); assertEquals("The class of the map value does not match", Double.class.getName(), value.getClass().getName()); assertEquals("The value does not match", (Double) value, doubleVal); value = outMap.get(longKey); assertNotNull("Can not find entry for LONG key", value); assertEquals("The class of the map value does not match", Boolean.class.getName(), value.getClass().getName()); assertEquals("The value does not match", boolVal, (Boolean) value); // This is a pain because a get with the orignal keys wont return entries in the new map java.util.Iterator it = outMap.keySet().iterator(); boolean foundInt = false; boolean foundBool = false; while (it.hasNext()) { Object oKey = it.next(); if (oKey.getClass().isArray()) { Object[] oArrayKey = (Object[]) oKey; Object oValue = outMap.get(oKey); if (String.class.getName().equals(oArrayKey[0].getClass().getName())) { // Verify Key data String[] sArray = (String[]) oArrayKey; for (int i = 0; i < sArray.length; i++) { assertEquals("STRING Array KEY data does not match", stringArrayKey[i], sArray[i]); } // verify value data assertTrue("The Array VALUE does not match", oValue.getClass().isArray()); Object[] oArrayValue = (Object[]) oValue; assertEquals("Class of the array does not match epected", Integer.class.getName(), oArrayValue[0].getClass().getName()); Integer[] ia = (Integer[]) oValue; for (int i = 0; i < ia.length; i++) { assertEquals("INTEGER Array VALUE does not match", intArray[i], ia[i]); } foundInt = true; } else if (Long.class.getName().equals(oArrayKey[0].getClass().getName())) { // verify Key data Long[] lArray = (Long[]) oArrayKey; for (int i = 0; i < lArray.length; i++) { assertEquals("LONG Array KEY data does not match", longArrayKey[i], lArray[i]); } // verify value data assertTrue("The Array VALUE does not match", oValue.getClass().isArray()); Object[] oArrayValue = (Object[]) oValue; assertEquals("Class of the array does not match epected", Boolean.class.getName(), oArrayValue[0].getClass().getName()); Boolean[] ba = (Boolean[]) oValue; for (int i = 0; i < ba.length; i++) { assertEquals("BOOLEAN Array VALUE does not match", boolArray[i], ba[i]); } foundBool = true; } } } if (!foundInt || ! foundBool) { assertTrue("Unable to find integer or boolean key in returned Map", false); } } }
6,626
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays2/TestArrays2TestCase.java
package test.wsdl.arrays2; 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 test.wsdl.arrays2.data.*; import test.wsdl.arrays2.data.inner.*; import java.util.Vector; public class TestArrays2TestCase extends junit.framework.TestCase { public TestArrays2TestCase(String name) { super(name); } private static AxisServer server = new AxisServer(); private static String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" + " <env:Header/>\n" + " <env:Body env:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" + " <m:getDataOperationResponse xmlns:m=\"http://www.xyz.net/webservices/arraytest/1.0\">\n" + " <dataResponse xmlns:n1=\"http://www.xyz.net/schemas/arraytest/data/1.0\" xsi:type=\"n1:dataType\">\n" + " <innerData soapenc:arrayType=\"n2:innerDataType[10]\" xmlns:n2=\"http://www.xyz.net/schemas/arraytest/innerdata/1.0\">\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#0 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#1 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#2 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#3 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#4 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#5 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#6 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#7 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#8 HELLO! </trDescr>\n" + " </innerDataType>\n" + " <innerDataType xsi:type=\"n2:innerDataType\">\n" + " <trDescr xsi:type=\"n2:trDescrType\">\n" + "desc#9 HELLO! </trDescr>\n" + " </innerDataType>\n" + " </innerData>\n" + " </dataResponse>\n" + " </m:getDataOperationResponse>\n" + " </env:Body>\n" + "</env:Envelope>"; public void testBug22213() throws Exception { 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(test.wsdl.arrays2.data.DataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType"), new org.apache.axis.encoding.ser.BeanSerializerFactory( test.wsdl.arrays2.data.DataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType")), new org.apache.axis.encoding.ser.BeanDeserializerFactory( test.wsdl.arrays2.data.DataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType"))); tm.register(InnerDataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType"), new org.apache.axis.encoding.ser.BeanSerializerFactory( InnerDataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType")), new org.apache.axis.encoding.ser.BeanDeserializerFactory( InnerDataType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataType"))); tm.register(String.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType"), new org.apache.axis.encoding.ser.SimpleSerializerFactory( String.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType")), new org.apache.axis.encoding.ser.SimpleDeserializerFactory( String.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "trDescrType"))); tm.register(DataRequestType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType"), new org.apache.axis.encoding.ser.BeanSerializerFactory( DataRequestType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType")), new org.apache.axis.encoding.ser.BeanDeserializerFactory( DataRequestType.class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "dataRequestType"))); tm.register(InnerDataType[].class, new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/innerdata/1.0", "innerDataArrType"), new org.apache.axis.encoding.ser.ArraySerializerFactory(), new org.apache.axis.encoding.ser.ArrayDeserializerFactory()); Message message = new Message(xml); message.setMessageContext(new MessageContext(server)); SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPEnvelope(); RPCElement body = (RPCElement) envelope.getFirstBody(); Vector arglist = body.getParams(); RPCParam param = (RPCParam) arglist.get(0); DataType result = (DataType) param.getObjectValue(); System.out.println(result); assertTrue(result != null); InnerDataType inner[] = result.getInnerData(); assertTrue(inner != null); assertEquals(inner.length, 10); assertEquals(inner[9].getTrDescr().trim(),"desc#9 HELLO!"); } }
6,627
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped_inout/WrappedInOutSoapImpl.java
/** * WrappedInOutSoapImpl.java * * Tests .NET WSDL and functional signatures generated by WSDL2Java */ package test.wsdl.wrapped_inout; public class WrappedInOutSoapImpl implements test.wsdl.wrapped_inout.WrappedInOutInterface{ public java.lang.String echoString(java.lang.String inarg) throws java.rmi.RemoteException { return inarg; } public java.lang.String echoStringIO(java.lang.String ioarg) throws java.rmi.RemoteException { return ioarg; } public java.lang.String echoStringIOret(javax.xml.rpc.holders.StringHolder ioarg) throws java.rmi.RemoteException { if (!ioarg.value.equals("in1")) { throw new java.rmi.RemoteException("Input argument didn't match expected 'in1', got: " + ioarg.value); } ioarg.value = "out1"; return "return"; } public void echoStringInIO(java.lang.String inarg, javax.xml.rpc.holders.StringHolder ioarg) throws java.rmi.RemoteException { ioarg.value = inarg; } public java.lang.String echoStringBig(java.lang.String inarg, javax.xml.rpc.holders.StringHolder ioarg1, javax.xml.rpc.holders.StringHolder ioarg2) throws java.rmi.RemoteException { ioarg1.value = "out1"; ioarg2.value = "out2"; return inarg; } public void helloInOut(javax.xml.rpc.holders.StringHolder inout1, javax.xml.rpc.holders.StringHolder inout2, javax.xml.rpc.holders.StringHolder inout3, javax.xml.rpc.holders.StringHolder inout4, java.lang.String inonly) throws java.rmi.RemoteException { inout1.value = "out1"; inout2.value = "out2"; inout3.value = "out3"; inout4.value = "out4"; if (!inonly.equals("onlyInput")) { throw new java.rmi.RemoteException("Input argument didn't match expected 'onlyInput', got: " + inonly); } } public test.wsdl.wrapped_inout.Phone echoPhone(test.wsdl.wrapped_inout.Phone input) throws java.rmi.RemoteException { return input; } }
6,628
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped_inout/WrappedInOutTestCase.java
/** * WrappedInOutTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.wrapped_inout; import test.HttpTestUtil; public class WrappedInOutTestCase extends junit.framework.TestCase { public WrappedInOutTestCase(java.lang.String name) { super(name); } public void test1WrappedInOutEchoString() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); java.lang.String expected = new String("This is a test"); java.lang.String value = null; value = binding.echoString(expected); assertEquals(value, expected); } public void test1WrappedInOutEchoEmptyString() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); java.lang.String expected = new String(""); java.lang.String value = null; value = binding.echoString(expected); assertEquals(value, expected); } public void test2WrappedInOutEchoStringIO() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); java.lang.String expected = new String("This is a test"); java.lang.String value = null; value = binding.echoStringIO(expected); assertEquals(value, expected); } public void test3WrappedInOutEchoStringIOret() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); java.lang.String value = null; javax.xml.rpc.holders.StringHolder ioarg = new javax.xml.rpc.holders.StringHolder("in1"); value = binding.echoStringIOret(ioarg); assertEquals(value, "return"); assertNotNull(ioarg); assertEquals(ioarg.value, "out1"); } public void test4WrappedInOutEchoStringInIO() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); javax.xml.rpc.holders.StringHolder holder = new javax.xml.rpc.holders.StringHolder("in2"); binding.echoStringInIO("in1", holder); assertNotNull(holder); assertEquals(holder.value, "in1"); } public void test5WrappedInOutEchoStringBig() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); java.lang.String value = null; javax.xml.rpc.holders.StringHolder ioarg1 = new javax.xml.rpc.holders.StringHolder("ioarg1"); javax.xml.rpc.holders.StringHolder ioarg2 = new javax.xml.rpc.holders.StringHolder("ioarg2"); value = binding.echoStringBig("firstin1", ioarg1, ioarg2); assertNotNull(value); assertEquals(value, "firstin1"); assertEquals(ioarg1.value, "out1"); assertEquals(ioarg2.value, "out2"); } public void test6WrappedInOutHelloInOut() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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); javax.xml.rpc.holders.StringHolder ioarg1 = new javax.xml.rpc.holders.StringHolder("ioarg1"); javax.xml.rpc.holders.StringHolder ioarg2 = new javax.xml.rpc.holders.StringHolder("ioarg2"); javax.xml.rpc.holders.StringHolder ioarg3 = new javax.xml.rpc.holders.StringHolder("ioarg3"); javax.xml.rpc.holders.StringHolder ioarg4 = new javax.xml.rpc.holders.StringHolder("ioarg4"); binding.helloInOut(ioarg1, ioarg2, ioarg3, ioarg4, "onlyInput"); assertEquals(ioarg1.value, "out1"); assertEquals(ioarg2.value, "out2"); assertEquals(ioarg3.value, "out3"); assertEquals(ioarg4.value, "out4"); } public void test7WrappedInOutEchoPhone() throws Exception { test.wsdl.wrapped_inout.WrappedInOutInterface binding; try { WrappedInOutLocator loc = new WrappedInOutLocator(); binding = loc.getWrappedInOut(HttpTestUtil.getTestEndpoint(loc.getWrappedInOutAddress())); } 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.wsdl.wrapped_inout.Phone value = null; test.wsdl.wrapped_inout.Phone in = new test.wsdl.wrapped_inout.Phone(); in.setAreaCode("503"); in.setPrefix("281"); in.setNumber("0816"); value = binding.echoPhone(in); assertNotNull(value); assertEquals(value, in); } }
6,629
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays/PersonalInfoBookSOAPBindingImpl.java
/** * PersonalInfoBookSOAPBindingImpl.java * * Hand-modified */ package test.wsdl.arrays; import java.util.HashMap; import java.util.Map; import java.util.Vector; public class PersonalInfoBookSOAPBindingImpl implements test.wsdl.arrays.PersonalInfoBook { private Map table = new HashMap(); public void addEntry(java.lang.String name, test.wsdl.arrays.PersonalInfo info) throws java.rmi.RemoteException { this.table.put(name, info); } public test.wsdl.arrays.PersonalInfo getPersonalInfoFromName(java.lang.String name) throws java.rmi.RemoteException { return (test.wsdl.arrays.PersonalInfo) table.get(name); } public Vector getPetsFromName(java.lang.String name) throws java.rmi.RemoteException { return ((test.wsdl.arrays.PersonalInfo) table.get(name)).getPets(); } public int[] getIDFromName(java.lang.String name) throws java.rmi.RemoteException { return ((test.wsdl.arrays.PersonalInfo) table.get(name)).getId(); } public int getID2FromName(java.lang.String name) throws java.rmi.RemoteException { return ((test.wsdl.arrays.PersonalInfo) table.get(name)).getId2(); } }
6,630
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/arrays/PersonalInfoBookServiceTestCase.java
/** * PersonalInfoBookServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.arrays; import java.util.Vector; import test.HttpTestUtil; public class PersonalInfoBookServiceTestCase extends junit.framework.TestCase { public PersonalInfoBookServiceTestCase(String name) { super(name); } public void testPersonalInfoBook() throws Exception { // Set up some testcase values String name = "Joe Geek"; String[] movies = new String[] { "Star Trek", "A.I." }; String[] hobbies= new String[] { "programming", "reading about programming" }; Vector pets = new Vector(); pets.add(new String("Byte")); pets.add(new String("Nibbles")); //String[] pets = new String[] { "Byte", "Nibbles" }; int[] id = new int[] { 0, 0, 7 }; int id2 = 123; String[] foods = new String[] { "Cheeze Whiz", "Jolt Cola" }; byte[] nickName = new byte[] { (byte)'g', (byte)'e', (byte)'e', (byte)'k'}; PersonalInfo pi = new PersonalInfo(); pi.setName(name); pi.setFavoriteMovies(movies); pi.setHobbies(hobbies); pi.setPets(pets); pi.setId(id); pi.setId2(id2); pi.setFoods(foods); pi.setNickName(nickName); // Get the stub and set Session test.wsdl.arrays.PersonalInfoBook binding; PersonalInfoBookServiceLocator loc = new PersonalInfoBookServiceLocator(); binding = loc.getPersonalInfoBook(HttpTestUtil.getTestEndpoint(loc.getPersonalInfoBookAddress())); assertTrue("binding is null", binding != null); ((PersonalInfoBookSOAPBindingStub) binding).setMaintainSession (true); // Add the name and personal info for Joe Geek binding.addEntry(name, pi); // Now get the personal info and check validity test.wsdl.arrays.PersonalInfo value = null; value = binding.getPersonalInfoFromName(name); assertTrue("Name is corrupted " + value, value.getName().equals(pi.getName())); assertTrue("Movies are corrupted " + value, value.getFavoriteMovies()[1].equals(pi.getFavoriteMovies()[1])); assertTrue("Hobbies are corrupted " + value, value.getHobbies()[1].equals(pi.getHobbies()[1])); assertTrue("Pets are corrupted " + value, value.getPets().elementAt(1).equals(pi.getPets().elementAt(1))); assertTrue("Id is corrupted " + value, value.getId()[0] == 0 && value.getId()[1] == 0 && value.getId()[2] == 7); assertTrue("Id2 is corrupted " + value, value.getId2() == pi.getId2()); assertTrue("Food are corrupted " + value, value.getFoods(1).equals(pi.getFoods(1))); assertTrue("Nickname is corrupted " + value, value.getNickName()[1] == pi.getNickName()[1]); Vector value2 = null; value2 = binding.getPetsFromName(name); assertTrue("PetsFromName is broken " + value2, value2.elementAt(1).equals(pi.getPets().elementAt(1))); int[] value3 = null; value3 = binding.getIDFromName(name); assertTrue("getIDFromName is brokent " + value3, value3[0] == 0 && value3[1] == 0 && value3[2] == 7); int value4 = -3; value4 = binding.getID2FromName(name); assertTrue("getID2FromName is brokent " + value4, value4 == pi.getId2()); } }
6,631
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpchandler2/EchoServiceServerHandler3.java
package test.wsdl.jaxrpchandler2; import org.w3c.dom.Node; 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.SOAPMessage; public class EchoServiceServerHandler3 implements Handler { private HandlerInfo info; public void init(HandlerInfo handlerInfo) { info = handlerInfo; } public void destroy() { } public QName[] getHeaders() { return info.getHeaders(); } public boolean handleRequest(MessageContext mc) { try { SOAPMessage msg = ((SOAPMessageContext) mc).getMessage(); Node child = msg.getSOAPPart().getEnvelope().getBody() .getFirstChild() .getFirstChild() .getFirstChild(); String name = child.getNodeValue(); if (name != null && name.equals("Joe")) { child.setNodeValue("Sam"); } return true; } catch (Exception ex) { ex.printStackTrace(); return false; } } public boolean handleResponse(MessageContext mc) { return true; } public boolean handleFault(MessageContext mc) { return true; } }
6,632
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpchandler2/EchoServiceImpl.java
package test.wsdl.jaxrpchandler2; public class EchoServiceImpl { public String echo(String echoString) { return echoString; } }
6,633
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpchandler2/EchoServiceServerHandler.java
package test.wsdl.jaxrpchandler2; import java.io.*; import java.io.InputStream; import java.util.*; import java.util.Iterator; import javax.xml.namespace.QName; import javax.xml.rpc.handler.*; import javax.xml.rpc.handler.soap.SOAPMessageContext; import javax.xml.soap.*; import javax.xml.soap.SOAPMessage; import javax.xml.transform.stream.*; public class EchoServiceServerHandler implements Handler { public boolean handleRequest(MessageContext messageContext) { try { SOAPMessageContext soapMsgCtx = (SOAPMessageContext) messageContext; SOAPMessage soapMsg = soapMsgCtx.getMessage(); SOAPPart soapPart = soapMsg.getSOAPPart(); SOAPEnvelope soapEnvelope = soapPart.getEnvelope(); soapEnvelope.getBody().detachNode(); SOAPBody soapBody = soapEnvelope.addBody(); SOAPBodyElement echoElement = soapBody.addBodyElement(soapEnvelope.createName("echo", "ns1", "http://soapinterop.org/")); SOAPElement argElement = echoElement.addChildElement("arg0"); argElement = argElement.addAttribute(soapEnvelope.createName("type", "xsi", "http://www.w3.org/2001/XMLSchema-instance"), "xsd:string"); argElement.addTextNode("my echo string"); } catch (Exception e) { e.printStackTrace(); } return true; } public boolean handleResponse(MessageContext messageContext) { return true; } public boolean handleFault(MessageContext messageContext) { return true; } public void init(HandlerInfo arg0) { } public void destroy() { } public QName[] getHeaders() { return null; } }
6,634
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/jaxrpchandler2/JAXRPCHandler2TestCase.java
package test.wsdl.jaxrpchandler2; import junit.framework.TestCase; import javax.xml.namespace.QName; import javax.xml.rpc.Call; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory; import test.HttpTestUtil; import java.rmi.RemoteException; public class JAXRPCHandler2TestCase extends TestCase { public JAXRPCHandler2TestCase(String arg0) { super(arg0); } public void testJAXRPCHandler2() throws Exception { String serviceEndpointUrl = HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/EchoService2").toString(); String qnameService = "EchoService2"; String qnamePort = "EchoServicePort"; Call call; String echoString = "my echo string"; ServiceFactory serviceFactory = ServiceFactory.newInstance(); Service service = serviceFactory.createService(new QName(qnameService)); call = service.createCall(new QName(qnamePort)); call.setTargetEndpointAddress(serviceEndpointUrl); call.setOperationName(new QName("http://soapinterop.org/", "echo")); String returnString = null; try { returnString = (String) call.invoke(new Object[]{echoString}); } catch (RemoteException e) { e.printStackTrace(); fail("Remote exception while calling invoke"); } assertEquals("returnString does not match echoString", echoString, returnString); } public void testJAXRPCHandler3() throws Exception { String serviceEndpointUrl = HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/EchoService3").toString(); String qnameService = "EchoService3"; String qnamePort = "EchoServicePort"; Call call; String echoString = "Joe"; ServiceFactory serviceFactory = ServiceFactory.newInstance(); Service service = serviceFactory.createService(new QName(qnameService)); call = service.createCall(new QName(qnamePort)); call.setTargetEndpointAddress(serviceEndpointUrl); call.setOperationName(new QName("http://soapinterop.org/", "echo")); String returnString = null; try { returnString = (String) call.invoke(new Object[]{echoString}); } catch (RemoteException e) { e.printStackTrace(); fail("Remote exception while calling invoke"); } assertEquals( "Sam", returnString); } protected void setUp() throws Exception { super.setUp(); } }
6,635
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/getPort/GetPortTestCase.java
package test.wsdl.getPort; import javax.xml.namespace.QName; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceException; import javax.xml.rpc.Stub; import java.util.Iterator; // This test makes sure that the getPort method works in various service classes. public class GetPortTestCase extends junit.framework.TestCase { private static final QName portAOne = new QName("portAOne"); private static final QName portATwo = new QName("portATwo"); private static final QName portAThree = new QName("portAThree"); private static final QName portBOne = new QName("portBOne"); private static final QName portBTwo = new QName("portBTwo"); private static final QName portBTwoA = new QName("portBTwoA"); private static final QName portCOne = new QName("portCOne"); private static final QName portCTwo = new QName("portCTwo"); private static final QName portCThree = new QName("portCThree"); private static final String ADR_PORTAONE = "http://localhost:8080/axis/services/portAOne"; private static final String ADR_PORTATWO = "http://localhost:8080/axis/services/portATwo"; private static final String ADR_PORTATHREE = "http://localhost:8080/axis/services/portAThree"; public GetPortTestCase(String name) { super(name); } // ctor public void testEmptyService() { Empty empty = new EmptyLocator(); try { empty.getPort(null); fail("empty.getPort(null) should have failed."); } catch (ServiceException se) { assertTrue("Wrong exception! " + se.getLinkedCause(), se.getLinkedCause() == null); } } // testEmptyService /* <service name="serviceA"> <documentation> Service with all ports unique. /-- Test Bug 13407 - embedded comments --/ </documentation> <port name="portAOne" binding="tns:bindingOne"> <soap:address location="http://localhost:8080/axis/services/portAOne"/> </port> <port name="portATwo" binding="tns:bindingTwo"> <soap:address location="http://localhost:8080/axis/services/portATwo"/> </port> <port name="portAThree" binding="tns:bindingThree"> <soap:address location="http://localhost:8080/axis/services/portAThree"/> </port> </service> */ public void testNormalService() { ServiceA service = new ServiceALocator(); try { One one = (One) service.getPort(One.class); Two two = (Two) service.getPort(Two.class); Three three = (Three) service.getPort(Three.class); } catch (Throwable t) { fail("Should not have gotten an exception: " + t); } try { service.getPort(java.util.Vector.class); fail("service.getPort(Vector.class) should have failed."); } catch (ServiceException se) { assertTrue("Wrong exception! " + se.getLinkedCause(), se.getLinkedCause() == null); } // Make sure we get the proper ports try { Stub one = (Stub) service.getPort(portAOne, One.class); Stub two = (Stub) service.getPort(portATwo, Two.class); Stub three = (Stub) service.getPort(portAThree, Three.class); assertTrue("getPort(portAOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); assertTrue("getPort(portAOne) should have " + ADR_PORTAONE + ", instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), ADR_PORTAONE.equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portATwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); assertTrue("getPort(portATwo) should have address " + ADR_PORTATWO + ", instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), ADR_PORTATWO.equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portAThree) should be of type Three, instead it is " + three.getClass().getName(), three instanceof Three); assertTrue("getPort(portAThree) should have address " + ADR_PORTATHREE + ", instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), ADR_PORTATHREE.equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); } } // testNormalService /* <service name="serviceB"> <documentation> Service with two ports (portBTwo, portBTwoA) that share the same portType via the same binding. </documentation> <port name="portBOne" binding="tns:bindingOne"> <soap:address location="http://localhost:8080/axis/services/portOne"/> </port> <port name="portBTwo" binding="tns:bindingTwo"> <soap:address location="http://localhost:8080/axis/services/portBTwo"/> </port> <port name="portBTwoA" binding="tns:bindingTwo"> <soap:address location="http://localhost:8080/axis/services/portBTwoA"/> </port> </service> */ public void testDoublePortService1() { ServiceB service = new ServiceBLocator(); try { One one = (One) service.getPort(One.class); Two two = (Two) service.getPort(Two.class); } catch (Throwable t) { fail("Should not have gotten an exception: " + t); } try { service.getPort(Three.class); fail("service.getPort(Three.class) should have failed."); } catch (ServiceException se) { assertTrue("Wrong exception! " + se.getLinkedCause(), se.getLinkedCause() == null); } // Make sure we get the proper ports try { Stub one = (Stub) service.getPort(portBOne, One.class); Stub two = (Stub) service.getPort(portBTwo, Two.class); Stub three = (Stub) service.getPort(portBTwoA, Two.class); assertTrue("getPort(portBOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); assertTrue("getPort(portBOne) should have address http://localhost:8080/axis/services/portBOne," + " instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portBOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portBTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); assertTrue("getPort(portBTwo) should have address" + "http://localhost:8080/axis/services/portBTwo," + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY) + ", port is " + two.toString(), "http://localhost:8080/axis/services/portBTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portBTwoA) should be of type Two, instead it is " + three.getClass().getName(), three instanceof Two); assertTrue("getPort(portBTwoA) should have address " + "http://localhost:8080/axis/services/portBTwoA, " + "instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portBTwoA".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); } } // testDoublePortService1 /* * <service name="serviceC"> <documentation> Service with two ports (portCTwo, portCThree) that share the same portType via different bindings. </documentation> <port name="portCOne" binding="tns:bindingOne"> <soap:address location="http://localhost:8080/axis/services/portCOne"/> </port> <port name="portCTwo" binding="tns:bindingTwo"> <soap:address location="http://localhost:8080/axis/services/portCTwo"/> </port> <port name="portCThree" binding="tns:bindingAnotherOne"> <soap:address location="http://localhost:8080/axis/services/portCThree"/> </port> </service> */ public void testDoublePortService2() { ServiceC service = new ServiceCLocator(); try { One one = (One) service.getPort(One.class); Two two = (Two) service.getPort(Two.class); } catch (Throwable t) { fail("Should not have gotten an exception: " + t); } try { service.getPort(Three.class); fail("service.getPort(Three.class) should have failed."); } catch (ServiceException se) { assertTrue("Wrong exception! " + se.getLinkedCause(), se.getLinkedCause() == null); } // Make sure we get the proper ports try { Stub one = (Stub) service.getPort(portCOne, One.class); Stub two = (Stub) service.getPort(portCTwo, Two.class); Stub three = (Stub) service.getPort(portCThree, Three.class); assertTrue("getPort(portCOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); assertTrue("getPort(portCOne) should have address " + "http://localhost:8080/axis/services/portCOne, " + "instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portCOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portCTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); assertTrue("getPort(portCTwo) should have address " + "http://localhost:8080/axis/services/portCTwo, " + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portCTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); assertTrue("getPort(portCThree) should be of type One, instead it is " + three.getClass().getName(), three instanceof One); assertTrue("getPort(portCThree) should have address " + "http://localhost:8080/axis/services/portCThree," + " instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portCThree".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); } } // testDoublePortService2 public void testGetPorts() { Service service = null; try { service = new EmptyLocator(); verifyNumberOfPorts("Empty", service.getPorts(), 0); } catch (ServiceException se) { fail("EmptyLocator.getPorts() should not have failed: " + se); } try { service = new ServiceALocator(); verifyNumberOfPorts("ServiceA", service.getPorts(), 3); } catch (ServiceException se) { fail("ServiceA.getPorts() should not have failed: " + se); } try { service = new ServiceBLocator(); verifyNumberOfPorts("ServiceB", service.getPorts(), 3); } catch (ServiceException se) { fail("ServiceB.getPorts() should not have failed: " + se); } try { service = new ServiceCLocator(); verifyNumberOfPorts("ServiceC", service.getPorts(), 3); } catch (ServiceException se) { fail("ServiceC.getPorts() should not have failed: " + se); } } // testGetPorts private void verifyNumberOfPorts(String service, Iterator i, int shouldHave) { int count = 0; for (;i.hasNext();count++,i.next()); assertTrue("Service " + service + " should have " + shouldHave + " ports but instead has " + count, shouldHave == count); } // verifyNumberOfPorts } // class VerifyTestCase
6,636
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/union/UnionServiceTestCase.java
package test.wsdl.union; import java.util.Date; import java.util.Calendar; import org.apache.axis.types.URI; import org.apache.axis.encoding.ser.CalendarSerializer; import junit.framework.TestCase; public class UnionServiceTestCase extends TestCase { public UnionServiceTestCase(String name) { super(name); } public void testBasicUnion1() 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 right beans // so, basically, if this compiles, we are good to go // but running it won't hurt anything FooOpenEnum e = null; String testStrURI = "http://foobar/A"; e = new FooOpenEnum(testStrURI); assertEquals(testStrURI, e.toString()); URI testURI = new URI(testStrURI); e = new FooOpenEnum(testURI); assertEquals(testStrURI, e.toString()); assertEquals(testURI, e.getAnyURIValue()); e = new FooOpenEnum(FooEnum.value1); assertEquals(FooEnum.value1.toString(), e.toString()); assertEquals(FooEnum.value1, e.getFooEnumValue()); assertEquals(FooEnum._value1, e.getAnyURIValue()); } public void testBasicUnion2() 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 right beans // so, basically, if this compiles, we are good to go // but running it won't hurt anything DateOrDateTimeType type = null; type = new DateOrDateTimeType(5); assertEquals("5", type.toString()); type = new DateOrDateTimeType(false); assertEquals("false", type.toString()); Date date = new Date(); type = new DateOrDateTimeType(date); assertEquals(date.toString(), type.toString()); Calendar cal = Calendar.getInstance(); type = new DateOrDateTimeType(cal); CalendarSerializer cs = new CalendarSerializer(); assertEquals(cs.getValueAsString(cal, null), type.toString()); } }
6,637
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped/City_BBBBindingImpl.java
/** * CityBBBBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.wrapped; public class City_BBBBindingImpl implements City_BBBPortType { public static final String OID_STRING = "Attraction@cityCF::1028:1028"; public Attraction getAttraction(String attname) throws java.rmi.RemoteException { // The only acceptable attNames are Christmas and Xmas // Apparently no one ones to go to New Orleans for Mardi Gras. :-) if (attname == null || !(attname.equals("Christmas") || attname.equals("Xmas"))) { return null; } Attraction attraction = new Attraction(); attraction.set_OID(OID_STRING); attraction.setFacts("New Orleans at Christmastime is a city with the best food in the world, the best music" + " in the world, international shopping, the French Quarter -- America&apos;s most " + " romantic neighborhood, and the friendliest, most big-hearted people you&apos;d ever " + " want to share a rousing celebration with. New Orleans is a natural place for Christmas " + " merry making, and if it is not, then, to quote a New Orleans R&amp;B classic, " + " &apos;grits ain&apos;t groceries, eggs ain&apos;t poultry, and Mona Lisa was a " + " man.&apos; Indeed, Christmas is an especially great time to come because New Orleans " + " hotels have attractive Papa Noel rates. Throughout the month of December, New Orleans " + " will be decorated like never before, which is saying a lot for a town that loves " + " exhibitionism. From the quaint, light-entwined cast iron lamp posts to the historic " + " houses and museums bright in their period holiday garb, the French Quarter will sparkle "+ " like an antique toy store. The twinkling lights and the cheery voices of carolers will " + " have you dancing and prancing through Jackson Square, in the jingle bell air. Riverwalk "+ " shopping center is a leader in the celebrations, launching brass band parades twice " + " daily that include the grand ol&apos; rogue, Papa Noel, and putting on a light show " + " every evening in Spanish Plaza. Woldenberg Park, on the riverfront, will decorate the " + " night with commissioned light sculptures by local artists. First National Bank of " + " Commerce is sponsoring free nightly concerts of soul-stirring gospel music in the " + " stately St. Louis Cathedral. And New Orleans restaurants have revived the tradition of "+ " &apos;Reveillon&apos; dinners, a name that comes from the French word for " + " &apos;awakening&apos; because it was a meal that was eaten in the early morning " + " immediately after Christmas Midnight Mass, in celebration of the good news, of course, " + " but, just as happily, in celebration of the end of the Advent fast. You, however, do " + " not have to wait til midnight, nor do you have to observe the Advent fast. All you have"+ " to do is walk into a New Orleans restaurant and order food so sublime, it is in itself" + " a proof for the existence of heaven. And as every New Orleanian knows, Heaven is " + " presided over by a French-Italian-Creole chef with a gumbo-pot belly and a laugh " + " that fills that human heart with gladness. Merry Christmas to ya, New Orleans style."); return attraction; } public Attraction[] getAttractions(String[] attnames) throws java.rmi.RemoteException { Attraction[] attractions = null; if (attnames != null) { attractions = new Attraction[attnames.length]; for (int i=0; i < attnames.length; i++) { attractions[i] = getAttraction(attnames[i]); } } return attractions; } public Attraction[] getAttractions2(Query[] attnames) throws java.rmi.RemoteException { Attraction[] attractions = null; if (attnames != null) { attractions = new Attraction[attnames.length]; for (int i=0; i < attnames.length; i++) { if (attnames[i] != null) { attractions[i] = getAttraction(attnames[i].getValue()); } } } return attractions; } }
6,638
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped/City_BBBTestCase.java
/** * CityBBBTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.wrapped; import test.HttpTestUtil; public class City_BBBTestCase extends junit.framework.TestCase { public City_BBBTestCase(String name) { super(name); } public void testCity_BBBPortWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.wrapped.City_BBBLocator().getCity_BBBPortAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.wrapped.City_BBBLocator().getServiceName()); assertTrue(service != null); } public void test1CityBBBPortGetAttraction() throws Exception { City_BBBPortType binding; City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); assertTrue("binding is null", binding != null); Attraction value = binding.getAttraction("Christmas"); assertEquals("OID value was wrong", value.get_OID(), City_BBBBindingImpl.OID_STRING); } public void test2CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions with two inputs String[] attName = new String[] {"Christmas", "Xmas"}; Attraction[] value = binding.getAttractions(attName); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); assertEquals("OID value was wrong for second attaction", value[1].get_OID(), City_BBBBindingImpl.OID_STRING); } public void test3CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions with one input String[] attName = new String[] {"Christmas"}; Attraction[] value = binding.getAttractions(attName); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); } public void test4CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions with one input String[] attName = new String[] {"Christmas", null}; Attraction[] value = binding.getAttractions(attName); assertEquals("Expected returned Attraction length of 2", value.length, 2); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); assertEquals("Attracton[1] should be null", value[1], null); } public void test5CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions with one input String[] attName = new String[] {"Christmas", ""}; Attraction[] value = binding.getAttractions(attName); assertEquals("Expected returned Attraction length of 2", value.length, 2); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); assertEquals("Attracton[1] should be null", value[1], null); } public void test6CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions2 with two inputs Query[] query = new Query[2]; query[0] = new Query(); query[0].setValue("Christmas"); query[1] = new Query(); query[1].setValue("Xmas"); Attraction[] value = binding.getAttractions2(query); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); assertEquals("OID value was wrong for second attaction", value[1].get_OID(), City_BBBBindingImpl.OID_STRING); } public void test7CityBBBPortGetAttractions() throws Exception { City_BBBPortType binding; try { City_BBBLocator loc = new City_BBBLocator(); binding = loc.getCity_BBBPort(HttpTestUtil.getTestEndpoint(loc.getCity_BBBPortAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); // Invoke getAttractions2 with one input Query[] query = new Query[1]; query[0] = new Query(); query[0].setValue("Christmas"); Attraction[] value = binding.getAttractions2(query); assertEquals("OID value was wrong for first attraction", value[0].get_OID(), City_BBBBindingImpl.OID_STRING); } }
6,639
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/esr/EsrTestBindingImpl.java
/** * EsrTestBindingImpl.java * * Test for bug 12636 */ package test.wsdl.esr; public class EsrTestBindingImpl implements test.wsdl.esr.EsrTest{ public void esrInOut(short value, javax.xml.rpc.holders.ShortHolder echoVal, javax.xml.rpc.holders.DoubleHolder sqrtVal) throws java.rmi.RemoteException { echoVal.value = (short)value; sqrtVal.value = Math.sqrt(value); } public void esrInOut2(java.lang.String bstrSAH, java.lang.String bstrSUH, short value, javax.xml.rpc.holders.ShortHolder echoVal, javax.xml.rpc.holders.DoubleHolder sqrtVal) throws java.rmi.RemoteException { echoVal.value = value; sqrtVal.value = Math.sqrt( (double) value ); if(Double.isNaN(sqrtVal.value)) { throw org.apache.axis.AxisFault.makeFault(new Exception("arg cannot be < 0")); } } }
6,640
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/esr/EsrTestServiceTestCase.java
/** * EsrTestServiceTestCase.java * * Test for bug 12636 * Uses the Service interface to deal with WSDL instead of stubs. */ package test.wsdl.esr; import test.HttpTestUtil; import javax.xml.namespace.QName; public class EsrTestServiceTestCase extends junit.framework.TestCase { public EsrTestServiceTestCase(java.lang.String name) { super(name); } public void testEsrTestWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.esr.EsrTestServiceLocator().getEsrTestAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.esr.EsrTestServiceLocator().getServiceName()); assertTrue(service != null); } public void test1EsrTestEsrInOut() { // Using WSDL file to make a SOAP call try { //load wsdl file String wsdlLocation = HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/EsrTest") + "?WSDL"; javax.xml.rpc.Service svc = new org.apache.axis.client.Service( wsdlLocation, new javax.xml.namespace.QName("urn:esr.wsdl.test", "EsrTestService") ); //setting up the call javax.xml.rpc.Call call = svc.createCall( new javax.xml.namespace.QName("urn:esr.wsdl.test", "EsrTest"), new javax.xml.namespace.QName("urn:esr.wsdl.test", "esrInOut") ); //init in params Object[] soapInParams = new Object[]{new Short((short) 5)}; //calling soap service Object ret = call.invoke(soapInParams); //printing output params java.util.Map outParams = call.getOutputParams(); // Debug code if you need it /* java.util.Collection outs = outParams.values(); java.util.Iterator it = outs.iterator(); int i = 1; while (it.hasNext()) { System.out.println(i++ + ". " + it.next().toString()); } */ // Expecting a short and a double back assertEquals("Number of output parameters is wrong", outParams.size(), 2); Object s = outParams.get(new QName("echoVal")); assertNotNull("echoVal paramter is null", s); assertEquals("echoVal parameter is incorrect", (Short)s, new Short((short) 5) ); Object sq = outParams.get(new QName("sqrtVal")); assertNotNull("sqrtVal paramter is null", sq); assertEquals("sqrtVal parameter is incorrect", ((Double)sq).doubleValue(), Math.sqrt(5), 0.001D ); } catch (Exception e) { e.printStackTrace(System.out); throw new junit.framework.AssertionFailedError("Exception caught: " + e); } } public void test1EsrTestEsrInOut2() { // Using WSDL file to make a SOAP call try { //load wsdl file String wsdlLocation = HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/EsrTest") + "?WSDL"; javax.xml.rpc.Service svc = new org.apache.axis.client.Service( wsdlLocation, new javax.xml.namespace.QName("urn:esr.wsdl.test", "EsrTestService") ); //setting up the call javax.xml.rpc.Call call = svc.createCall( new javax.xml.namespace.QName("urn:esr.wsdl.test", "EsrTest"), new javax.xml.namespace.QName("urn:esr.wsdl.test", "esrInOut2") ); //init in params Object[] soapInParams = new Object[] { "token1", "token2", new Short((short)5) }; //calling soap service Object ret = call.invoke(soapInParams); //printing output params java.util.Map outParams = call.getOutputParams(); // Debug code if you need it /* java.util.Collection outs = outParams.values(); java.util.Iterator it = outs.iterator(); int i = 1; while (it.hasNext()) { System.out.println(i++ + ". " + it.next().toString()); } */ // Expecting a short and a double back assertEquals("Number of output parameters is wrong", outParams.size(), 2); Object s = outParams.get(new QName("echoVal")); assertNotNull("echoVal paramter is null", s); assertEquals("echoVal parameter is incorrect", (Short)s, new Short((short) 5) ); Object sq = outParams.get(new QName("sqrtVal")); assertNotNull("sqrtVal paramter is null", sq); assertEquals("sqrtVal parameter is incorrect", ((Double)sq).doubleValue(), Math.sqrt(5), 0.001D ); } catch (Exception e) { e.printStackTrace(System.out); throw new junit.framework.AssertionFailedError("Exception caught: " + e); } } }
6,641
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped2/EmployeeDatabaseTestCase.java
/** * EmployeeDatabaseTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2dev Oct 26, 2003 (08:57:14 EST) WSDL2Java emitter. */ package test.wsdl.wrapped2; import test.HttpTestUtil; public class EmployeeDatabaseTestCase extends junit.framework.TestCase { public EmployeeDatabaseTestCase(java.lang.String name) { super(name); } public void testEmployeeDatabaseWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.wrapped2.EmployeeDatabaseLocator().getEmployeeDatabaseAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.wrapped2.EmployeeDatabaseLocator().getServiceName()); assertTrue(service != null); } public void test1EmployeeDatabaseGetEmployeeCount() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.getEmployeeCount(0); // TBD - validate results } public void test2EmployeeDatabaseAddGroups() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.addGroups(new java.lang.String[0]); // TBD - validate results } public void test3EmployeeDatabaseIsManager() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.isManager(new java.lang.String(), new java.lang.String()); // TBD - validate results } public void test4EmployeeDatabasePromoteEmployee() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.promoteEmployee(new test.wsdl.wrapped2.xsd.NameType(), 0); // TBD - validate results } public void test5EmployeeDatabaseGetEmployees() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.wrapped2.xsd.EmployeeType[] value = null; value = binding.getEmployees(new test.wsdl.wrapped2.xsd.NameType[0]); // TBD - validate results } public void test6EmployeeDatabaseScheduleMtg() throws Exception { test.wsdl.wrapped2.EmployeeDBBindingStub binding; try { EmployeeDatabaseLocator loc = new EmployeeDatabaseLocator(); binding = (EmployeeDBBindingStub)loc.getEmployeeDatabase(HttpTestUtil.getTestEndpoint(loc.getEmployeeDatabaseAddress())); } 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.scheduleMtg(new test.wsdl.wrapped2.xsd.EmployeeType[0]); // TBD - validate results } }
6,642
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapped2/EmployeeDBBindingImpl.java
/** * EmployeeDBBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2dev Oct 26, 2003 (08:57:14 EST) WSDL2Java emitter. */ package test.wsdl.wrapped2; public class EmployeeDBBindingImpl implements test.wsdl.wrapped2.EmployeeDBPort{ public int getEmployeeCount(int empCountReq) throws java.rmi.RemoteException { return -3; } public boolean addGroups(java.lang.String[] group) throws java.rmi.RemoteException { return false; } public boolean isManager(java.lang.String firstName, java.lang.String lastName) throws java.rmi.RemoteException { return false; } public boolean promoteEmployee(test.wsdl.wrapped2.xsd.NameType empName, int empID) throws java.rmi.RemoteException { return false; } public test.wsdl.wrapped2.xsd.EmployeeType[] getEmployees(test.wsdl.wrapped2.xsd.NameType[] name) throws java.rmi.RemoteException { return null; } public boolean scheduleMtg(test.wsdl.wrapped2.xsd.EmployeeType[] employee) throws java.rmi.RemoteException { return false; } }
6,643
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/xsd/CPWSImplServiceTestCase.java
/** * CPWSImplServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2alpha Dec 09, 2003 (01:27:53 EST) WSDL2Java emitter. */ package test.wsdl.xsd; import junit.framework.TestCase; import org.apache.axis.Constants; import org.apache.axis.wsdl.gen.Parser; import org.apache.axis.wsdl.symbolTable.DefinedType; import org.apache.axis.wsdl.symbolTable.ElementDecl; import org.apache.axis.wsdl.symbolTable.SchemaUtils; import org.apache.axis.wsdl.symbolTable.SymbolTable; import test.HttpTestUtil; import javax.xml.namespace.QName; import java.net.URL; import java.util.Vector; public class CPWSImplServiceTestCase extends TestCase { public CPWSImplServiceTestCase(java.lang.String name) { super(name); } /** Test case for Bug 25161 Axis 1.2 alpha WSDL xsd types problem prevent .Net integration */ public void testCPWebServicesWSDL() throws Exception { URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.xsd.CPWSImplServiceLocator().getCPWebServicesAddress()); Parser wsdlParser = new Parser(); System.out.println("Reading WSDL document from '" + url + "?WSDL'"); wsdlParser.run(url + "?WSDL"); SymbolTable symbolTable = wsdlParser.getSymbolTable(); Vector v = symbolTable.getSymbols(new QName("http://datatypes.cs.amdocs.com", "CSText")); DefinedType type = (DefinedType) v.get(0); assertNotNull(type); Vector v2 = SchemaUtils.getContainedElementDeclarations( type.getNode(), symbolTable); ElementDecl element = (ElementDecl) v2.get(0); assertNotNull(element); assertEquals(Constants.XSD_STRING, element.getType().getQName()); } }
6,644
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qnameser/PlanService.java
package test.wsdl.qnameser; import javax.xml.namespace.QName; import java.rmi.RemoteException; public class PlanService { public static final QName Q_1 = new QName("http://foo", "1"); public static final QName Q_2 = new QName("http://tempuri.org/", "2"); public static final QName Q_3 = new QName("", "3"); public GetPlanResponse getPlan(QName parameters) throws RemoteException { String localName = parameters.getLocalPart(); String namespace = null; if (localName.equals(Q_1.getLocalPart())) { namespace = Q_1.getNamespaceURI(); } else if (localName.equals(Q_2.getLocalPart())) { namespace = Q_2.getNamespaceURI(); } else if (localName.equals(Q_3.getLocalPart())) { namespace = Q_3.getNamespaceURI(); } else { throw new RemoteException("invalid localname:" + localName); } if (!parameters.getNamespaceURI().equals(namespace)) { throw new RemoteException("Expected: " + namespace + " but got: " + parameters.getNamespaceURI()); } return new GetPlanResponse(); } public GetMPlanResponse getMPlan(GetMPlan in) throws RemoteException { QName [] list = in.getList(); for (int i=0;i<list.length;i++) { getPlan(list[i]); } return new GetMPlanResponse(); } }
6,645
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qnameser/QNameSerTestCase.java
package test.wsdl.qnameser; import javax.xml.namespace.QName; import test.HttpTestUtil; public class QNameSerTestCase extends junit.framework.TestCase { public QNameSerTestCase(String name) { super(name); } public void testQName() throws Exception { PlanWSSoap binding; try { PlanWS2Locator locator = new PlanWS2Locator(); binding = locator.getPlanWS2Soap(HttpTestUtil.getTestEndpoint(locator.getPlanWS2SoapAddress())); } 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); binding.getPlan(PlanService.Q_1); binding.getPlan(PlanService.Q_2); binding.getPlan(PlanService.Q_3); } public void testQNameList() throws Exception { PlanWSSoap binding; try { PlanWS2Locator locator = new PlanWS2Locator(); binding = locator.getPlanWS2Soap(HttpTestUtil.getTestEndpoint(locator.getPlanWS2SoapAddress())); } 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); QName [] list = new QName[] {PlanService.Q_1, PlanService.Q_2, PlanService.Q_3}; GetMPlan in = new GetMPlan(list); binding.getMPlan(in); } }
6,646
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/sequence/SequenceTestServiceTestCase.java
/** * SequenceTestServiceTestCase.java * * @author Rich Scheuerle (scheu@us.ibm.com) * @author Glen Daniels (gdaniels@apache.org) */ package test.wsdl.sequence; import test.HttpTestUtil; public class SequenceTestServiceTestCase extends junit.framework.TestCase { public SequenceTestServiceTestCase(String name) { super(name); } public void testSequenceTest() throws Exception { test.wsdl.sequence.SequenceTestPortType binding; SequenceTestLocator loc = new SequenceTestLocator(); binding = new SequenceTestLocator().getSequenceTest(HttpTestUtil.getTestEndpoint(loc.getSequenceTestAddress())); assertTrue("binding is null", binding != null); assertTrue("Test failed!", binding.testSequence(new test.wsdl.sequence.SequenceInfo())); } }
6,647
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/sequence/SequenceService.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.sequence; 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 org.w3c.dom.Text; /** * Sequence test service. This is a custom built message-style service * which confirms that the XML it receives correctly contains ordered * elements &lt;zero&gt; through &lt;five&gt;. * * @author Glen Daniels (gdaniels@apache.org) */ public class SequenceService { private String [] names = new String [] { "zero", "one", "two", "three", "four", "five" }; /** * This is a message-style service because we're just testing the * serialization. * * @return a SOAP response in a DOM Element, either boolean true or false, * indicating the success/failure of the test. */ public Element [] testSequence(Element [] elems) throws Exception { Element zero = null; for (int i = 0; i < elems.length; i++) { zero = findTheZero(elems[i]); if (zero != null) break; } Document retDoc = XMLUtils.newDocument(); Element [] ret = new Element [1]; ret[0] = retDoc.createElementNS("urn:SequenceTest", "testSequenceResponse"); boolean success = false; Element resultElement; if (zero != null) { // Check for correct ordering int i = 1; Node sib = zero.getNextSibling(); for (i = 1; i < names.length; i++) { while ((sib != null) && !(sib instanceof Element)) sib = sib.getNextSibling(); if ((sib == null) || !(names[i].equals(((Element)sib).getLocalName()))) break; sib = sib.getNextSibling(); } if (i == names.length) success = true; } resultElement = retDoc.createElementNS(null,"return"); String resultStr = "false"; if (success) { resultStr = "true"; } Text text = retDoc.createTextNode(resultStr); resultElement.appendChild(text); ret[0].appendChild(resultElement); return ret; } /** * Walk an XML tree, looking for a &lt;zero&gt; element * @param start the Element to walk down from * @return an Element named &lt;zero&gt; or null */ private Element findTheZero(Element start) { if (names[0].equals(start.getLocalName())) { return start; } NodeList nl = start.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element result = findTheZero((Element)node); if (result != null) { return result; } } } return null; } }
6,648
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/nested/Nested2ServiceTestCase.java
/** * Nested2ServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.nested; import org.apache.axis.message.MessageElement; import test.HttpTestUtil; import test.wsdl.nested.holders.PE_ADDRESSHolder; import test.wsdl.nested.holders.RETURNHolder; public class Nested2ServiceTestCase extends junit.framework.TestCase { public Nested2ServiceTestCase(String name) { super(name); } /* FIXME: RUNTIME WSDL broken. public void testNestedWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.nested.Nested2ServiceLocator().getNestedAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.nested.Nested2ServiceLocator().getServiceName()); assertTrue(service != null); } */ public void test1NestedNestedSvc2() throws Exception { test.wsdl.nested.Nested2PortType binding; try { Nested2ServiceLocator loc = new Nested2ServiceLocator(); binding = loc.getNested(HttpTestUtil.getTestEndpoint(loc.getNestedAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { PE_ADDRESSHolder pE_ADDRESS = new PE_ADDRESSHolder(); RETURNHolder rETURN = new RETURNHolder(); binding.nestedSvc2(new java.lang.String("0000001000"), new java.lang.String("01"), new java.lang.String("00"), new java.lang.String(""), new java.lang.String("1000"), pE_ADDRESS, rETURN); PE_ADDRESS address = pE_ADDRESS.value; RETURN ret = rETURN.value; assertTrue("NAME is wrong", address.getNAME().equals("Becker Berlin")); assertTrue("LOGMSGNO is wrong", ret.getLOG_MSG_NO().equals("123456")); MessageElement [] any = address.get_any(); assertNotNull("No 'any' content", any); assertTrue("any is wrong:" + any[0], any[0].getObjectValue().equals("Test Any")); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public static void main(String[] args) throws Exception { Nested2ServiceTestCase testcase = new Nested2ServiceTestCase("Nested2ServiceTestCase"); testcase.test1NestedNestedSvc2(); } }
6,649
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/nested/Nested2BindingImpl.java
/** * Nested2BindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.nested; import org.apache.axis.message.MessageElement; import test.wsdl.nested.holders.PE_ADDRESSHolder; import test.wsdl.nested.holders.RETURNHolder; import javax.xml.namespace.QName; public class Nested2BindingImpl implements test.wsdl.nested.Nested2PortType { public void nestedSvc2(java.lang.String cUSTOMERNO, java.lang.String pIDISTRCHAN, java.lang.String pIDIVISION, java.lang.String pIPASSBUFFER, java.lang.String pISALESORG, PE_ADDRESSHolder PE_ADDRESS, RETURNHolder rETURN) throws java.rmi.RemoteException { PE_ADDRESS address = new PE_ADDRESS(); address.setFORM_OF_AD("Company"); address.setFIRST_NAME(""); address.setNAME("Becker Berlin"); address.setNAME_3(""); address.setNAME_4(""); address.setDATE_BIRTH("0000-00-00"); address.setSTREET("Calvinstr. 36"); address.setPOSTL_CODE("13467"); address.setCITY("Berlin"); address.setREGION(""); address.setCOUNTRY(""); address.setCOUNTRNISO(""); address.setCOUNTRAISO(""); address.setINTERNET(""); address.setFAX_NUMBER("030-8853-999"); address.setTELEPHONE("030-8853-0"); address.setTELEPHONE2(""); address.setLANGU("D"); address.setLANGU_ISO("DE"); address.setCURRENCY(""); address.setCURRENCY_ISO(""); address.setCOUNTRYISO("DE"); address.setONLY_CHANGE_COMADDRESS("X"); MessageElement me = new MessageElement(new QName("foo", "bar"), "Test Any"); address.set_any(new MessageElement [] { me }); RETURN ret = new RETURN(); ret.setTYPE(""); ret.setCODE(""); ret.setMESSAGE(""); ret.setLOG_NO(""); ret.setLOG_MSG_NO("123456"); ret.setMESSAGE_V1(""); ret.setMESSAGE_V2(""); ret.setMESSAGE_V3(""); ret.setMESSAGE_V4(""); PE_ADDRESS.value = address; rETURN.value = ret; } }
6,650
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/axis2098/MyServiceTestCase.java
/** * MyServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.3 Jul 05, 2005 (04:50:41 KST) WSDL2Java emitter. */ package test.wsdl.axis2098; import test.HttpTestUtil; public class MyServiceTestCase extends junit.framework.TestCase { public MyServiceTestCase(java.lang.String name) { super(name); } public void testHelloWorldWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.axis2098.MyServiceLocator().getHelloWorldAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.axis2098.MyServiceLocator().getServiceName()); assertTrue(service != null); } public void test1HelloWorldHelloWorld() throws Exception { test.wsdl.axis2098.MySOAPBindingStub binding; try { MyServiceLocator loc = new MyServiceLocator(); binding = (MySOAPBindingStub)loc.getHelloWorld(HttpTestUtil.getTestEndpoint(loc.getHelloWorldAddress())); } 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); // Thread.sleep(10*1000); MyRequestType request = new MyRequestType(); // Test operation MyResponseType value = null; XsiTestType test = new XsiTestType(); test.setString("Hello World --------------------------!"); // Will give a validation error: cvc-elt.4.3: Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'. // It will add a xsi:type boolean but should not: <Logic xsi:type="xsd:boolean">true</Logic> test.setLogic(true); RestrictionType r = new RestrictionType(); // r.setFirstName("Hello"); //we do not set this but <firstName xsi:nil="true"/> is still sent over the wire r.setLastName("World"); test.setRestriction(r); test.setStringElem("String Ref"); request.setHelloworld(test); // Invoke webservice MyResponseType response = binding.helloWorld(request); System.out.println("Response from the webservice:"); System.out.println("\t"+response.getHelloworld()); // TBD - validate results } }
6,651
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/axis2098/TestHandler.java
package test.wsdl.axis2098; import java.io.ByteArrayOutputStream; import org.apache.axis.AxisFault; import org.apache.axis.MessageContext; import org.apache.axis.handlers.BasicHandler; public class TestHandler extends BasicHandler { public void invoke(MessageContext msgContext) throws AxisFault { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { msgContext.getCurrentMessage().writeTo(baos); } catch (Exception e) { throw new AxisFault("exception", e); } String msg = baos.toString(); System.out.println("msg = " + msg); if (msg.indexOf("xsi:type") >= 0) { throw new AxisFault("message contains xsi:type"); } } }
6,652
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/axis2098/MySOAPBindingImpl.java
package test.wsdl.axis2098; public class MySOAPBindingImpl implements test.wsdl.axis2098.MyPort { public test.wsdl.axis2098.MyResponseType helloWorld(test.wsdl.axis2098.MyRequestType body) throws java.rmi.RemoteException { MyResponseType resp = new MyResponseType(); resp.setHelloworld(body.getHelloworld()); return resp; } }
6,653
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/query/QueryTestSoapBindingImpl.java
/** * QueryTestBindingImpl.java * * Implementation for Query test. * */ package test.wsdl.query; public class QueryTestSoapBindingImpl implements test.wsdl.query.QueryTest { public test.wsdl.query.QueryBean echoQuery(test.wsdl.query.QueryBean argQuery) throws java.rmi.RemoteException { return argQuery; } }
6,654
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/query/FileGenWrappedTestCase.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.query; import test.AxisFileGenTestBase; import java.io.File; import java.util.HashSet; import java.util.Set; /** * This tests to make sure the wrapper element types for a wrapped * document/literal service are not generated by WSDL2Java. * * @author Tom Jordahl (tomj@macromedia.com) */ public class FileGenWrappedTestCase extends AxisFileGenTestBase { public FileGenWrappedTestCase(String name) { super(name); } /** * List of files which should be generated. */ protected Set shouldExist() { HashSet set = new HashSet(); set.add("QueryBean.java"); set.add("QueryTest.java"); set.add("QueryTestSoapBindingStub.java"); set.add("QueryTestService.java"); set.add("QueryTestServiceLocator.java"); return set; } // shouldExist /** * List of files which may be generated. */ protected Set mayExist() { HashSet set = new HashSet(); // none return set; } // shouldExist /** * The directory containing the files that should exist. */ protected String rootDir() { return "target" + File.separator + "generated-test-sources" + File.separator + "wsdl2java" + File.separator + "test" + File.separator + "wsdl" + File.separator + "query"; } // rootDir }
6,655
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/query/QueryTestServiceTestCase.java
/** * QueryTest_ServiceTestCase.java * * Test the QueryBean object. * */ package test.wsdl.query; import test.HttpTestUtil; public class QueryTestServiceTestCase extends junit.framework.TestCase { public QueryTestServiceTestCase(java.lang.String name) { super(name); } public void testQueryTestWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.query.QueryTestServiceLocator().getQueryTestAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.query.QueryTestServiceLocator().getServiceName()); assertTrue(service != null); } public void test2QueryTestEchoQuery() throws Exception { test.wsdl.query.QueryTestSoapBindingStub binding; try { QueryTestServiceLocator loc = new QueryTestServiceLocator(); binding = (QueryTestSoapBindingStub)loc.getQueryTest(HttpTestUtil.getTestEndpoint(loc.getQueryTestAddress())); } 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 up input data test.wsdl.query.QueryBean inQuery = new QueryBean(); String[] columns = new String[] {"first", "last", "number"}; Object[][] data = new Object[][] { {new String("Joe"), new String("Blow"), new Integer(3)}, {new String("John"), new String("Doe"), new Integer(2)} }; inQuery.setColumnList(columns); inQuery.setData(data); // Do the operation QueryBean outQuery = binding.echoQuery(inQuery); // Check the results assertNotNull("return value from echoQuery is null", outQuery); String[] outCols = outQuery.getColumnList(); assertNotNull("column list in the returned Query is null, should have string array in it", outCols); assertEquals("column value #1 doesn't match", columns[0], outCols[0]); assertEquals("column value #2 doesn't match", columns[1], outCols[1]); assertEquals("column value #3 doesn't match", columns[2], outCols[2]); Object[][] outData = outQuery.getData(); assertNotNull("data array in the returned Query is null, should have Query data in it", outData); assertEquals("data value 0,0 doesn't match", data[0][0], outData[0][0]); assertEquals("data value 0,1 doesn't match", data[0][1], outData[0][1]); assertEquals("data value 0,2 doesn't match", data[0][2], outData[0][2]); assertEquals("data value 1,0 doesn't match", data[1][0], outData[1][0]); assertEquals("data value 1,1 doesn't match", data[1][1], outData[1][1]); assertEquals("data value 1,2 doesn't match", data[1][2], outData[1][2]); } }
6,656
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/attachments/AttachmentTestCase.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.wsdl.attachments; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; import javax.xml.rpc.holders.FloatHolder; import javax.xml.rpc.holders.StringHolder; import org.apache.axis.attachments.OctetStream; import org.apache.axis.holders.ImageHolder; import test.HttpTestUtil; import java.util.Arrays; import junit.framework.TestCase; public class AttachmentTestCase extends TestCase { private static Pt1 getBinding() throws Exception { AttachmentLocator loc = new AttachmentLocator(); return loc.getAttachmentPortRPC(HttpTestUtil.getTestEndpoint(loc.getAttachmentPortRPCAddress())); } private MimeMultipart createMimeMultipart(String data) throws Exception { // create the root multipart MimeMultipart mpRoot = new MimeMultipart("mixed"); // Add text MimeBodyPart mbp1 = new MimeBodyPart(); mbp1.setText(data); mpRoot.addBodyPart(mbp1); return mpRoot; } public void testGetCompanyInfo() throws Exception { FloatHolder result = new FloatHolder(); StringHolder docs = new StringHolder(); ImageHolder logo = new ImageHolder(); getBinding().getCompanyInfo("IBM", result, docs, logo); assertEquals(134, (int)(result.value*10)); assertEquals("IBM", docs.value); assertNotNull(logo.value); assertEquals(24, logo.value.getWidth(null)); assertEquals(24, logo.value.getHeight(null)); } public void testGetCompanyInfo2() throws Exception { assertEquals("GetCompanyInfo2", getBinding().getCompanyInfo2(0, "GetCompanyInfo2", null)); } public void testInputPlainText() throws Exception { getBinding().inputPlainText("InputPlainText"); // TBD - validate results } public void testInoutPlainText() throws Exception { assertEquals("InoutPlainText", getBinding().inoutPlainText("InoutPlainText")); } public void testEchoPlainText() throws Exception { assertEquals("EchoPlainText", getBinding().echoPlainText("EchoPlainText")); } public void testOutputPlainText() throws Exception { assertEquals("OutputPlainText", getBinding().outputPlainText()); } public void testInputMimeMultipart() throws Exception { getBinding().inputMimeMultipart(createMimeMultipart("InputMimeMultipart")); // TBD - validate results } public void testInoutMimeMultipart() throws Exception { MimeMultipart value = getBinding().inoutMimeMultipart(createMimeMultipart("InoutMimeMultipart")); // TBD - validate results } public void testEchoMimeMultipart() throws Exception { MimeMultipart value = getBinding().echoMimeMultipart(createMimeMultipart("EchoMimeMultipart")); // TBD - validate results } public void testOutputMimeMultipart() throws Exception { MimeMultipart value = getBinding().outputMimeMultipart(); // TBD - validate results } public void testEchoAttachment() throws Exception { OctetStream input = new OctetStream("EchoAttachment".getBytes()); OctetStream output = getBinding().echoAttachment(input); assertTrue(Arrays.equals(input.getBytes(), output.getBytes())); } }
6,657
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/attachments/B1Impl.java
/** * B1Impl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.attachments; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.rmi.RemoteException; import javax.mail.MessagingException; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMultipart; import javax.xml.rpc.holders.FloatHolder; import javax.xml.rpc.holders.StringHolder; import org.apache.axis.holders.ImageHolder; public class B1Impl implements test.wsdl.attachments.Pt1 { private MimeMultipart createMimeMultipart(String data) throws MessagingException { // create the root multipart MimeMultipart mpRoot = new MimeMultipart("mixed"); // Add text MimeBodyPart mbp1 = new MimeBodyPart(); mbp1.setText(data); mpRoot.addBodyPart(mbp1); return mpRoot; } public void getCompanyInfo(String tickerSymbol, FloatHolder result, StringHolder docs, ImageHolder logo) throws RemoteException { result.value = 13.4f; docs.value = tickerSymbol; BufferedImage image = new BufferedImage(24, 24, BufferedImage.TYPE_INT_ARGB); Graphics g = image.createGraphics(); g.drawLine(0, 0, 24, 24); g.dispose(); logo.value = image; } public java.lang.String getCompanyInfo2(float result, java.lang.String docs, java.awt.Image logo) throws java.rmi.RemoteException { return docs; } public void inputPlainText(java.lang.String body) throws java.rmi.RemoteException { } public java.lang.String inoutPlainText(java.lang.String body) throws java.rmi.RemoteException { return body; } public java.lang.String echoPlainText(java.lang.String body) throws java.rmi.RemoteException { return body; } public java.lang.String outputPlainText() throws java.rmi.RemoteException { return "OutputPlainText"; } public void inputMimeMultipart(javax.mail.internet.MimeMultipart body) throws java.rmi.RemoteException { } public javax.mail.internet.MimeMultipart inoutMimeMultipart(javax.mail.internet.MimeMultipart body) throws java.rmi.RemoteException { return body; } public javax.mail.internet.MimeMultipart echoMimeMultipart(javax.mail.internet.MimeMultipart body) throws java.rmi.RemoteException { return body; } public javax.mail.internet.MimeMultipart outputMimeMultipart() throws java.rmi.RemoteException { try { return createMimeMultipart("outputMimeMultipart"); } catch (MessagingException me) { throw new java.rmi.RemoteException(me.getMessage(), me); } } public org.apache.axis.attachments.OctetStream echoAttachment(org.apache.axis.attachments.OctetStream in) throws java.rmi.RemoteException { return in; } }
6,658
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapperHolder/ExampleSoapTestCase.java
/** * DoExampleTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2beta3 Aug 03, 2004 (01:17:01 CEST) WSDL2Java emitter. */ package test.wsdl.wrapperHolder; import javax.xml.rpc.holders.ByteArrayHolder; import javax.xml.rpc.holders.LongWrapperHolder; import test.HttpTestUtil; public class ExampleSoapTestCase extends junit.framework.TestCase { public ExampleSoapTestCase(java.lang.String name) { super(name); } public void testWrapperHolderWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.wrapperHolder.DoExample_ServiceLocator().getWrapperHolderAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.wrapperHolder.DoExample_ServiceLocator().getServiceName()); assertTrue(service != null); } public void test1WrapperHolderDoExample() throws Exception { test.wsdl.wrapperHolder.ExampleSoapStub binding; try { DoExample_ServiceLocator loc = new DoExample_ServiceLocator(); binding = (ExampleSoapStub)loc.getWrapperHolder(HttpTestUtil.getTestEndpoint(loc.getWrapperHolderAddress())); } 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); byte[][] in1 = new byte[][] { { (byte) 0xbe, (byte) 0xef, (byte) 0xcc }, { (byte) 0xee, (byte) 0xff, (byte) 0xaa }, }; Long in2 = new Long(3); ByteArrayHolder out1 = new ByteArrayHolder(); LongWrapperHolder out2 = new LongWrapperHolder(); // Test operation binding.doExample(in1, in2, out1, out2); assertEquals("Unexpected value for ByteArrayHolder", byteArrayAsList(in1[0]), byteArrayAsList(out1.value)); assertEquals("Unexpected value for LongWrapperHolder ", in2, out2.value); } private static java.util.List byteArrayAsList(final byte[] a) { return new java.util.AbstractList() { public Object get(int i) { return new Byte(a[i]); } public int size() { return a.length; } public Object set(int i, Object o) { byte oldVal = a[i]; a[i] = ((Byte) o).byteValue(); return new Byte(oldVal); } }; } }
6,659
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapperHolder/ExampleSoapImpl.java
/** * ExampleSoapImpl.java * * Verifies that wrapped operations featuring Java wrapper types are working. */ package test.wsdl.wrapperHolder; public class ExampleSoapImpl implements test.wsdl.wrapperHolder.ExampleSoap { public void doExample(byte[][] doExampleValue1, java.lang.Long out, javax.xml.rpc.holders.ByteArrayHolder doExampleResponseRet, javax.xml.rpc.holders.LongWrapperHolder out2) throws java.rmi.RemoteException { doExampleResponseRet.value = doExampleValue1[0]; out2.value = out; } }
6,660
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marrays/MArrayTestsSOAPBindingImpl.java
/** * MArrayTestsSOAPBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.marrays; public class MArrayTestsSOAPBindingImpl implements test.wsdl.marrays.MArrayTests { public int[][][] testIntArray(int[][][] in) throws java.rmi.RemoteException { // Each non-nill element should have a value that is i + 10*j + 100*k // Add 1000 to each correct value encountered. for (int i=0; i < in.length; i++) { int[][] array2 = in[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { int[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { if (array3[k] == i + 10*j + 100*k) array3[k] += 1000; } } } return in; } public test.wsdl.marrays.Foo[][][] testFooArray(test.wsdl.marrays.Foo[][][] in) throws java.rmi.RemoteException { // Each non-nill element should have a value that is i + 10*j + 100*k // Add 1000 to each correct value encountered. for (int i=0; i < in.length; i++) { Foo[][] array2 = in[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { Foo[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { if (array3[k].getValue() == i + 10*j + 100*k) array3[k].setValue(i + 10*j + 100*k + 1000); } } } return in; } public java.util.HashMap testMapFooArray(java.util.HashMap map) throws java.rmi.RemoteException { return map; } }
6,661
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/marrays/MArrayTestsServiceTestCase.java
/** * MArrayTestsServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis Wsdl2java emitter. */ package test.wsdl.marrays; import java.util.HashMap; import java.util.Map; import test.HttpTestUtil; public class MArrayTestsServiceTestCase extends junit.framework.TestCase { test.wsdl.marrays.MArrayTests binding; public MArrayTestsServiceTestCase(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); MArrayTestsServiceLocator loc = new MArrayTestsServiceLocator(); binding = loc.getMArrayTests(HttpTestUtil.getTestEndpoint(loc.getMArrayTestsAddress())); assertTrue("binding is null", binding != null); } public void testMArrayTestsWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.marrays.MArrayTestsServiceLocator().getMArrayTestsAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.marrays.MArrayTestsServiceLocator().getServiceName()); assertTrue(service != null); } public void testMArrayTest1() throws Exception { // In each case below, the elements of the array are either nill, -1 or // i + 10j + 100k // The remote service adds 1000 to each element that is i + 10j + 100k // Test 1: 3-Dim array of values. This could be serialized // as a multi-dimensional array. int[][][] in = new int[3][3][3]; int[][][] rc; fill(in); rc = binding.testIntArray(in); assertTrue("Test 1 Failed", validate(in, rc)); } public void testMArrayTest2() throws Exception { // Test 2: 3-Dim array of values (but one dimension has different lengths or nil). int[][][] in = new int[3][3][]; for (int i=0; i<3; i++) { for(int j=1; j<3; j++) { in[i][j] = new int[i+j]; } } int[][][] rc; fill(in); rc = binding.testIntArray(in); assertTrue("Test 2 Failed", validate(in, rc)); } public void testMArrayTest3() throws Exception { // Test 1F: 3-Dim array of values. This could be serialized // as a multi-dimensional array. Foo[][][] in = new Foo[3][3][3]; Foo[][][] rc; fillFoo(in); rc = binding.testFooArray(in); assertTrue("Test 1F Failed", validateFoo(in, rc)); } public void testMArrayTest4() throws Exception { // Test 2F: 3-Dim array of values (but one dimension has different lengths or nil). Foo[][][] in = new Foo[3][3][]; for (int i=0; i<3; i++) { for(int j=1; j<3; j++) { in[i][j] = new Foo[i+j]; } } Foo[][][] rc; fillFoo(in); rc = binding.testFooArray(in); assertTrue("Test 2F Failed", validateFoo(in, rc)); } public void testMArrayTest5() throws Exception { // Test 3F: Some of the Foo elements are multi-referenced. Foo[][][] in = new Foo[3][3][3]; Foo[][][] rc; fillFoo(in); // Diagonals are set to same Foo in[0][0][0] = new Foo(); in[0][0][0].setValue(-1); in[1][1][1] = in[0][0][0]; in[2][2][2] = in[0][0][0]; rc = binding.testFooArray(in); assertTrue("Test 3F Failed (a)", validateFoo(in, rc)); assertTrue("Test 3F Failed (b)", rc[0][0][0] == rc[1][1][1]); assertTrue("Test 3F Failed (c)", rc[0][0][0] == rc[2][2][2]); } public void testMArrayTest6() throws Exception { // Test 3G: Combination of Foo and DerivedFoo. Foo[][][] in = new Foo[3][3][3]; Foo[][][] rc; fillFoo(in); // Diagonals are set to same Foo in[0][0][0] = new DerivedFoo(); in[0][0][0].setValue(-1); ((DerivedFoo)in[0][0][0]).setValue2(7); in[1][1][1] = in[0][0][0]; in[2][2][2] = in[0][0][0]; rc = binding.testFooArray(in); assertTrue("Test 3G Failed (a)", validateFoo(in, rc)); assertTrue("Test 3G Failed (b)", rc[0][0][0] == rc[1][1][1]); assertTrue("Test 3G Failed (c)", rc[0][0][0] == rc[2][2][2]); assertTrue("Test 3G Failed (d)", ((DerivedFoo)rc[2][2][2]).getValue2() == 7); } // This test is no longer valid if Axis treats arrays as always single-ref /* try { // Test 4F: Foo arrays are multi-referenced. Foo[][][] in = new Foo[3][3][3]; Foo[][][] rc; fillFoo(in); // Same Foo array Foo[] fooArray = new Foo[3]; fooArray[0] = new Foo(); fooArray[0].setValue(-1); fooArray[1] = new Foo(); fooArray[1].setValue(-1); fooArray[2] = new Foo(); fooArray[2].setValue(-1); in[0][0] = fooArray; in[1][1] = fooArray; in[2][2] = fooArray; rc = binding.testFooArray(in); assertTrue("Test 4F Failed (a)", validateFoo(in, rc)); assertTrue("Test 4F Failed (b)", rc[0][0] == rc[1][1]); assertTrue("Test 4F Failed (c)", rc[0][0] == rc[2][2]); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re ); } */ public void testMArrayTest7() throws Exception { // Test 3F: Some of the Foo elements are multi-referenced. HashMap map = new HashMap(); Foo[] array = new Foo[1]; array[0] = new Foo(); array[0].setValue(123); map.put("hello", array); Map rc; rc = binding.testMapFooArray(map); assertTrue("Test Map Failed (a)", rc != null); assertTrue("Test Map Failed (b)", rc.get("hello").getClass().isArray()); Foo[] rcArray = (Foo[]) rc.get("hello"); assertTrue("Test Map Failed (c)", rcArray.length == 1 && rcArray[0].getValue() == 123); } public void fill(int[][][] array) { for (int i=0; i < array.length; i++) { int[][] array2 = array[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { int[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { array3[k] = i + 10*j + 100*k; } } } } public boolean validate(int[][][] orig, int[][][] rc) { for (int i=0; i < orig.length; i++) { int[][] array2 = orig[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { int[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { if ((array3[k] == -1 && rc[i][j][k] == -1) || (array3[k]+1000 == rc[i][j][k])) ; // Okay else return false; } } } return true; } public void fillFoo(Foo[][][] array) { for (int i=0; i < array.length; i++) { Foo[][] array2 = array[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { Foo[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { if (array3[k] == null) array3[k] = new Foo(); array3[k].setValue(i + 10*j + 100*k); } } } } public boolean validateFoo(Foo[][][] orig, Foo[][][] rc) { for (int i=0; i < orig.length; i++) { Foo[][] array2 = orig[i]; if (array2 != null) for (int j=0; j < array2.length; j++) { Foo[] array3 = array2[j]; if (array3 != null) for (int k=0; k <array3.length; k++) { if ((array3[k].getValue() == -1 && rc[i][j][k].getValue() == -1) || (array3[k].getValue()+1000 == rc[i][j][k].getValue())) ; // Okay else return false; } } } return true; } }
6,662
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/adaptive/AdaptiveServiceTestCase.java
/** * AdaptiveServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.adaptive; import java.util.Arrays; public class AdaptiveServiceTestCase extends junit.framework.TestCase { public AdaptiveServiceTestCase(java.lang.String name) { super(name); } public void testAdaptiveWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptiveAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.adaptive.AdaptiveServiceLocator().getServiceName()); assertTrue(service != null); } public void test1AdaptiveGetServiceDescription() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.getServiceDescription(); // TBD - validate results } public void test2AdaptiveRankResources() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.adaptive.types.ResourceInfo[] value = null; value = binding.rankResources(new test.wsdl.adaptive.types.ResourceInfo[0], new test.wsdl.adaptive.types.ApplicationInfo()); // TBD - validate results assertTrue(value.length > 0); assertEquals(value[0].getId(), "Adaptive #1"); java.lang.Object[] collection = value[0].getProperties().getCollection(); assertTrue(collection.length > 0); assertTrue(Arrays.equals(collection, new String[]{"A","B","C"})); } public void test3AdaptiveEstimateTransferTime() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.estimateTransferTime(true, new test.wsdl.adaptive.types.ResourceInfo(), new test.wsdl.adaptive.types.ResourceInfo[0], 0, java.util.Calendar.getInstance()); // TBD - validate results } public void test4AdaptiveLogDataTransfer() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.logDataTransfer(new test.wsdl.adaptive.types.ResourceInfo(), new test.wsdl.adaptive.types.ResourceInfo(), 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance()); // TBD - validate results } public void test5AdaptiveEstimateUsage() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.estimateUsage(true, new test.wsdl.adaptive.types.ResourceInfo(), new java.lang.String(), 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance()); // TBD - validate results } public void test6AdaptiveEstimateMultipleUsage() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.estimateMultipleUsage(true, new test.wsdl.adaptive.types.ResourceInfo[0], new java.lang.String[0], 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance()); // TBD - validate results } public void test7AdaptiveEstimateNetworkGraph() throws Exception { test.wsdl.adaptive.AdaptiveInterfaceBindingStub binding; try { binding = (test.wsdl.adaptive.AdaptiveInterfaceBindingStub) new test.wsdl.adaptive.AdaptiveServiceLocator().getAdaptive(); } 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.estimateNetworkGraph(true, new test.wsdl.adaptive.types.ResourceInfo[0], 0, java.util.Calendar.getInstance(), java.util.Calendar.getInstance()); // TBD - validate results } }
6,663
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/adaptive/AdaptiveInterfaceBindingImpl.java
/** * AdaptiveInterfaceBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.adaptive; import test.wsdl.adaptive.types.internal.Vector; public class AdaptiveInterfaceBindingImpl implements test.wsdl.adaptive.AdaptiveInterface{ public java.lang.String getServiceDescription() throws java.rmi.RemoteException { return null; } public test.wsdl.adaptive.types.ResourceInfo[] rankResources(test.wsdl.adaptive.types.ResourceInfo[] arrayOfResourceInfo_1, test.wsdl.adaptive.types.ApplicationInfo applicationInfo_2) throws java.rmi.RemoteException { test.wsdl.adaptive.types.ResourceInfo[] resources = new test.wsdl.adaptive.types.ResourceInfo[1]; resources[0] = new test.wsdl.adaptive.types.ResourceInfo(); resources[0].setId("Adaptive #1"); test.wsdl.adaptive.types.internal.Vector v = new test.wsdl.adaptive.types.internal.Vector(); v.setCollection(new String[]{"A","B","C"}); resources[0].setProperties(v); return resources; } public int[] estimateTransferTime(boolean boolean_1, test.wsdl.adaptive.types.ResourceInfo resourceInfo_2, test.wsdl.adaptive.types.ResourceInfo[] arrayOfResourceInfo_3, long long_4, java.util.Calendar calendar_5) throws java.rmi.RemoteException { return null; } public void logDataTransfer(test.wsdl.adaptive.types.ResourceInfo resourceInfo_1, test.wsdl.adaptive.types.ResourceInfo resourceInfo_2, long long_3, java.util.Calendar calendar_4, java.util.Calendar calendar_5) throws java.rmi.RemoteException { } public java.lang.String estimateUsage(boolean boolean_1, test.wsdl.adaptive.types.ResourceInfo resourceInfo_2, java.lang.String string_3, int int_4, java.util.Calendar calendar_5, java.util.Calendar calendar_6) throws java.rmi.RemoteException { return null; } public java.lang.String[][] estimateMultipleUsage(boolean boolean_1, test.wsdl.adaptive.types.ResourceInfo[] arrayOfResourceInfo_2, java.lang.String[] arrayOfString_3, int int_4, java.util.Calendar calendar_5, java.util.Calendar calendar_6) throws java.rmi.RemoteException { return null; } public java.lang.String[][] estimateNetworkGraph(boolean boolean_1, test.wsdl.adaptive.types.ResourceInfo[] arrayOfResourceInfo_2, int int_3, java.util.Calendar calendar_4, java.util.Calendar calendar_5) throws java.rmi.RemoteException { return null; } }
6,664
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/header/HeaderServiceTestCase.java
/** * HeaderServiceTestCase.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.header; import test.HttpTestUtil; public class HeaderServiceTestCase extends junit.framework.TestCase { public HeaderServiceTestCase(java.lang.String name) { super(name); } /* FIXME: RUNTIME WSDL broken. public void testheaderWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = new java.net.URL(new test.wsdl.header.HeaderServiceLocator().getheaderAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.header.HeaderServiceLocator().getServiceName()); assertTrue(service != null); } */ public void test1headerOp1() throws Exception { test.wsdl.header.BindingStub binding; try { HeaderServiceLocator loc = new HeaderServiceLocator(); binding = (BindingStub)loc.getheader(HttpTestUtil.getTestEndpoint(loc.getheaderAddress())); } 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 { float value = -3; value = binding.op1(0, new java.lang.String(), new test.wsdl.header.HeaderType()); } catch (test.wsdl.header.Op1Fault e1) { throw new junit.framework.AssertionFailedError("op1Fault Exception caught: " + e1); } // TBD - validate results } public void test2headerOp2() throws Exception { test.wsdl.header.BindingStub binding; try { HeaderServiceLocator loc = new HeaderServiceLocator(); binding = (BindingStub)loc.getheader(HttpTestUtil.getTestEndpoint(loc.getheaderAddress())); } 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.op2(0, new test.wsdl.header.HeaderType()); // TBD - validate results } }
6,665
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/schema2/Schema2ServiceTestCase.java
/** * Schema2ServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC2 Jan 14, 2005 (05:38:50 EST) WSDL2Java emitter. */ package test.wsdl.schema2; import test.HttpTestUtil; public class Schema2ServiceTestCase extends junit.framework.TestCase { public Schema2ServiceTestCase(java.lang.String name) { super(name); } public void testSchema2ServiceWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); Schema2ServiceLocator loc = new Schema2ServiceLocator(); javax.xml.rpc.Service service = serviceFactory.createService( HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress() + "?WSDL"), loc.getServiceName()); assertTrue(service != null); } public void test1Schema2ServiceEchoLanguageTypeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoLanguageTypeTest(new java.lang.String("ABC")); // TBD - validate results } public void test2Schema2ServiceEchoTokenTypeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoTokenTypeTest(new java.lang.String("ABC")); // TBD - validate results } public void test3Schema2ServiceEchoNameTypeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoNameTypeTest(new java.lang.String("ABC")); // TBD - validate results } public void test4Schema2ServiceEchoNCNameTypeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoNCNameTypeTest(new java.lang.String("ABC")); // TBD - validate results } public void test5Schema2ServiceEchoIDTypeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoIDTypeTest(new java.lang.String("ABC")); // TBD - validate results } public void test6Schema2ServiceEchoUnsignedShortTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoUnsignedShortTest(123); // TBD - validate results } public void test7Schema2ServiceEchoUnsignedIntTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoUnsignedIntTest(234); // TBD - validate results } public void test8Schema2ServiceEchoUnsignedByteTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoUnsignedByteTest((short)456); // TBD - validate results } public void test9Schema2ServiceEchoUnsignedLongTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoUnsignedLongTest(new java.math.BigInteger("567")); // TBD - validate results } public void test10Schema2ServiceEchoNonPositiveIntegerTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoNonPositiveIntegerTest(new java.math.BigInteger("678")); // TBD - validate results } public void test11Schema2ServiceEchoNonNegativeIntegerTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoNonNegativeIntegerTest(new java.math.BigInteger("8910")); // TBD - validate results } public void test12Schema2ServiceEchoPositiveIntegerTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoPositiveIntegerTest(new java.math.BigInteger("91011")); // TBD - validate results } public void test13Schema2ServiceEchoNegativeIntegerTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoNegativeIntegerTest(new java.math.BigInteger("111213")); // TBD - validate results } public void test14Schema2ServiceEchoTimeTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoTimeTest(java.util.Calendar.getInstance()); // TBD - validate results } public void test15Schema2ServiceEchoDateTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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.echoDateTest(java.util.Calendar.getInstance()); // TBD - validate results } public void test16Schema2ServiceEchoDocumentTest() throws Exception { Schema2ServiceSoapBindingStub binding; try { Schema2ServiceLocator loc = new Schema2ServiceLocator(); binding = (Schema2ServiceSoapBindingStub) loc.getSchema2Service(HttpTestUtil.getTestEndpoint(loc.getSchema2ServiceAddress())); } 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 Document value = new Document(); value.set_value("XYZ"); value.setID("ID#1"); value = binding.echoDocument(value); // TBD - validate results assertEquals("ID#1",value.getID()); assertEquals("XYZ",value.get_value()); } }
6,666
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/schema2/Document.java
package test.wsdl.schema2; public class Document { protected java.lang.String ID; protected java.lang.String _value; public Document() { } public Document(java.lang.String ID, java.lang.String _value) { this.ID = ID; this._value = _value; } public java.lang.String getID() { return ID; } public void setID(java.lang.String ID) { this.ID = ID; } public java.lang.String get_value() { return _value; } public void set_value(java.lang.String _value) { this._value = _value; } }
6,667
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/schema2/Schema2ServiceSoapBindingImpl.java
/** * Schema2ServiceSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2RC2 Jan 14, 2005 (05:38:50 EST) WSDL2Java emitter. */ package test.wsdl.schema2; public class Schema2ServiceSoapBindingImpl implements test.wsdl.schema2.Schema2Test{ public java.lang.String echoLanguageTypeTest(java.lang.String languageElem) throws java.rmi.RemoteException { return languageElem; } public java.lang.String echoTokenTypeTest(java.lang.String tokenElem) throws java.rmi.RemoteException { return tokenElem; } public java.lang.String echoNameTypeTest(java.lang.String nameElem) throws java.rmi.RemoteException { return nameElem; } public java.lang.String echoNCNameTypeTest(java.lang.String NCNameElem) throws java.rmi.RemoteException { return NCNameElem; } public java.lang.String echoIDTypeTest(java.lang.String IDElem) throws java.rmi.RemoteException { return IDElem; } public int echoUnsignedShortTest(int unsignedShort) throws java.rmi.RemoteException { return unsignedShort; } public long echoUnsignedIntTest(long unsignedInt) throws java.rmi.RemoteException { return unsignedInt; } public short echoUnsignedByteTest(short unsignedByte) throws java.rmi.RemoteException { return unsignedByte; } public java.math.BigInteger echoUnsignedLongTest(java.math.BigInteger unsignedLong) throws java.rmi.RemoteException { return unsignedLong; } public java.math.BigInteger echoNonPositiveIntegerTest(java.math.BigInteger nonPositiveInteger) throws java.rmi.RemoteException { return nonPositiveInteger; } public java.math.BigInteger echoNonNegativeIntegerTest(java.math.BigInteger nonNegativeInteger) throws java.rmi.RemoteException { return nonNegativeInteger; } public java.math.BigInteger echoPositiveIntegerTest(java.math.BigInteger positiveInteger) throws java.rmi.RemoteException { return positiveInteger; } public java.math.BigInteger echoNegativeIntegerTest(java.math.BigInteger negativeInteger) throws java.rmi.RemoteException { return negativeInteger; } public java.util.Calendar echoTimeTest(java.util.Calendar time) throws java.rmi.RemoteException { return time; } public java.util.Calendar echoDateTest(java.util.Calendar date) throws java.rmi.RemoteException { return date; } public test.wsdl.schema2.Document echoDocument(test.wsdl.schema2.Document document) throws java.rmi.RemoteException { return document; } }
6,668
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multithread/StubSupplier.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.wsdl.multithread; import samples.addr.AddressBook; /** * Supplies a stub instance to a given {@link Invoker}. Depending on the implementation this may be * a singleton or a new stub for each {@link Invoker}. */ interface StubSupplier { AddressBook getStub() throws Exception; }
6,669
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multithread/MultithreadTestCase.java
package test.wsdl.multithread; import java.util.concurrent.CountDownLatch; import junit.framework.TestCase; import samples.addr.AddressBook; import samples.addr.AddressBookSOAPBindingStub; import samples.addr.AddressBookServiceLocator; import test.HttpTestUtil; public class MultithreadTestCase extends TestCase { /** * This test calls a single stub multiple times from multiple threads. Before the * stub was made threadsafe, there was a good chance this test would fail with an * IllegalStateException or "javax.xml.rpc.ServiceException: Number of parameters * passed in (2) doesn't match the number of IN/INOUT parameters (4) from the * addParameter() calls" or something else just as cryptic. */ public void testSingleStub() throws Throwable { AddressBookServiceLocator loc = new AddressBookServiceLocator(); final AddressBook binding = loc.getAddressBook(HttpTestUtil.getTestEndpoint(loc.getAddressBookAddress())); ((AddressBookSOAPBindingStub) binding).setMaintainSession(true); testMultithreading(new StubSupplier() { public AddressBook getStub() throws Exception { return binding; } }); } /** * Tests concurrent invocations of different stubs (one per thread) created from a single * locator. This tests the scenario described in <a * href="https://issues.apache.org/jira/browse/AXIS-2498">AXIS-2498</a>. */ public void testSingleLocator() throws Throwable { final AddressBookServiceLocator loc = new AddressBookServiceLocator(); testMultithreading(new StubSupplier() { public AddressBook getStub() throws Exception { AddressBook binding = loc.getAddressBook(HttpTestUtil.getTestEndpoint(loc.getAddressBookAddress())); ((AddressBookSOAPBindingStub) binding).setMaintainSession(true); return binding; } }); } private void testMultithreading(StubSupplier stubSupplier) throws Throwable { Report report = new Report(); final int numThreads = 50; final int numInvocations = 10; CountDownLatch readyLatch = new CountDownLatch(numThreads); CountDownLatch startLatch = new CountDownLatch(1); Thread[] threads = new Thread[numThreads]; for (int i = 0; i < numThreads; ++i) { threads[i] = new Thread(new Invoker(stubSupplier.getStub(), readyLatch, startLatch, report, numInvocations)); threads[i].start(); } readyLatch.await(); startLatch.countDown(); for (int i = 0; i < numThreads; ++i) { threads[i].join(30000); StackTraceElement[] stack = threads[i].getStackTrace(); if (stack.length > 0) { Throwable t = new Throwable("Hanging thread detected"); t.setStackTrace(stack); throw t; } } Throwable error = report.getError(); if (error != null) { throw error; } assertEquals("number of successes", numThreads * numInvocations, report.getSuccessCount()); } // testMultithreading } // class MultithreadTestCase
6,670
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multithread/Report.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.wsdl.multithread; /** * Collects the results from a set of {@link Invoker} instances. */ class Report { private int successCount = 0; private Throwable error; synchronized void addSuccess() { successCount++; } synchronized int getSuccessCount() { return successCount; } synchronized void setError(Throwable error) { if (this.error == null) { this.error = error; } } synchronized Throwable getError() { return error; } }
6,671
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/multithread/Invoker.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.wsdl.multithread; import java.util.concurrent.CountDownLatch; import org.apache.axis.components.logger.LogFactory; import org.apache.commons.logging.Log; import samples.addr.Address; import samples.addr.AddressBook; import samples.addr.Phone; import samples.addr.StateType; class Invoker implements Runnable { private static Log log = LogFactory.getLog(Invoker.class.getName()); private final AddressBook binding; private final CountDownLatch readyLatch; private final CountDownLatch startLatch; private final Report report; private final int numInvocations; Invoker(AddressBook binding, CountDownLatch readyLatch, CountDownLatch startLatch, Report report, int numInvocations) { this.binding = binding; this.readyLatch = readyLatch; this.startLatch = startLatch; this.report = report; this.numInvocations = numInvocations; } public void run() { try { // This ensures that all threads start sending requests at the same time, // thereby increasing the probability of triggering a concurrency issue. readyLatch.countDown(); startLatch.await(); for (int i = 0; i < numInvocations; ++i) { Address address = new Address(); Phone phone = new Phone(); address.setStreetNum(i); address.setStreetName("2"); address.setCity("3"); address.setState(StateType.TX); address.setZip(i); phone.setAreaCode(11); phone.setExchange("22"); phone.setNumber("33"); address.setPhoneNumber(phone); binding.addEntry("hi", address); Address addressRet = binding.getAddressFromName("hi"); // succeeded, count it. report.addSuccess(); } } catch (Throwable t) { // Log a stack trace as we may not be so lucky next time! log.fatal("Throwable caught: ", t); report.setError(t); } } // run }
6,672
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/ram/RamServiceTestCase.java
/** * RamServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.ram; import test.HttpTestUtil; public class RamServiceTestCase extends junit.framework.TestCase { public RamServiceTestCase(String name) { super(name); } public void testRamWSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.ram.RamServiceLocator().getRamAddress() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.ram.RamServiceLocator().getServiceName()); assertTrue(service != null); } public void test1RamValidate() throws Exception { Ram binding; try { RamServiceLocator loc = new RamServiceLocator(); binding = loc.getRam(HttpTestUtil.getTestEndpoint(loc.getRamAddress())); } catch (javax.xml.rpc.ServiceException jre) { throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); } assertTrue("binding is null", binding != null); try { RamData[] input = new RamData[1]; input[0] = new RamData(); input[0].setBankInfoPaymentType("BIPT"); input[0].setBankInfoRequestType("BIRT"); input[0].setCallingClientPortNumber("CCPN"); input[0].setCallingClientUserIdentifier("CCUI"); CreditCard cc = new CreditCard(); cc.setName("NAME"); cc.setNumber("NUMBER"); cc.setExpires(new java.util.Date()); cc.setPostalCode("PC"); input[0].setCreditCard(cc); Fee[] fees = new Fee[1]; fees[0] = new Fee(); fees[0].setAmount(20.0); fees[0].setQuantity(50); fees[0].setCode("CODE"); input[0].setFees(fees); input[0].setMailRoomDate(new java.util.Date()); input[0].setSaleOtherPaymentTotalAmount(100.0); input[0].setSalePostingReferenceText("SPRT"); Response[] output = binding.validate(input); java.util.Date resDate = output[0].getAccountingDate(); java.util.Date now = new java.util.Date(); assertTrue("Time check failed. Result date = " + resDate + ", current time = " + now, resDate.before(now)); } catch (java.rmi.RemoteException re) { throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); } } public static void main(String[] args) throws Exception { RamServiceTestCase test = new RamServiceTestCase("RamServiceTestCase"); test.test1RamValidate(); } }
6,673
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/ram/RamSoapBindingImpl.java
/** * RamSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.ram; public class RamSoapBindingImpl implements Ram{ public Response[] validate(RamData[] in0) throws java.rmi.RemoteException { java.util.Date inDate = in0[0].getCreditCard().getExpires(); java.util.Date now = new java.util.Date(); if (!inDate.before(now)) { throw new java.rmi.RemoteException("Time check failed. Expires date = " + inDate + ", current time = " + now); } Response[] response = new Response[1]; response[0] = new Response(); response[0].setAccountingDate(new java.util.Date()); response[0].setAuthorization("AUTH"); response[0].setHostResponseCode("HRC"); response[0].setHostResponseMessage("HRM"); response[0].setProtoBaseResponseCode("PBRC"); response[0].setProtoBaseResponseMessage("PBRM"); response[0].setReasonCode("REASON"); response[0].setReturnCode("RETURN"); response[0].setSalePostingReferenceText("SPRT"); response[0].setTransactionReferenceNumber("TRN"); return response; } }
6,674
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/gateway/GatewayServiceTestCase.java
/** * GatewayServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.gateway; import test.HttpTestUtil; public class GatewayServiceTestCase extends junit.framework.TestCase { public GatewayServiceTestCase(java.lang.String name) { super(name); } public void test1GatewayTest1() throws Exception { test.wsdl.gateway.Gateway binding; try { GatewayServiceLocator loc = new GatewayServiceLocator(); binding = loc.getGateway(HttpTestUtil.getTestEndpoint(loc.getGatewayAddress())); } 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 test.wsdl.gateway.MyClass myClass = new test.wsdl.gateway.MyClass(); myClass.setValues(new String[][]{{"hello"}}); java.lang.String value = null; value = binding.test1(myClass); // TBD - validate results } public void test2GatewayTest2() throws Exception { test.wsdl.gateway.Gateway binding; try { GatewayServiceLocator loc = new GatewayServiceLocator(); binding = loc.getGateway(HttpTestUtil.getTestEndpoint(loc.getGatewayAddress())); } 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 test.wsdl.gateway.MyClass response = null; response = binding.test2(); assertTrue(response.getValues()!=null); System.out.println("Response cell 1,1="+response.getValues()[1][1]); } public void test3GatewayTest3() throws Exception { test.wsdl.gateway.Gateway binding; try { GatewayServiceLocator loc = new GatewayServiceLocator(); binding = loc.getGateway(HttpTestUtil.getTestEndpoint(loc.getGatewayAddress())); } 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 java.lang.String[][] value = null; value = binding.test3(); // TBD - validate results } public void test4GatewayTest4() throws Exception { test.wsdl.gateway.Gateway binding; try { GatewayServiceLocator loc = new GatewayServiceLocator(); binding = loc.getGateway(HttpTestUtil.getTestEndpoint(loc.getGatewayAddress())); } 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 java.lang.String value = null; value = binding.test4(new java.lang.String[0][0]); // TBD - validate results } }
6,675
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/gateway/GatewaySoapBindingImpl.java
/** * GatewaySoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.gateway; public class GatewaySoapBindingImpl implements test.wsdl.gateway.Gateway{ public java.lang.String test1(test.wsdl.gateway.MyClass myClass) throws java.rmi.RemoteException { String[][] textArray=myClass.getValues(); return "value of 1,1 = "+textArray[0][0]; } public test.wsdl.gateway.MyClass test2() throws java.rmi.RemoteException { String[][] param=new String[2][]; param[0]=new String[1]; param[0][0]="0,0"; param[1]=new String[3]; param[1][0]="1,0"; param[1][1]="*1,1"; param[1][2]="1,2"; MyClass myClass=new MyClass(); myClass.setValues(param); return myClass; } public java.lang.String[][] test3() throws java.rmi.RemoteException { return null; } public java.lang.String test4(java.lang.String[][] in0) throws java.rmi.RemoteException { return null; } }
6,676
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qualify2/AttributeQualify_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. */ /** * AttributeQualify_BindingImpl.java * * Service implementation for Qualified/Nonqualified attributes in a complex * type. The service validates the request XML and the test client validates * the response XML to verify the attributes that should be namesapce qualified * are, and those that are not supposed to be aren't. */ package test.wsdl.qualify2; 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.Attr; import org.w3c.dom.Element; public class AttributeQualify_BindingImpl implements test.wsdl.qualify2.AttributeQualify_PortType { public static final String NAMESPACE = "urn:attributeQualify"; public test.wsdl.qualify2.Phone echoPhone(test.wsdl.qualify2.Phone in) 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"); } // Now we have a DOM Element, verfy namespace attributes // Here is what we think it looks like // <phone age="35" // ns1:color="red" // ns1:hair="brown" // xmlns:ns1="urn:attributeQualify"> // <areaCode>505</areaCode> // <exchange>555</exchange> // <number>1212</number> //</phone> String bodyNS = body.getNamespaceURI(); if (! NAMESPACE.equals(bodyNS)) throw new AxisFault("On Server: Namespace of body element incorrect: " + bodyNS + " should be: " + NAMESPACE); // Verify age does NOT have a namespace (unqualified) Attr ageAttr = body.getAttributeNode("age"); if (ageAttr.getNamespaceURI() != null) { throw new AxisFault("On Server: Namespace of age attribute incorrect: " + ageAttr.getNamespaceURI() + " should be: NULL"); } // Verify hair and color have the right namespace (are qualified). Attr hairAttr = body.getAttributeNodeNS(NAMESPACE, "hair"); if (hairAttr == null) { throw new AxisFault("On Server: Missing namespace for attribute 'hair' should be: " + NAMESPACE); } Attr colorAttr = body.getAttributeNodeNS(NAMESPACE, "color"); if (hairAttr == null) { throw new AxisFault("On Server: Missing namespace for attribute 'color' should be: " + NAMESPACE); } // Echo input return in; } }
6,677
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/qualify2/AttributeQualify_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.qualify2; import junit.framework.AssertionFailedError; import org.apache.axis.Message; import org.apache.axis.MessageContext; import org.apache.axis.message.SOAPEnvelope; import org.w3c.dom.Attr; import org.w3c.dom.Element; import test.HttpTestUtil; import javax.xml.rpc.ServiceException; public class AttributeQualify_ServiceTestCase extends junit.framework.TestCase { public static final String NAMESPACE = "urn:attributeQualify"; public AttributeQualify_ServiceTestCase(String name) { super(name); } public void test1AttributeQualifyEchoPhone() throws Exception { test.wsdl.qualify2.AttributeQualify_BindingStub binding; test.wsdl.qualify2.AttributeQualify_ServiceLocator locator = new test.wsdl.qualify2.AttributeQualify_ServiceLocator(); try { binding = (test.wsdl.qualify2.AttributeQualify_BindingStub)locator.getAttributeQualify(HttpTestUtil.getTestEndpoint(locator.getAttributeQualifyAddress())); } 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.qualify2.Phone phone = new Phone(); phone.setAge(35); phone.setAreaCode(505); phone.setColor("red"); phone.setExchange("555"); phone.setHair("brown"); phone.setNumber("1212"); Phone result = binding.echoPhone(phone); // Check the response assertTrue(result.equals(phone)); // Validate XML reponse to make sure attributes 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.out.println("Response:\n---------\n" + responseString + "\n------"); // Now we have a DOM Element, verfy namespace attributes // Here is what we think it looks like // <phone age="35" // ns1:color="red" // ns1:hair="brown" // xmlns:ns1="urn:attributeQualify"> // <areaCode>505</areaCode> // <exchange>555</exchange> // <number>1212</number> //</phone> String bodyNS = body.getNamespaceURI(); assertEquals("Namespace of body element incorrect", bodyNS, NAMESPACE); // Verify age does NOT have a namespace (unqualified) Attr ageAttr = body.getAttributeNode("age"); assertNull("namespace of attribute 'age' should be null", ageAttr.getNamespaceURI()); // Verify hair and color have the right namespace (are qualified). Attr hairAttr = body.getAttributeNodeNS(NAMESPACE, "hair"); assertNotNull("namespace of attribute 'hair' is not correct", hairAttr); Attr colorAttr = body.getAttributeNodeNS(NAMESPACE, "color"); assertNotNull("namespace of attribute 'color' is not correct", colorAttr); } catch (java.rmi.RemoteException re) { throw new AssertionFailedError("Remote Exception caught: " + re); } } }
6,678
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapperHolder2/ExampleSoapTestCase.java
package test.wsdl.wrapperHolder2; import javax.xml.rpc.holders.ByteArrayHolder; import javax.xml.rpc.holders.LongWrapperHolder; import test.HttpTestUtil; public class ExampleSoapTestCase extends junit.framework.TestCase { public ExampleSoapTestCase(java.lang.String name) { super(name); } public void testWrapperHolder2WSDL() throws Exception { javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); java.net.URL url = HttpTestUtil.getTestEndpoint(new test.wsdl.wrapperHolder2.DoExample_ServiceLocator().getWrapperHolder2Address() + "?WSDL"); javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.wrapperHolder2.DoExample_ServiceLocator().getServiceName()); assertTrue(service != null); } public void test1WrapperHolder2DoExample() throws Exception { test.wsdl.wrapperHolder2.ExampleSoapStub binding; try { DoExample_ServiceLocator loc = new DoExample_ServiceLocator(); binding = (ExampleSoapStub)loc.getWrapperHolder2(HttpTestUtil.getTestEndpoint(loc.getWrapperHolder2Address())); } 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); byte[][] in1 = new byte[][] { { (byte) 0xbe, (byte) 0xef, (byte) 0xcc }, { (byte) 0xee, (byte) 0xff, (byte) 0xaa }, }; Long in2 = new Long(3); holders.ByteArrayArrayHolder val1 = new holders.ByteArrayArrayHolder(); test.wsdl.wrapperHolder2.holders.OutArrayHolder val2 = new test.wsdl.wrapperHolder2.holders.OutArrayHolder(); holders.IntArrayWrapperHolder val3 = new holders.IntArrayWrapperHolder(); holders.IntArrayHolder val4 = new holders.IntArrayHolder(); holders.ByteArrayHolder val5 = new holders.ByteArrayHolder(); // Test operation binding.doExample(in1, in2, val1, val2, val3, val4, val5); assertEquals("Unexpected value for holders.ByteArrayArrayHolder", byteArrayAsList(in1[0]), byteArrayAsList(val1.value[0])); assertEquals("Unexpected value for test.wsdl.WrapperHolder.holders.OutArrayHolder", val2.value[0], 1); assertEquals("Unexpected value for holders.IntArrayWrapperHolder", val3.value[0].intValue(), 4); assertEquals("Unexpected value for holders.IntArrayHolder", val4.value[0], 6); assertEquals("Unexpected value for holders.ByteArrayHolder", val5.value[0], (byte)0x9); } private static java.util.List byteArrayAsList(final byte[] a) { return new java.util.AbstractList() { public Object get(int i) { return new Byte(a[i]); } public int size() { return a.length; } public Object set(int i, Object o) { byte oldVal = a[i]; a[i] = ((Byte) o).byteValue(); return new Byte(oldVal); } }; } }
6,679
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/wrapperHolder2/ExampleSoapImpl.java
/** * ExampleSoapImpl.java * * Verifies that wrapped operations featuring Java wrapper array types are working. */ package test.wsdl.wrapperHolder2; public class ExampleSoapImpl implements test.wsdl.wrapperHolder2.ExampleSoap { public void doExample(byte[][] value1, java.lang.Long value2, holders.ByteArrayArrayHolder val1, test.wsdl.wrapperHolder2.holders.OutArrayHolder val2, holders.IntArrayWrapperHolder val3, holders.IntArrayHolder val4, holders.ByteArrayHolder val5) throws java.rmi.RemoteException { val1.value = value1; val2.value = new long[] { 1, 2, 3 }; val3.value = new Integer[] { new Integer(4), new Integer(5) }; val4.value = new int[] { 6, 7, 8 }; val5.value = new byte[] { (byte)0x9, (byte)0x10 }; } }
6,680
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/session/SessionTestSoapBindingImpl.java
/** * SessionTestSoapBindingImpl.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.session; /** * Class SessionTestSoapBindingImpl */ public class SessionTestSoapBindingImpl implements test.wsdl.session.SessionTestServer { /** * Method doSomething * * @return * * @throws java.rmi.RemoteException */ public boolean doSomething() throws java.rmi.RemoteException { // if this is my session only then the data will be 0 boolean succeeded = true; int count = countUp(); if (count != 1) { System.out.println("Failed with count=" + count); succeeded = false; } try { // simulate some busy processing Thread.currentThread().sleep(999); } catch (InterruptedException e) { // ignore } // check exit count count = countDown(); if (count != 0) { System.out.println("Failed with count=" + count); succeeded = false; } return succeeded; } /** * Count one caller * * @return Number of simultaneous session callers. */ private synchronized int countUp() { sessionCallers++; return sessionCallers; } /** * Count down one caller * * @return Number of callers left. */ private synchronized int countDown() { sessionCallers--; return sessionCallers; } /** count simultaneous session callers */ private int sessionCallers = 0; }
6,681
0
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/test/java/test/wsdl/session/SessionTestCase.java
/** * SessionTestServerServiceTestCase.java * * This file was auto-generated from WSDL * by the Apache Axis WSDL2Java emitter. */ package test.wsdl.session; import test.HttpTestUtil; /** * Class SessionTestCase */ public class SessionTestCase extends junit.framework.TestCase { /** * Constructor SessionTestCase * @param name */ public SessionTestCase(java.lang.String name) { super(name); } /** * Method test1SessionTestDoSomething */ public void test1SessionTestDoSomething() { // Threads array SessionTest[] clients = new SessionTest[numThreads]; for (int i = 0; i < numThreads; i++) { clients[i] = new SessionTest(); } for (int j = 0; j < numThreads; j++) { clients[j].start(); try { Thread.currentThread().sleep(150); } catch (InterruptedException e) { System.out.println("Threads interrupted"); } } try { synchronized (lock) { while (count != 0) { lock.wait(); } } } catch (InterruptedException ie) { System.out.println("Threads interrupted"); } System.out.println("Succeeded " + succeeded + " times."); System.out.println("Failed " + failed + " times."); assertTrue("found session failures", (failed == 0)); } /** * Class SessionTest */ public class SessionTest extends Thread { /** * run the thread until done. */ public void run() { try { // Create an instance of the Web service interface. SessionTestServerServiceLocator wsloc = new SessionTestServerServiceLocator(); SessionTestServer ws = wsloc.getSessionTest(HttpTestUtil.getTestEndpoint(wsloc.getSessionTestAddress())); // Maintain sessions for test calls. ((org.apache.axis.client.Stub) ws).setMaintainSession(true); for (int i = 0; i < NO_OF_CALLS; i++) { if (ws.doSomething() == false) { synchronized (testLock) { failed++; } } else { synchronized (testLock) { succeeded++; } } } } catch (Throwable e) { synchronized (testLock) { failed++; } e.printStackTrace(); } // checkout synchronized (lock) { count--; lock.notifyAll(); } } } /** Field lock */ private static Object lock = new Object(); /** Field testLock */ private static Object testLock = new Object(); /** Field NO_OF_THREADS */ private static final int NO_OF_THREADS = 3; /** Field NO_OF_CALLS */ private static final int NO_OF_CALLS = 6; /** Field numThreads */ private static int numThreads = NO_OF_THREADS; /** Field count */ private static int count = NO_OF_THREADS; /** Field failed */ private static int failed = 0; /** Field succeeded */ private static int succeeded = 0; /** * Main entry point for the application. * Takes number of threads as argument. * * @param args * * @throws Exception */ public static void main(String[] args) throws Exception { numThreads = count = Integer.parseInt(args[0]); SessionTestCase testCase = new SessionTestCase("SessionTestCase"); testCase.test1SessionTestDoSomething(); } }
6,682
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF2SOAPProxy.java
package test.rpc; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import java.util.Calendar; public final class IF2SOAPProxy implements IF2SOAP { private String m_service; private String m_url; private QName m_beanQName; private QName m_beanArrayQName; private QName m_stringArrayQName; private QName m_calendarArrayQName; public IF2SOAPProxy(String service, String url) { m_service = service; m_url = url; m_beanQName = new QName("urn:" + m_service, "Bean"); m_beanArrayQName = new QName("urn:" + m_service, "Bean[]"); m_stringArrayQName = new QName("urn:" + m_service, "String[]"); m_calendarArrayQName = new QName("urn:" + m_service, "Calendar[]"); } public IF1 getBeanById(String id) throws Exception { IF1 bean = null; if (id == null) throw new Exception("invalid id"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeanById")); call.addParameter("id", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.setReturnType(m_beanQName); bean = (IF1) call.invoke(new Object[] { id }); return bean; } public IF1[] getAllBeans() throws Exception { return getAllBeans(null); } public IF1[] getAllBeans(String[] filter) throws Exception { IF1[] beans = null; Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getAllBeans")); call.setReturnType(m_beanArrayQName); if (filter == null) beans = (IF1[]) call.invoke(new Object[0]); else { call.addParameter("filter", m_stringArrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { filter }); } return beans; } public String[] getAllCategories() throws Exception { String[] categories = null; Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getAllCategories")); call.setReturnType(m_stringArrayQName); categories = (String[]) call.invoke(new Object[0]); return categories; } public IF1[] getBeansByCategory(String category) throws Exception { return getBeansByCategory(category, null); } public IF1[] getBeansByCategory(String category, String[] filter) throws Exception { IF1[] beans = null; if (category == null) throw new Exception("invalid category"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByCategory")); call.setReturnType(m_beanArrayQName); call.addParameter("category", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { category }); else { call.addParameter("filter", m_stringArrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { category, filter }); } return beans; } public IF1[] getBeansByDate(Calendar[] dates) throws Exception { return getBeansByDate(dates, null); } public IF1[] getBeansByDate(Calendar[] dates, String[] filter) throws Exception { IF1[] beans = null; if (dates == null) throw new Exception("invalid dates"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByDate")); call.setReturnType(m_beanArrayQName); call.addParameter("dates", m_calendarArrayQName, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { dates }); else { call.addParameter("filter", m_stringArrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { dates, filter }); } return beans; } public IF1[] getBeansByExpression(int expType, String expression) throws Exception { return getBeansByExpression(expType, expression, null); } public IF1[] getBeansByExpression(int expType, String expression, String[] filter) throws Exception { IF1[] beans = null; if (expression == null) throw new Exception("invalid expression"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByExpression")); call.setReturnType(m_beanArrayQName); call.addParameter("expType", org.apache.axis.Constants.XSD_INT, ParameterMode.IN); call.addParameter("expression", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { new Integer(expType), expression }); else { call.addParameter("filter", m_stringArrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { new Integer(expType), expression, filter }); } return beans; } public String getXMLForBean(IF1 bean) throws Exception { String xml = null; if (bean == null) throw new Exception("invalid bean"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getXMLForBean")); call.addParameter("bean", m_beanQName, ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.XSD_STRING); xml = (String) call.invoke(new Object[] { bean }); return xml; } private Call getCall() throws Exception { Call call = null; Service service = new Service(); call = (Call) service.createCall(); call.registerTypeMapping(Bean.class, m_beanQName, new BeanSerializerFactory(Bean.class, m_beanQName), new BeanDeserializerFactory(Bean.class, m_beanQName)); return call; } }
6,683
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF3SOAPImpl.java
package test.rpc; import java.util.Calendar; import java.util.GregorianCalendar; //import org.jdom.Document; //import org.jdom.output.XMLOutputter; public final class IF3SOAPImpl implements IF3SOAP { private Bean[] m_beans; private String[] m_categories; public IF3SOAPImpl() { Bean bean1 = new Bean(); bean1.setId("42042042042"); bean1.setTitle("Test Bean"); bean1.setCategory("Test"); Calendar date = new GregorianCalendar(); bean1.setDate(date); Bean bean2 = new Bean(); bean2.setId("11011011011"); bean2.setTitle("Test Bean 2"); bean2.setCategory("Test 2"); bean2.setDate(date); m_beans = new Bean[2]; m_beans[0] = bean1; m_beans[1] = bean2; m_categories = new String[2]; m_categories[0] = "Test"; m_categories[1] = "Std"; } public IF1 getBeanById(String id) throws Exception { return m_beans[0]; } public IF1[] getAllBeans() throws Exception { return m_beans; } public IF1[] getAllBeans(String[] filter) throws Exception { return m_beans; } public String[] getAllCategories() throws Exception { return m_categories; } public IF1[] getBeansByCategory(String category) throws Exception { return m_beans; } public IF1[] getBeansByCategory(String category, String[] filter) throws Exception { return m_beans; } public IF1[] getBeansByDate(Calendar[] dates) throws Exception { return m_beans; } public IF1[] getBeansByDate(Calendar[] dates, String[] filter) throws Exception { return m_beans; } public IF1[] getBeansByExpression(int expType, String expression) throws Exception { return m_beans; } public IF1[] getBeansByExpression(int expType, String expression, String[] filter) throws Exception { return m_beans; } public String getXMLForBean(IF1 bean) throws Exception { return "<bean>\n</bean>"; } public IF1[] getBeansByCategory(String ifId, String category) throws Exception { return m_beans; } public IF1[] getBeansByCategory(String ifId, String category, String[] filter) throws Exception { return m_beans; } public IF1[] getBeansByDate(String ifId, Calendar[] dates) throws Exception { return m_beans; } public IF1[] getBeansByDate(String ifId, Calendar[] dates, String[] filter) throws Exception { return m_beans; } public IF1[] getBeansByExpression(String ifId, int expType, String expression) throws Exception { return m_beans; } public IF1[] getBeansByExpression(String ifId, int expType, String expression, String[] filter) throws Exception { return m_beans; } }
6,684
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF3SOAP.java
package test.rpc; import java.util.Calendar; public interface IF3SOAP extends IF2SOAP { public IF1[] getBeansByCategory(String ifId, String category) throws Exception; public IF1[] getBeansByCategory(String ifId, String category, String[] filter) throws Exception; public IF1[] getBeansByDate(String ifId, Calendar[] dates) throws Exception; public IF1[] getBeansByDate(String ifId, Calendar[] dates, String[] filter) throws Exception; public IF1[] getBeansByExpression(String ifId, int expType, String expression) throws Exception; public IF1[] getBeansByExpression(String ifId, int expType, String expression, String[] filter) throws Exception; }
6,685
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF2SOAP.java
package test.rpc; import java.util.Calendar; public interface IF2SOAP { public static final int KEYWORD_EXP = 0; public static final int CONTENT_EXP = 1; public IF1 getBeanById(String id) throws Exception; public IF1[] getAllBeans() throws Exception; public IF1[] getAllBeans(String[] filter) throws Exception; public String[] getAllCategories() throws Exception; public IF1[] getBeansByCategory(String category) throws Exception; public IF1[] getBeansByCategory(String category, String[] filter) throws Exception; public IF1[] getBeansByDate(Calendar[] dates) throws Exception; public IF1[] getBeansByDate(Calendar[] dates, String[] filter) throws Exception; public IF1[] getBeansByExpression(int expType, String expression) throws Exception; public IF1[] getBeansByExpression(int expType, String expression, String[] filter) throws Exception; public String getXMLForBean(IF1 bean) throws Exception; }
6,686
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/Bean.java
package test.rpc; import java.util.Calendar; public class Bean implements IF1 { protected String id; protected String title; protected String category; protected Calendar date; public Bean() { } public String getId() { return id; } public void setId(String aId) { id = aId; } public String getTitle() { return title; } public void setTitle(String aTitle) { title = aTitle; } public String getCategory() { return category; } public void setCategory(String aCategory) { category = aCategory; } public Calendar getDate() { return date; } public void setDate(Calendar aDate) { date = aDate; } }
6,687
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF1.java
package test.rpc; import java.util.Calendar; public interface IF1 { public String getId(); public String getTitle(); public String getCategory(); public Calendar getDate(); }
6,688
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/rpc/IF3SOAPProxy.java
package test.rpc; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import org.apache.axis.Constants; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import java.util.Calendar; public final class IF3SOAPProxy implements IF3SOAP { private String m_service; private String m_url; private QName m_beanQName; private QName m_arrayQName; public IF3SOAPProxy(String service, String url) { m_service = service; m_url = url; m_beanQName = new QName("urn:" + m_service, "Bean"); m_arrayQName = Constants.SOAP_ARRAY; } public IF1 getBeanById(String id) throws Exception { IF1 bean = null; if (id == null) throw new Exception("invalid id"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeanById")); call.addParameter("id", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.setReturnType(m_beanQName); bean = (IF1) call.invoke(new Object[] { id }); return bean; } public IF1[] getAllBeans() throws Exception { return getAllBeans(null); } public IF1[] getAllBeans(String[] filter) throws Exception { IF1[] beans = null; Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getAllBeans")); call.setReturnType(m_arrayQName); if (filter == null) beans = (IF1[]) call.invoke(new Object[0]); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { filter }); } return beans; } public String[] getAllCategories() throws Exception { String[] categories = null; Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getAllCategories")); call.setReturnType(m_arrayQName); categories = (String[]) call.invoke(new Object[0]); return categories; } public IF1[] getBeansByCategory(String category) throws Exception { return getBeansByCategory(category, (String[]) null); } public IF1[] getBeansByCategory(String category, String[] filter) throws Exception { IF1[] beans = null; if (category == null) throw new Exception("invalid category"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByCategory")); call.setReturnType(m_arrayQName); call.addParameter("category", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { category }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { category, filter }); } return beans; } public IF1[] getBeansByDate(Calendar[] dates) throws Exception { return getBeansByDate(dates, null); } public IF1[] getBeansByDate(Calendar[] dates, String[] filter) throws Exception { IF1[] beans = null; if (dates == null) throw new Exception("invalid dates"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByDate")); call.setReturnType(m_arrayQName); call.addParameter("dates", m_arrayQName, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { dates }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { dates, filter }); } return beans; } public IF1[] getBeansByExpression(int expType, String expression) throws Exception { return getBeansByExpression(expType, expression, null); } public IF1[] getBeansByExpression(int expType, String expression, String[] filter) throws Exception { IF1[] beans = null; if (expression == null) throw new Exception("invalid expression"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByExpression")); call.setReturnType(m_arrayQName); call.addParameter("expType", org.apache.axis.Constants.XSD_INT, ParameterMode.IN); call.addParameter("expression", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { new Integer(expType), expression }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { new Integer(expType), expression, filter }); } return beans; } public String getXMLForBean(IF1 bean) throws Exception { String xml = null; if (bean == null) throw new Exception("invalid bean"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getXMLForBean")); call.addParameter("bean", m_beanQName, ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.XSD_STRING); xml = (String) call.invoke(new Object[] { bean }); return xml; } public IF1[] getBeansByCategory(String ifId, String category) throws Exception { return getBeansByCategory(ifId, category, null); } public IF1[] getBeansByCategory(String ifId, String category, String[] filter) throws Exception { IF1[] beans = null; if (ifId == null) throw new Exception("invalid ifId"); if (category == null) throw new Exception("invalid category"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByCategory")); call.setReturnType(m_arrayQName); call.addParameter("ifId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.addParameter("category", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { ifId, category }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { ifId, category, filter }); } return beans; } public IF1[] getBeansByDate(String ifId, Calendar[] dates) throws Exception { return getBeansByDate(ifId, dates, null); } public IF1[] getBeansByDate(String ifId, Calendar[] dates, String[] filter) throws Exception { IF1[] beans = null; if (ifId == null) throw new Exception("invalid ifId"); if (dates == null) throw new Exception("invalid dates"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByDate")); call.setReturnType(m_arrayQName); call.addParameter("ifId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.addParameter("dates", m_arrayQName, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { ifId, dates }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { ifId, dates, filter }); } return beans; } public IF1[] getBeansByExpression(String ifId, int expType, String expression) throws Exception { return getBeansByExpression(ifId, expType, expression, null); } public IF1[] getBeansByExpression(String ifId, int expType, String expression, String[] filter) throws Exception { IF1[] beans = null; if (ifId == null) throw new Exception("invalid ifId"); if (expression == null) throw new Exception("invalid expression"); Call call = getCall(); call.setTargetEndpointAddress(m_url); call.setOperationName(new QName(m_service, "getBeansByExpression")); call.setReturnType(m_arrayQName); call.addParameter("ifId", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); call.addParameter("expType", org.apache.axis.Constants.XSD_INT, ParameterMode.IN); call.addParameter("expression", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN); if (filter == null) beans = (IF1[]) call.invoke(new Object[] { ifId, new Integer(expType), expression }); else { call.addParameter("filter", m_arrayQName, ParameterMode.IN); beans = (IF1[]) call.invoke(new Object[] { ifId, new Integer(expType), expression, filter }); } return beans; } private Call getCall() throws Exception { Call call = null; Service service = new Service(); call = (Call) service.createCall(); call.registerTypeMapping(Bean.class, m_beanQName, new BeanSerializerFactory(Bean.class, m_beanQName), new BeanDeserializerFactory(Bean.class, m_beanQName)); return call; } }
6,689
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/NestedBean.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.functional; import java.util.Date; /** * More Complex JavaBean used in serialisation tests. * * @author Patrick Martin */ public class NestedBean { private Date _startDate; private String _testString; private SimpleBean _simpleBean; private SimpleBean[] _simpleBeanList; public SimpleBean getSimpleBean() { return _simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this._simpleBean = simpleBean; } public SimpleBean[] getSimpleBeanList() { return _simpleBeanList; } public void setSimpleBeanList(SimpleBean[] simpleBeanList) { this._simpleBeanList = simpleBeanList; } public Date getStartDate() { return _startDate; } public void setStartDate(Date startDate) { this._startDate = startDate; } public String getTestString() { return _testString; } public void setTestString(String testString) { this._testString = testString; } }
6,690
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/TestIF3SOAP.java
package test.functional; import junit.framework.TestCase; import test.HttpTestUtil; import test.rpc.IF1; import test.rpc.IF2SOAP; import test.rpc.IF3SOAP; import test.rpc.IF3SOAPProxy; import java.util.Calendar; import java.util.GregorianCalendar; public final class TestIF3SOAP extends TestCase { private IF3SOAPProxy m_soap; public TestIF3SOAP(String name) { super(name); } protected void setUp() throws Exception { if (m_soap == null) m_soap = new IF3SOAPProxy("IF3SOAP", HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/services/IF3SOAP").toString()); } // setUp protected void tearDown() { } // tearDown public void testGetBeanById() throws Exception { IF2SOAP soap = m_soap; IF1 bean = soap.getBeanById("42042042042"); assertNotNull("bean is null", bean); System.out.println("beanById:"); System.out.println("id: " + bean.getId()); } public void testGetAllBeans() throws Exception { IF2SOAP soap = m_soap; IF1[] beans = soap.getAllBeans(); assertNotNull("beans is null", beans); System.out.println("allBeans:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetAllBeansFiltered() throws Exception { IF2SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; IF1[] beans = soap.getAllBeans(filter); assertNotNull("beans is null", beans); System.out.println("allBeansFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetAllCategories() throws Exception { IF2SOAP soap = m_soap; String[] categories = soap.getAllCategories(); assertNotNull("categories is null", categories); System.out.println("allCategories:"); for (int i = 0; i < categories.length; i++) System.out.println("cat[" + i + "]: " + categories[i]); } public void testGetBeansByCategory() throws Exception { IF2SOAP soap = m_soap; IF1[] beans = soap.getBeansByCategory("Test"); assertNotNull("beans is null", beans); System.out.println("beansByCategory:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansByCategoryFiltered() throws Exception { IF2SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; IF1[] beans = soap.getBeansByCategory("Test", filter); assertNotNull("beans is null", beans); System.out.println("beansByCategoryFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansByDate() throws Exception { IF2SOAP soap = m_soap; Calendar[] dates = new Calendar[1]; dates[0] = new GregorianCalendar(); IF1[] beans = soap.getBeansByDate(dates); assertNotNull("beans is null", beans); System.out.println("beansByDate:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansByDateFiltered() throws Exception { IF2SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; Calendar[] dates = new Calendar[1]; dates[0] = new GregorianCalendar(); IF1[] beans = soap.getBeansByDate(dates, filter); assertNotNull("beans is null", beans); System.out.println("beansByDateFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansByExpression() throws Exception { IF2SOAP soap = m_soap; IF1[] beans = soap.getBeansByExpression(IF2SOAP.KEYWORD_EXP, "keyword"); assertNotNull("beans is null", beans); System.out.println("beansByExpression:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansByExpressionFiltered() throws Exception { IF2SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; IF1[] beans = soap.getBeansByExpression(IF2SOAP.KEYWORD_EXP, "keyword", filter); assertNotNull("beans is null", beans); System.out.println("beansByExpressionFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetXMLForBean() throws Exception { IF2SOAP soap = m_soap; IF1 bean = soap.getBeanById("42042042042"); String xml = soap.getXMLForBean(bean); assertNotNull("xml is null", xml); System.out.println("xmlForBean:"); System.out.println("xml: " + xml); } public void testGetBeansForIFByCategory() throws Exception { IF3SOAP soap = m_soap; IF1[] beans = soap.getBeansByCategory("if", "Test"); assertNotNull("beans is null", beans); System.out.println("beansForIFByCategory:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansForIFByCategoryFiltered() throws Exception { IF3SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; IF1[] beans = soap.getBeansByCategory("if", "Test", filter); assertNotNull("beans is null", beans); System.out.println("beansForIFByCategoryFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansForIFByDate() throws Exception { IF3SOAP soap = m_soap; Calendar[] dates = new Calendar[1]; dates[0] = new GregorianCalendar(); IF1[] beans = soap.getBeansByDate("if", dates); assertNotNull("beans is null", beans); System.out.println("beansForIFByDate:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansForIFByDateFiltered() throws Exception { IF3SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; Calendar[] dates = new Calendar[1]; dates[0] = new GregorianCalendar(); IF1[] beans = soap.getBeansByDate("if", dates, filter); assertNotNull("beans is null", beans); System.out.println("beansForIFByDateFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansForIFByExpression() throws Exception { IF3SOAP soap = m_soap; IF1[] beans = soap.getBeansByExpression("if", IF2SOAP.KEYWORD_EXP, "keyword"); assertNotNull("beans is null", beans); System.out.println("beansForIFByExpression:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } public void testGetBeansForIFByExpressionFiltered() throws Exception { IF3SOAP soap = m_soap; String[] filter = new String[1]; filter[0] = "11011011011"; IF1[] beans = soap.getBeansByExpression("if", IF2SOAP.KEYWORD_EXP, "keyword", filter); assertNotNull("beans is null", beans); System.out.println("beansForIFByExpressionFiltered:"); for (int i = 0; i < beans.length; i++) System.out.println("id[" + i + "]: " + beans[i].getId()); } }
6,691
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/SimpleBean.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.functional; /** * Very Simple JavaBean for Very Simple serialisation tests. * * @author Patrick Martin */ public class SimpleBean { private int intValue; public int getIntValue() { return intValue; } public void setIntValue(int intValue) { this.intValue = intValue; } }
6,692
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/TestJWSFault.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.functional; import junit.framework.TestCase; import test.HttpTestUtil; import javax.xml.messaging.URLEndpoint; import javax.xml.soap.MessageFactory; import javax.xml.soap.Name; import javax.xml.soap.SOAPBody; import javax.xml.soap.SOAPBodyElement; import javax.xml.soap.SOAPConnection; import javax.xml.soap.SOAPConnectionFactory; import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPMessage; /** * Test the JAX-RPC compliance samples. */ public class TestJWSFault extends TestCase { public void testJWSFault() throws Exception { SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance(); SOAPConnection con = scFactory.createConnection(); MessageFactory factory = MessageFactory.newInstance(); SOAPMessage message = factory.createMessage(); SOAPEnvelope envelope = message.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); Name bodyName = envelope.createName("echo"); SOAPBodyElement bodyElement = body.addBodyElement(bodyName); Name name = envelope.createName("arg0"); SOAPElement symbol = bodyElement.addChildElement(name); symbol.addTextNode("Hello"); URLEndpoint endpoint = new URLEndpoint(HttpTestUtil.getTestEndpoint("http://localhost:8080/axis/FaultTest.jws").toString()); SOAPMessage response = con.call(message, endpoint); SOAPBody respBody = response.getSOAPPart().getEnvelope().getBody(); assertTrue(respBody.hasFault()); } }
6,693
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/IAutoTypes.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.functional; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; /** * Interface which will be used as the client side proxy * view of the Web Service. * * @author Patrick Martin */ public interface IAutoTypes extends Remote { String ping() throws RemoteException; SimpleBean getBean() throws RemoteException; void setBean(SimpleBean bean) throws RemoteException; SimpleBean echoBean(SimpleBean bean) throws RemoteException; SimpleBean[] getBeanArray(int count) throws RemoteException; void setBeanArray(SimpleBean[] beans) throws RemoteException; SimpleBean[] echoBeanArray(SimpleBean[] beans) throws RemoteException; ArrayList getBeanArrayList(int count) throws RemoteException; int setBeanArrayList(ArrayList beansArr) throws RemoteException; NestedBean getNestedBean() throws RemoteException; void setNestedBean(NestedBean value) throws RemoteException; NestedBean echoNestedBean(NestedBean value) throws RemoteException; }
6,694
0
Create_ds/axis-axis1-java/integration/src/test/java/test
Create_ds/axis-axis1-java/integration/src/test/java/test/functional/TestAutoTypes.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.functional; import junit.framework.TestCase; import org.apache.axis.AxisProperties; import org.apache.axis.client.AdminClient; import org.apache.axis.utils.NetworkUtils; import javax.xml.namespace.QName; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory; import javax.xml.rpc.Stub; import java.net.URL; import java.util.Date; public class TestAutoTypes extends TestCase { protected void setUp() throws java.lang.Exception { AxisProperties.setProperty("axis.doAutoTypes", "true"); String[] args = { "src/test/wsdd/functional/auto-deploy.wsdd" }; AdminClient.main(args); } protected void tearDown() throws java.lang.Exception { AxisProperties.setProperty("axis.doAutoTypes", "false"); String[] args = { "/src/test/wsdd/functional/auto-undeploy.wsdd" }; AdminClient.main(args); } private IAutoTypes getSimpleProxy() throws Exception { String thisHost = NetworkUtils.getLocalHostname(); String thisPort = System.getProperty("test.functional.ServicePort", "8080"); //location of wsdl file String wsdlLocation = "http://" + thisHost + ":" + thisPort + "/axis/AutoTypesTest.jws?wsdl"; URL urlWsdl = new URL(wsdlLocation); String nameSpaceUri = "http://" + thisHost + ":" + thisPort + "/axis/AutoTypesTest.jws"; String serviceName = "AutoTypesTestService"; String portName = "AutoTypesTest"; ServiceFactory serviceFactory = ServiceFactory.newInstance(); Service service = serviceFactory.createService(urlWsdl, new QName(nameSpaceUri, serviceName)); Stub stub = (Stub) service.getPort(new QName(nameSpaceUri, portName), IAutoTypes.class); IAutoTypes myProxy = (IAutoTypes) stub; return myProxy; } public static void main(String[] args) throws Exception { junit.textui.TestRunner.run(TestAutoTypes.class); } public void testPing() throws Exception { IAutoTypes test = getSimpleProxy(); String ret = test.ping(); assertEquals("echoed string incorrect IntValue", "Pong", ret); } public void testGetBean() throws Exception { getSimpleProxy().getBean(); } public void testSetBean() throws Exception { getSimpleProxy().setBean(new SimpleBean()); } public void testEchoBean() throws Exception { SimpleBean in = new SimpleBean(); in.setIntValue(42); SimpleBean out = getSimpleProxy().echoBean(in); assertEquals("echoed bean incorrect IntValue", 42, out.getIntValue()); } public void testEchoBeanArray() throws Exception { SimpleBean[] beans = (SimpleBean[]) getSimpleProxy().echoBeanArray(new SimpleBean[]{ new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean()}); assertEquals("expected array of SimpleBean", SimpleBean[].class, beans .getClass()); assertEquals("expected array of SimpleBean of length 6", 6, beans.length); } public void testGetBeanArray() throws Exception { SimpleBean[] beans = (SimpleBean[]) getSimpleProxy().getBeanArray(6); assertEquals("expected array of SimpleBean", SimpleBean[].class, beans .getClass()); assertEquals("expected array of SimpleBean of length 6", 6, beans.length); } public void testSetBeanArray() throws Exception { SimpleBean[] beans = new SimpleBean[]{new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean(), new SimpleBean()}; getSimpleProxy().setBeanArray(beans); } public void testGetNestedBean() throws Throwable { NestedBean result = getSimpleProxy().getNestedBean(); assertNotNull("StartDate is not null ", result.getStartDate()); assertEquals("Test String is correct", "some test string " + result.getStartDate(), result.getTestString()); //$NON-NLS-1$ assertEquals("Result Array Correct length ", 3, result.getSimpleBeanList().length); //$NON-NLS-1$ assertEquals("Result Array[0] Correct", 1, result.getSimpleBeanList()[0].getIntValue()); //$NON-NLS-1$ assertEquals("Result Array[1] Correct", 2, result.getSimpleBeanList()[1].getIntValue()); //$NON-NLS-1$ assertEquals("Result Array[2] Correct", 3, result.getSimpleBeanList()[2].getIntValue()); //$NON-NLS-1$ } public void testSetNestedBean() throws Throwable { NestedBean result = new NestedBean(); result.setStartDate(new Date()); result.setTestString("some test string " + result.getStartDate()); //$NON-NLS-1$ SimpleBean[] sba = new SimpleBean[3]; sba[0] = new SimpleBean(); sba[1] = new SimpleBean(); sba[2] = new SimpleBean(); sba[0].setIntValue(1); sba[1].setIntValue(2); sba[2].setIntValue(3); result.setSimpleBeanList(sba); getSimpleProxy().setNestedBean(result); } public void testEchoNestedBean() throws Throwable { NestedBean result = new NestedBean(); result.setStartDate(new Date()); result.setTestString("some test string " + result.getStartDate()); //$NON-NLS-1$ SimpleBean[] sba = new SimpleBean[3]; sba[0] = new SimpleBean(); sba[1] = new SimpleBean(); sba[2] = new SimpleBean(); sba[0].setIntValue(1); sba[1].setIntValue(2); sba[2].setIntValue(3); result.setSimpleBeanList(sba); getSimpleProxy().echoNestedBean(result); } }
6,695
0
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/anytype
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/anytype/org/AnyService.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.wsdl.anytype.org; public class AnyService { public Object run() { return new String("hello"); } }
6,696
0
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/webref/DoubleBack.java
package test.wsdl.webref; /** * Test the wsdl2java option implementationClassName * * @author Mans Tanneryd (mans@tanneryd.com) */ public class DoubleBack { public String echo(String message) { return message+message; } }
6,697
0
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/document
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/document/org/TestService.java
package test.wsdl.document.org; import org.w3c.dom.Document; import org.w3c.dom.Element; public class TestService { public Document getDocument() { return null; } public Element getElement() { return null; } }
6,698
0
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl
Create_ds/axis-axis1-java/integration/src/main/java/test/wsdl/arrays3/Phone.java
package test.wsdl.arrays3; public class Phone implements java.io.Serializable { private int areaCode; private java.lang.String exchange; private java.lang.String number; public Phone() { } /** * Gets the areaCode value for this Phone. * * @return areaCode */ public int getAreaCode() { return areaCode; } /** * Sets the areaCode value for this Phone. * * @param areaCode */ public void setAreaCode(int areaCode) { this.areaCode = areaCode; } /** * Gets the exchange value for this Phone. * * @return exchange */ public java.lang.String getExchange() { return exchange; } /** * Sets the exchange value for this Phone. * * @param exchange */ public void setExchange(java.lang.String exchange) { this.exchange = exchange; } /** * Gets the number value for this Phone. * * @return number */ public java.lang.String getNumber() { return number; } /** * Sets the number value for this Phone. * * @param number */ public void setNumber(java.lang.String number) { this.number = number; } }
6,699