Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36B9FC675 for ; Tue, 1 May 2012 15:00:12 +0000 (UTC) Received: (qmail 84893 invoked by uid 500); 1 May 2012 15:00:11 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 84707 invoked by uid 500); 1 May 2012 15:00:11 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 84573 invoked by uid 99); 1 May 2012 15:00:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 15:00:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 May 2012 15:00:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7BA90429E69 for ; Tue, 1 May 2012 14:59:49 +0000 (UTC) Date: Tue, 1 May 2012 14:59:49 +0000 (UTC) From: "Kishanthan Thangarajah (JIRA)" To: java-dev@axis.apache.org Message-ID: <1011436051.13374.1335884389508.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (AXIS2-3278) Allow Customizable WSDL generation error messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kishanthan Thangarajah updated AXIS2-3278: ------------------------------------------ Attachment: AXIS2-3278.patch This patch includes the proposed improvement. If the useOriginalWsdl is set to true and if the wsdl file is not found, then 404 status will be returned. > Allow Customizable WSDL generation error messages > ------------------------------------------------- > > Key: AXIS2-3278 > URL: https://issues.apache.org/jira/browse/AXIS2-3278 > Project: Axis2 > Issue Type: New Feature > Components: wsdl > Affects Versions: 1.3 > Environment: Axis2 (1.3) > Reporter: Nathan Hook > Assignee: Deepal Jayasinghe > Priority: Minor > Attachments: AXIS2-3278.patch > > > When setting the value useOriginalwsdl to true in a services.xml and not providing a wsdl file in your directory the following message occurs: > Unable to generate WSDL 1.1 for this serviceIf you wish Axis2 to automatically generate the WSDL 1.1, then please +set useOriginalwsdl as false in your services.xml > However, it would be better if a customizable error message (including a blank message) could be returned or even better allow the behavior to return different http error codes like 404 where the wsdl is effectively hidden without giving a clue that it exists. > A work around for this is to create a filter that will check to see if someone is try to access the wsdl file directly and then return a 404 or what ever type of message they chose. > Here is an example filter class: > import java.io.*; > import java.util.*; > import javax.servlet.*; > import javax.servlet.http.*; > public class WebServiceSecurityFilter implements Filter > { > private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(WebServiceSecurityFilter.class); > > public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException > { > HttpServletRequest httpRequest = (HttpServletRequest)request; > > if(!httpRequest.getQueryString().contains("wsdl")) > { > filterChain.doFilter(request, response); > } > else > { > log.debug("WebServiceSecurityFilter - Unauthorized WSDL Access Attempt"); > log.debug(" remote ip: " + address); > > HttpServletResponse httpResponse = (HttpServletResponse)response; > httpResponse.setStatus(HttpServletResponse.SC_NOT_FOUND); > > RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/error_pages/404.html"); > dispatcher.forward(request, response); > } > } > > public void init(FilterConfig config) > { > > } > > public void destroy() > { > > } > } > Thank you for your time. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org