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.jaxws.support;
19:
20: import java.lang.reflect.Method;
21:
22: import javax.activation.DataSource;
23: import javax.xml.namespace.QName;
24: import javax.xml.soap.SOAPMessage;
25: import javax.xml.transform.Source;
26:
27: import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
28:
29: public class WebServiceProviderConfiguration extends
30: JaxWsServiceConfiguration {
31:
32: private JaxWsImplementorInfo implInfo;
33:
34: @Override
35: public Boolean isOperation(Method method) {
36: return method.getName().equals("invoke")
37: && method.getParameterTypes().length == 1
38: && (Source.class.isAssignableFrom(method
39: .getParameterTypes()[0])
40: || SOAPMessage.class.isAssignableFrom(method
41: .getParameterTypes()[0]) || DataSource.class
42: .isAssignableFrom(method.getParameterTypes()[0]));
43: }
44:
45: @Override
46: public void setServiceFactory(
47: ReflectionServiceFactoryBean serviceFactory) {
48: super .setServiceFactory(serviceFactory);
49: implInfo = ((JaxWsServiceFactoryBean) serviceFactory)
50: .getJaxWsImplementorInfo();
51: }
52:
53: @Override
54: public String getServiceName() {
55: QName service = implInfo.getServiceName();
56: if (service == null) {
57: return null;
58: } else {
59: return service.getLocalPart();
60: }
61: }
62:
63: @Override
64: public String getServiceNamespace() {
65: QName service = implInfo.getServiceName();
66: if (service == null) {
67: return null;
68: } else {
69: return service.getNamespaceURI();
70: }
71: }
72:
73: @Override
74: public QName getEndpointName() {
75: return implInfo.getEndpointName();
76: }
77:
78: @Override
79: public String getWsdlURL() {
80: String wsdlLocation = implInfo.getWsdlLocation();
81: if (wsdlLocation != null && wsdlLocation.length() > 0) {
82: return wsdlLocation;
83: }
84: return null;
85: }
86:
87: @Override
88: public Boolean isWrapped(Method m) {
89: return true;
90: }
91: }
|