001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.header_test;
019:
020: import javax.jws.WebService;
021: import javax.xml.ws.Holder;
022:
023: import org.apache.header_test.types.TestHeader1;
024: import org.apache.header_test.types.TestHeader1Response;
025: import org.apache.header_test.types.TestHeader2;
026: import org.apache.header_test.types.TestHeader2Response;
027: import org.apache.header_test.types.TestHeader3;
028: import org.apache.header_test.types.TestHeader3Response;
029: import org.apache.header_test.types.TestHeader5;
030: import org.apache.header_test.types.TestHeader5ResponseBody;
031: import org.apache.header_test.types.TestHeader6;
032: import org.apache.header_test.types.TestHeader6Response;
033: import org.apache.tests.type_test.all.SimpleAll;
034: import org.apache.tests.type_test.choice.SimpleChoice;
035: import org.apache.tests.type_test.sequence.SimpleStruct;
036:
037: @WebService(serviceName="SOAPHeaderService",portName="SoapHeaderPort",endpointInterface="org.apache.header_test.TestHeader",targetNamespace="http://apache.org/header_test",wsdlLocation="testutils/soapheader.wsdl")
038: public class TestHeaderImpl implements TestHeader {
039:
040: public TestHeader1Response testHeader1(TestHeader1 in,
041: TestHeader1 inHeader) {
042: if (in == null || inHeader == null) {
043: throw new IllegalArgumentException(
044: "TestHeader1 part not found.");
045: }
046: TestHeader1Response returnVal = new TestHeader1Response();
047:
048: returnVal.setResponseType(inHeader.getClass().getSimpleName());
049: return returnVal;
050: }
051:
052: /**
053: *
054: * @param out
055: * @param outHeader
056: * @param in
057: */
058: public void testHeader2(TestHeader2 in,
059: Holder<TestHeader2Response> out,
060: Holder<TestHeader2Response> outHeader) {
061: TestHeader2Response outVal = new TestHeader2Response();
062: outVal.setResponseType(in.getRequestType());
063: out.value = outVal;
064:
065: TestHeader2Response outHeaderVal = new TestHeader2Response();
066: outHeaderVal.setResponseType(in.getRequestType());
067: outHeader.value = outHeaderVal;
068: }
069:
070: public TestHeader3Response testHeader3(TestHeader3 in,
071: Holder<TestHeader3> inoutHeader) {
072:
073: if (inoutHeader.value == null) {
074: throw new IllegalArgumentException(
075: "TestHeader3 part not found.");
076: }
077: TestHeader3Response returnVal = new TestHeader3Response();
078: returnVal.setResponseType(inoutHeader.value.getRequestType());
079:
080: inoutHeader.value.setRequestType(in.getRequestType());
081: return returnVal;
082: }
083:
084: /**
085: *
086: * @param requestType
087: */
088: public void testHeader4(String requestType) {
089:
090: }
091:
092: public void testHeader5(Holder<TestHeader5ResponseBody> out,
093: Holder<TestHeader5> outHeader,
094: org.apache.header_test.types.TestHeader5 in) {
095: TestHeader5ResponseBody outVal = new TestHeader5ResponseBody();
096: outVal.setResponseType(1000);
097: out.value = outVal;
098:
099: TestHeader5 outHeaderVal = new TestHeader5();
100: outHeaderVal.setRequestType(in.getRequestType());
101: outHeader.value = outHeaderVal;
102:
103: }
104:
105: public TestHeader6Response testHeaderPartBeforeBodyPart(
106: Holder<TestHeader3> inoutHeader, TestHeader6 in) {
107:
108: if (inoutHeader.value == null) {
109: throw new IllegalArgumentException(
110: "TestHeader3 part not found.");
111: }
112: TestHeader6Response returnVal = new TestHeader6Response();
113: returnVal.setResponseType(inoutHeader.value.getRequestType());
114:
115: inoutHeader.value.setRequestType(in.getRequestType());
116: return returnVal;
117: }
118:
119: public SimpleStruct sendReceiveAnyType(Holder<SimpleAll> x,
120: SimpleChoice y) {
121: SimpleAll sa = new SimpleAll();
122: sa.setVarString(y.getVarString());
123:
124: SimpleStruct ss = new SimpleStruct();
125: ss.setVarAttrString(x.value.getVarAttrString() + "Ret");
126: ss.setVarInt(x.value.getVarInt() + 100);
127: x.value = sa;
128: return ss;
129: }
130:
131: }
|