如何引用WEB-INF中的client_deploy.wsdd文件? [英] How do I refer to a client_deploy.wsdd file that's in WEB-INF?

查看:72
本文介绍了如何引用WEB-INF中的client_deploy.wsdd文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个基本问题,但我似乎找不到答案.

A basic question, but I can't seem to find the answer.

我有一个由Axis生成的Web服务,该服务也调用了另一个Web服务(其存根也是由Axis生成的).它已部署在weblogic 9.2中

I have an Axis-generated web service that also calls another web service (for which the stubs are also generated with Axis). It's deployed in weblogic 9.2

所谓的Web服务需要身份验证.

That called web service requires authentication.

我已经搜索了设置身份验证的代码.它要求我设置一个已经完成的client_deploy.wsdd文件,并将其添加到WEB-INF.

I've googled for the code to set up authentication. It requires that I set up a client_deploy.wsdd file which I've done, and added it to WEB-INF.

我需要将此文件指定给Axis.似乎有几种方法可以做到这一点,包括

I need to specify this flle to Axis. There seem to be several ways of doing this, including

 System.setProperty("axis.ClientConfigFile", "client_deploy.wsdd")

 EngineConfiguration config = new FileProvider("client_deploy.wsdd");

但是这些对我不起作用.问题是client_deploy.wsdd文件的路径吗?如何引用位于WEB-INF目录顶层的文件? Googling告诉我如何将其作为流访问,但我不希望这样做,我需要将文件名传递给这些函数...

but these aren't working for me. Is the issue the path for the client_deploy.wsdd file? How do I refer to a file that's at the top level of the WEB-INF directory? Googling tells me how to access it as a stream, but I don't want that, I need to pass a file name to these functions...

请指出我显然错过了

更新:谷歌搜索可能可行

Update: Googling suggests this might work

HttpServlet servlet = (HttpServlet) MessageContext.
   getCurrentContext().
   getProperty(HTTPConstants.MC_HTTP_SERVLET);
EngineConfiguration config = new FileProvider(servlet.
   getServletContext().
   getResourceAsStream("/WEB-INF/client_deploy.wsdd"));

Update2:是的,这可行.

Update2: Yep, this worked.

推荐答案

只需将您的自定义.WSDD文件打包到jar中,它就可以正常工作.我只是试过了:)

Just package your custom .WSDD file into a jar and it should work fine. I just tried it :)

这篇关于如何引用WEB-INF中的client_deploy.wsdd文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆