简体   繁体   中英

JAX-WS How to hide WSDL in weblogic?

I create a JAX-WS webservice and deployed it on weblogic 10.3.3. It is deployed succesfully and everything is working fine.

Now, we want to access webservice by hiding the WSDL. I try to hide the WSDL from weblogic admin console. Goto this location

Deployed application -> Webservice -> Configuration tab

In this tab, by putting "false" in the parameter "WSDL Publish File".

Saving this created a Plan.xml. The issue arises when I try to activate the changes in Weblogic. Following is the exception that I got:

An error occurred during activation of changes, please see the log for details.

Error encountered during prepare phase of deploying WebService module 'TB_DBLEGI_SIMULATOR-trunk.war'. Error encountered while deploying WebService module 'TB_DBLEGI_SIMULATOR-trunk.war'. Failed to publish wsdl java.io.IOException: Wsdl file should be placed at META-INF/wsdl, or WEB-INF/wsdl

Wsdl file should be placed at META-INF/wsdl, or WEB-INF/wsdl

In my war, the WSDL is placed inside the WEB-INF/wsdl folder. Also, I tried to place it at different places but I had no luck.

You can always write and register a Filter to block access to a given resource. For example:

public class BlockFilter implements Filter {

    @Override
    public void init(FilterConfig config) throws ServletException {}

    @Override
    public void destroy() {}

    public void doFilter(ServletRequest request, ServletResponse response,
                        FilterChain chain) throws IOException, ServletException {
        return;
    }
}

And register the filter in the web.xml :

<filter>
    <filter-name>blockFilter</filter-name>
    <filter-class>namespace.BlockFilter</filter-class>    
</filter>

<filter-mapping>
    <filter-name>blockFilter</filter-name>
    <url-pattern>*?wsdl</url-pattern>
</filter-mapping>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM