Java Code Examples for org.apache.axis2.description.AxisService#printWSDL2()

The following examples show how to use org.apache.axis2.description.AxisService#printWSDL2() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Wsdl20Processor.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
public void process(final CarbonHttpRequest request,
                    final CarbonHttpResponse response,
                    final ConfigurationContext configurationContext) throws Exception {
    WSDLPrinter wsdlPrinter = new WSDLPrinter() {
        public void printWSDL(AxisService axisService) throws IOException {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            axisService.printWSDL2(baos);
            RequestProcessorUtil.writeDocument(baos,
                                               response.getOutputStream(),
                                               "annotated-wsdl2.xsl",
                                               configurationContext.getContextRoot(),
                                               checkForAnnotation(request));
        }
    };
    String requestURI = request.getRequestURI();
    String contextPath = configurationContext.getServiceContextPath();
    String serviceName = requestURI.substring(requestURI.indexOf(contextPath) + contextPath.length() + 1);
    printWSDL(configurationContext, serviceName, response, wsdlPrinter);
}
 
Example 2
Source File: Util.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
public static DOMSource getSigStream(AxisService axisService, Map paramMap)
        throws TransformerFactoryConfigurationError, TransformerException, AxisFault,
               ParserConfigurationException {
    ByteArrayOutputStream wsdlOutStream = new ByteArrayOutputStream();
    axisService.printWSDL2(wsdlOutStream);
    return getSigStream(axisService, wsdlOutStream, paramMap);
}