01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.systest.schema_validation;
19:
20: import java.io.Serializable;
21: import java.util.List;
22:
23: import javax.jws.WebService;
24:
25: import org.apache.schema_validation.SchemaValidation;
26: import org.apache.schema_validation.types.ComplexStruct;
27: import org.apache.schema_validation.types.OccuringStruct;
28:
29: @WebService(serviceName="SchemaValidationService",portName="SoapPort",endpointInterface="org.apache.schema_validation.SchemaValidation",targetNamespace="http://apache.org/schema_validation")
30: public class SchemaValidationImpl implements SchemaValidation {
31:
32: public boolean setComplexStruct(ComplexStruct in) {
33: return true;
34: }
35:
36: public boolean setOccuringStruct(OccuringStruct in) {
37: return true;
38: }
39:
40: public ComplexStruct getComplexStruct(String in) {
41: ComplexStruct complexStruct = new ComplexStruct();
42: complexStruct.setElem1(in + "-one");
43: // Don't initialize a member of the structure. Validation should throw
44: // an exception.
45: // complexStruct.setElem2(in + "-two");
46: complexStruct.setElem3(in.length());
47: return complexStruct;
48: }
49:
50: public OccuringStruct getOccuringStruct(String in) {
51: OccuringStruct occuringStruct = new OccuringStruct();
52: // Populate the list in the wrong order. Validation should throw
53: // an exception.
54: List<Serializable> floatIntStringList = occuringStruct
55: .getVarFloatAndVarIntAndVarString();
56: floatIntStringList.add(in + "-two");
57: floatIntStringList.add(new Integer(2));
58: floatIntStringList.add(new Float(2.5f));
59: return occuringStruct;
60: }
61:
62: }
|