How do I refer to a client_deploy.wsdd file that's in WEB-INF?

血红的双手。 提交于 2019-12-24 05:58:56

问题


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

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

That called web service requires authentication.

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.

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")

or

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

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...

Please point out the obvious that I have missed

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: Yep, this worked.


回答1:


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



来源:https://stackoverflow.com/questions/5177803/how-do-i-refer-to-a-client-deploy-wsdd-file-thats-in-web-inf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!