开发者

Defining Paths / URL within JaxWS web service,

开发者 https://www.devze.com 2023-03-12 23:26 出处:网络
I want to wrap an executable (Fortran application) as a web service. In order to execute my application I have to generate a bunch of files from the user\'s input including paths to specific resources

I want to wrap an executable (Fortran application) as a web service. In order to execute my application I have to generate a bunch of files from the user's input including paths to specific resources (The user may upload resources to be used before starting the service). When done I generate a result file which should be downloadable so I want to return a URL. The paths to the resources should not be accessible but the URL (of course) should en开发者_高级运维able downloading. How do I get these paths? Is servlet context the correct approach? My service isn't a servlet and therefore has no context, has it?

Thanks in advance!


I was able to solve this problem with the help of WSContext and the ServletContext which gives me the path to Context root. Everything that is not supposed to be accessed from outside will be placed under WEB-INF, all accessible sources will be placed under COntext root and subfolders. (I am working on the last bit) Very important: I injected WSContext via @Resource and you have to access the WSContext AFTER the constructor is done. I tried to use the context within the constructor and that gave me a hard time because it was always null then.

0

精彩评论

暂无评论...
验证码 换一张
取 消