File: CPWSImplServiceTestCase.java

package info (click to toggle)
axis 1.4-29
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52,100 kB
  • sloc: java: 129,124; xml: 10,602; jsp: 983; sh: 84; cs: 36; makefile: 18
file content (43 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * 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 javax.xml.namespace.QName;
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 {
        String url = 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());
    }
}