01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: /*
18: * Modified by Nabh Information Systems, Inc. for Stringbeans Web Services
19: * Framework.
20: *
21: * Modifications (c) 2005 Nabh Information Systems, Inc.
22: */
23: package com.nabhinc.ws.soap;
24:
25: import java.io.IOException;
26:
27: import com.nabhinc.ws.core.PropertyInfo;
28: import com.nabhinc.ws.core.WebServiceException;
29: import com.nabhinc.ws.server.Interceptor;
30: import com.nabhinc.ws.server.InterceptorChain;
31: import com.nabhinc.ws.server.RequestInfo;
32: import com.nabhinc.ws.server.ServerObjectConfig;
33:
34: /**
35: * Interceptor that invokes operation/method on a Web service based
36: * on a SOAP call. This interceptor MUST be added as a "before" global
37: * interceptor for proper operation of a Web services server that accepts
38: * SOAP messages.
39: *
40: * @author Padmanabh Dabke
41: * (c) 2005 Nabh Information Systems, Inc.
42: */
43: public class SOAPMethodInvoker implements Interceptor {
44: SOAPRequestProcessor smiProcessor = null;
45:
46: /* (non-Javadoc)
47: * @see com.nabhinc.ws.server.Interceptor#intercept(com.nabhinc.ws.server.RequestInfo, com.nabhinc.ws.server.InterceptorChain)
48: */
49: public void intercept(RequestInfo reqInfo, InterceptorChain chain)
50: throws WebServiceException, IOException {
51: smiProcessor.intercept(reqInfo, chain);
52:
53: }
54:
55: /* (non-Javadoc)
56: * @see com.nabhinc.ws.server.ServerObject#init(com.nabhinc.ws.server.ServerObjectConfig)
57: */
58: public void init(ServerObjectConfig config)
59: throws WebServiceException {
60: smiProcessor = SOAPRequestProcessor.getInstance();
61: if (smiProcessor == null) {
62: throw new WebServiceException(
63: "SOAP request processor must be initialized before SOAPMethodInvoker.");
64: }
65:
66: }
67:
68: /* (non-Javadoc)
69: * @see com.nabhinc.ws.core.BaseObject#setProperties(com.nabhinc.ws.core.PropertyInfo[])
70: */
71: public void setProperties(PropertyInfo[] props)
72: throws WebServiceException {
73: // Empty
74:
75: }
76:
77: /* (non-Javadoc)
78: * @see com.nabhinc.ws.core.BaseObject#destroy()
79: */
80: public void destroy() {
81: // Empty
82:
83: }
84:
85: }
|