01: /*
02: * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
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: package org.wso2.esb.transport.util;
18:
19: import org.apache.axis2.context.ConfigurationContext;
20: import org.apache.axis2.description.AxisService;
21:
22: import javax.servlet.http.HttpServletRequest;
23: import javax.servlet.http.HttpServletResponse;
24: import java.io.ByteArrayOutputStream;
25: import java.io.IOException;
26:
27: /**
28: *
29: */
30:
31: public class Wsdl20Processor extends AbstractWsdlProcessor {
32:
33: public void process(final HttpServletRequest request,
34: final HttpServletResponse response,
35: final ConfigurationContext configurationContext)
36: throws Exception {
37: WSDLPrinter wsdlPrinter = new WSDLPrinter() {
38: public void printWSDL(AxisService axisService)
39: throws IOException {
40: ByteArrayOutputStream baos = new ByteArrayOutputStream();
41: axisService.printWSDL2(baos);
42: RequestProcessorUtil.writeDocument(baos, response
43: .getOutputStream(), "annotated-wsdl2.xsl",
44: request.getContextPath(),
45: checkForAnnotation(request));
46: }
47: };
48: printWSDL(configurationContext, request, response, wsdlPrinter);
49: }
50: }
|