简体   繁体   English

JAX-WS如何在weblogic中隐藏WSDL?

[英]JAX-WS How to hide WSDL in weblogic?

I create a JAX-WS webservice and deployed it on weblogic 10.3.3. 我创建了一个JAX-WS Web服务并将其部署在weblogic 10.3.3上。 It is deployed succesfully and everything is working fine. 它成功部署,一切正常。

Now, we want to access webservice by hiding the WSDL. 现在,我们希望通过隐藏WSDL来访问webservice。 I try to hide the WSDL from weblogic admin console. 我尝试从weblogic管理控制台隐藏WSDL。 Goto this location 转到这个位置

Deployed application -> Webservice -> Configuration tab

In this tab, by putting "false" in the parameter "WSDL Publish File". 在此选项卡中,将“false”放在参数“WSDL Publish File”中。

Saving this created a Plan.xml. 保存这个创建了一个Plan.xml。 The issue arises when I try to activate the changes in Weblogic. 当我尝试激活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'. 在部署WebService模块“TB_DBLEGI_SIMULATOR-trunk.war”的准备阶段遇到错误。 Error encountered while deploying WebService module 'TB_DBLEGI_SIMULATOR-trunk.war'. 部署WebService模块“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 java.io.IOException:Wsdl文件应放在META-INF / wsdl或WEB-INF / wsdl

Wsdl file should be placed at META-INF/wsdl, or WEB-INF/wsdl Wsdl文件应放在META-INF / wsdl或WEB-INF / wsdl中

In my war, the WSDL is placed inside the WEB-INF/wsdl folder. 在我的战争中,WSDL放在WEB-INF / wsdl文件夹中。 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. 您始终可以编写并注册Filter以阻止对给定资源的访问。 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 : 并在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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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