You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2002/03/06 21:39:40 UTC
cvs commit: xml-axis/java/test/wsdl/nested Nested.wsdl Nested2BindingImpl.java Nested2ServiceTestCase.java
dims 02/03/06 12:39:40
Modified: java/test/wsdl Wsdl2javaTestSuite.xml
Added: java/test/wsdl/nested Nested.wsdl Nested2BindingImpl.java
Nested2ServiceTestCase.java
Log:
Added a test case for Nested complex return values.
Revision Changes Path
1.85 +9 -0 xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml
Index: Wsdl2javaTestSuite.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- Wsdl2javaTestSuite.xml 5 Mar 2002 14:52:53 -0000 1.84
+++ Wsdl2javaTestSuite.xml 6 Mar 2002 20:39:40 -0000 1.85
@@ -288,6 +288,15 @@
<mapping namespace="urn:MArrayTests" package="test.wsdl.marrays"/>
</wsdl2java>
+ <!-- Nested Structure Test -->
+ <wsdl2java url="test/wsdl/nested/Nested.wsdl"
+ output="build/work"
+ deployscope="session"
+ serverSide="yes"
+ testcase="yes">
+ <mapping namespace="urn:Nested" package="test.wsdl.nested"/>
+ </wsdl2java>
+
<!-- Import Test 1: some namespace->package mappings from the -->
<!-- command line, some generated, some from -->
<!-- NStoPkg.properties. -->
1.1 xml-axis/java/test/wsdl/nested/Nested.wsdl
Index: Nested.wsdl
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Nested2" targetNamespace="urn:Nested"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:tns="urn:Nested">
<wsdl:message name="NestedSvc2Input">
<wsdl:part name="CUSTOMERNO" element="tns:CUSTOMERNO"/>
<wsdl:part name="PI_DISTR_CHAN" element="tns:PI_DISTR_CHAN"/>
<wsdl:part name="PI_DIVISION" element="tns:PI_DIVISION"/>
<wsdl:part name="PI_PASS_BUFFER" element="tns:PI_PASS_BUFFER"/>
<wsdl:part name="PI_SALESORG" element="tns:PI_SALESORG"/>
</wsdl:message>
<wsdl:message name="NestedSvc2Output">
<wsdl:part name="composite" type="tns:Out"/>
</wsdl:message>
<wsdl:portType name="Nested2PortType">
<wsdl:operation name="NestedSvc2">
<wsdl:input name="NestedSvc2Input" message="tns:NestedSvc2Input"/>
<wsdl:output name="NestedSvc2Output" message="tns:NestedSvc2Output"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Nested2Binding" type="tns:Nested2PortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<wsdl:operation name="NestedSvc2">
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="Nested2" use="encoded"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="Nested2" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Nested2Service">
<wsdl:port name="Nested" binding="tns:Nested2Binding">
<soap:address location="http://localhost:8080/axis/services/Nested"/>
</wsdl:port>
</wsdl:service>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Nested">
<xsd:complexType name="In">
<xsd:sequence>
<xsd:element ref="CUSTOMERNO" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="PI_DISTR_CHAN" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="PI_DIVISION" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="PI_PASS_BUFFER" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="PI_SALESORG" minOccurs="1" maxOccurs="1"/>
<xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="CUSTOMERNO" type="xsd:string"/>
<xsd:element name="PI_DISTR_CHAN" type="xsd:string"/>
<xsd:element name="PI_DIVISION" type="xsd:string"/>
<xsd:element name="PI_PASS_BUFFER" type="xsd:string"/>
<xsd:element name="PI_SALESORG" type="xsd:string"/>
<xsd:complexType name="Out">
<xsd:sequence>
<xsd:element ref="PE_ADDRESS" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="RETURN" minOccurs="1" maxOccurs="1"/>
<xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="PE_ADDRESS">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="FORM_OF_AD" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="FIRST_NAME" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="NAME" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="NAME_3" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="NAME_4" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="DATE_BIRTH" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="STREET" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="POSTL_CODE" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="CITY" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="REGION" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COUNTRY" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COUNTRNISO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COUNTRAISO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="INTERNET" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="FAX_NUMBER" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="TELEPHONE" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="TELEPHONE2" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="LANGU" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="LANGU_ISO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="CURRENCY" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="CURRENCY_ISO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="COUNTRYISO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="ONLY_CHANGE_COMADDRESS" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="RETURN">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="TYPE" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="CODE" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="MESSAGE" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="LOG_NO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="LOG_MSG_NO" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="MESSAGE_V1" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="MESSAGE_V2" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="MESSAGE_V3" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="MESSAGE_V4" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
1.1 xml-axis/java/test/wsdl/nested/Nested2BindingImpl.java
Index: Nested2BindingImpl.java
===================================================================
/**
* Nested2BindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.nested;
public class Nested2BindingImpl implements test.wsdl.nested.Nested2PortType {
public test.wsdl.nested.Out nestedSvc2(java.lang.String cUSTOMERNO, java.lang.String pIDISTRCHAN, java.lang.String pIDIVISION, java.lang.String pIPASSBUFFER, java.lang.String pISALESORG) throws java.rmi.RemoteException {
test.wsdl.nested.PEADDRESS address = new test.wsdl.nested.PEADDRESS();
address.setFORMOFAD("Company");
address.setFIRSTNAME("");
address.setNAME("Becker Berlin");
address.setNAME3("");
address.setNAME4("");
address.setDATEBIRTH("0000-00-00");
address.setSTREET("Calvinstr. 36");
address.setPOSTLCODE("13467");
address.setCITY("Berlin");
address.setREGION("");
address.setCOUNTRY("");
address.setCOUNTRNISO("");
address.setCOUNTRAISO("");
address.setINTERNET("");
address.setFAXNUMBER("030-8853-999");
address.setTELEPHONE("030-8853-0");
address.setTELEPHONE2("");
address.setLANGU("D");
address.setLANGUISO("DE");
address.setCURRENCY("");
address.setCURRENCYISO("");
address.setCOUNTRYISO("DE");
address.setONLYCHANGECOMADDRESS("X");
test.wsdl.nested.RETURN ret = new test.wsdl.nested.RETURN();
ret.setTYPE("");
ret.setCODE("");
ret.setMESSAGE("");
ret.setLOGNO("");
ret.setLOGMSGNO("123456");
ret.setMESSAGEV1("");
ret.setMESSAGEV2("");
ret.setMESSAGEV3("");
ret.setMESSAGEV4("");
test.wsdl.nested.Out out = new test.wsdl.nested.Out();
out.setPEADDRESS(address);
out.setRETURN(ret);
return out;
}
}
1.1 xml-axis/java/test/wsdl/nested/Nested2ServiceTestCase.java
Index: Nested2ServiceTestCase.java
===================================================================
/**
* Nested2ServiceTestCase.java
*
* This file was auto-generated from WSDL
* by the Apache Axis Wsdl2java emitter.
*/
package test.wsdl.nested;
public class Nested2ServiceTestCase extends junit.framework.TestCase {
public Nested2ServiceTestCase(String name) {
super(name);
}
public void test1NestedNestedSvc2() {
test.wsdl.nested.Nested2PortType binding;
try {
binding = new test.wsdl.nested.Nested2ServiceLocator().getNested();
}
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.nested.Out value = null;
value = 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"));
test.wsdl.nested.PEADDRESS address = value.getPEADDRESS();
test.wsdl.nested.RETURN ret = value.getRETURN();
System.out.println("NAME:" + address.getNAME());
assertTrue("NAME is wrong", address.getNAME().equals("Becker Berlin"));
System.out.println("LOGMSGNO:" + ret.getLOGMSGNO());
assertTrue("LOGMSGNO is wrong", ret.getLOGMSGNO().equals("123456"));
}
catch (java.rmi.RemoteException re) {
throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
}
}
public static void main(String[] args){
Nested2ServiceTestCase testcase = new Nested2ServiceTestCase("Nested2ServiceTestCase");
testcase.test1NestedNestedSvc2();
}
}