AxisServiceExecutor extends AxisWebServiceRequestDispatcher implements OutTransportInfo { public void setContentType( String contentType ) { IContentItem contentItem = outputHandler.getOutputContentItem( "response", "content", instanceId, getMimeType() ); contentItem.setMimeType( contentType ); }  @Override void createServiceContent( AxisService axisService, String operationName, AxisConfiguration axisConfiguration,
      ConfigurationContext context, OutputStream out ); @Override String getMimeType(); @Override Log getLogger(); void setContentType( String contentType );  }
@Test public void testRunPost() throws Exception { Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>(); SimpleParameterProvider pathParams = new SimpleParameterProvider(); pathParams.setParameter( "path", "/StubService" ); pathParams.setParameter( "remoteaddr", "http:test" ); parameterProviders.put( "path", pathParams ); contentGenerator.setParameterProviders( parameterProviders ); MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); request.setMethod( "POST" ); request.setRequestURI( "/pentaho/content/ws-run/StubService" ); request.setRequestURL( "http: request.setRemoteAddr( REMOTE_ADDRESS ); request.setContentType( "application/soap+xml; charset=UTF-8; action=\"urn:getString\"" ); String xml = "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=\"http: + ".org/2003/05/soap-envelope\"><soapenv:Body><ns2:getString xmlns:ns2=\"http: + ".com\"></ns2:getString></soapenv:Body></soapenv:Envelope>"; request.setBodyContent( xml ); pathParams.setParameter( "httprequest", request ); pathParams.setParameter( "httpresponse", response ); try { StubTransportSender.transportOutStr = null; StubService.getStringCalled = false; contentGenerator.createContent(); assertTrue( StubService.getStringCalled ); String content = StubTransportSender.transportOutStr; assertEquals( "result are wrong", "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=\"http: + ".org/2003/05/soap-envelope\"><soapenv:Body><ns:getStringResponse xmlns:ns=\"" + "http: + "result</return></ns:getStringResponse></soapenv:Body></soapenv:Envelope>", content ); } catch ( Exception e ) { assertTrue( "Exception occurred", false ); } }
@Test public void testRunPut() throws Exception { Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>(); SimpleParameterProvider pathParams = new SimpleParameterProvider(); pathParams.setParameter( "path", "/StubService" ); pathParams.setParameter( "remoteaddr", "http:test" ); parameterProviders.put( "path", pathParams ); contentGenerator.setParameterProviders( parameterProviders ); MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); request.setMethod( "PUT" ); request.setRequestURI( "/pentaho/content/ws-run/StubService" ); request.setRequestURL( "http: request.setRemoteAddr( REMOTE_ADDRESS ); request.setContentType( "application/soap+xml; charset=UTF-8; action=\"urn:getString\"" ); String xml = "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=\"http: + ".org/2003/05/soap-envelope\"><soapenv:Body><ns2:getString xmlns:ns2=\"http: + ".com\"></ns2:getString></soapenv:Body></soapenv:Envelope>"; request.setBodyContent( xml ); pathParams.setParameter( "httprequest", request ); pathParams.setParameter( "httpresponse", response ); try { StubTransportSender.transportOutStr = null; StubService.getStringCalled = false; contentGenerator.createContent(); assertTrue( StubService.getStringCalled ); String content = StubTransportSender.transportOutStr; assertEquals( "result are wrong", "<ns:getStringResponse xmlns:ns=\"http: + " result</return></ns:getStringResponse>", content ); } catch ( Exception e ) { assertTrue( "Exception occurred", false ); } }