KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > schema_validation > SchemaValidationImpl


1 package org.objectweb.celtix.systest.schema_validation;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.List JavaDoc;
5
6 import javax.jws.WebService;
7
8 import org.objectweb.schema_validation.SchemaValidation;
9 import org.objectweb.schema_validation.types.ComplexStruct;
10 import org.objectweb.schema_validation.types.OccuringStruct;
11
12 @WebService(serviceName = "SchemaValidationService",
13             portName = "SoapPort",
14             endpointInterface = "org.objectweb.schema_validation.SchemaValidation",
15             targetNamespace = "http://objectweb.org/schema_validation")
16 public class SchemaValidationImpl implements SchemaValidation {
17
18     public boolean setComplexStruct(ComplexStruct in) {
19         return true;
20     }
21
22     public boolean setOccuringStruct(OccuringStruct in) {
23         return true;
24     }
25     
26     public ComplexStruct getComplexStruct(String JavaDoc in) {
27         ComplexStruct complexStruct = new ComplexStruct();
28         complexStruct.setElem1(in + "-one");
29         // Don't initialize a member of the structure. Validation should throw
30
// an exception.
31
// complexStruct.setElem2(in + "-two");
32
complexStruct.setElem3(in.length());
33         return complexStruct;
34     }
35
36     public OccuringStruct getOccuringStruct(String JavaDoc in) {
37         OccuringStruct occuringStruct = new OccuringStruct();
38         // Populate the list in the wrong order. Validation should throw
39
// an exception.
40
List JavaDoc<Serializable JavaDoc> floatIntStringList = occuringStruct.getVarFloatAndVarIntAndVarString();
41         floatIntStringList.add(in + "-two");
42         floatIntStringList.add(new Integer JavaDoc(2));
43         floatIntStringList.add(new Float JavaDoc(2.5f));
44         return occuringStruct;
45     }
46
47 }
48
Popular Tags