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.headers;
19:
20: import javax.jws.WebService;
21: import javax.xml.ws.Holder;
22:
23: import org.apache.headers.types.InHeader;
24: import org.apache.headers.types.InHeaderResponse;
25: import org.apache.headers.types.InoutHeader;
26: import org.apache.headers.types.InoutHeaderResponse;
27: import org.apache.headers.types.OutHeader;
28: import org.apache.headers.types.OutHeaderResponse;
29: import org.apache.headers.types.SOAPHeaderData;
30:
31: @WebService(serviceName="XMLHeaderService",portName="XMLPort9000",endpointInterface="org.apache.headers.HeaderTester",targetNamespace="http://apache.org/headers",wsdlLocation="testutils/soapheader2.wsdl")
32: public class HeaderTesterImpl implements HeaderTester {
33:
34: public InHeaderResponse inHeader(InHeader me,
35: SOAPHeaderData headerInfo) {
36: // TODO Auto-generated method stub
37: InHeaderResponse resp = new InHeaderResponse();
38: resp.setResponseType("requestType=" + me.getRequestType()
39: + "\nheaderData.message=" + headerInfo.getMessage()
40: + "\nheaderData.getOriginator="
41: + headerInfo.getOriginator());
42: return resp;
43: }
44:
45: public InoutHeaderResponse inoutHeader(InoutHeader me,
46: Holder<SOAPHeaderData> headerInfo) {
47: // TODO Auto-generated method stub
48: InoutHeaderResponse resp = new InoutHeaderResponse();
49: resp.setResponseType("requestType=" + me.getRequestType());
50: if (headerInfo.value != null) {
51: headerInfo.value.setMessage("message="
52: + headerInfo.value.getMessage());
53: headerInfo.value.setOriginator("orginator="
54: + headerInfo.value.getOriginator());
55: }
56: return resp;
57: }
58:
59: public void outHeader(OutHeader me,
60: Holder<OutHeaderResponse> theResponse,
61: Holder<SOAPHeaderData> headerInfo) {
62: theResponse.value = new OutHeaderResponse();
63: theResponse.value.setResponseType("requestType="
64: + me.getRequestType());
65:
66: headerInfo.value = new SOAPHeaderData();
67: headerInfo.value.setMessage("message=outMessage");
68: headerInfo.value.setOriginator("orginator=outOriginator");
69: }
70:
71: }
|