我在Tomcat 6下部署了一个web服务,它运行得很好.现在我想验证任何客户端,但是通过http:// localhost:8080/services/MyService这样的URL保持wsdl公共访问 ?wsdl
我试图以这种方式解决问题(webapp的web.xml),但它不起作用:
<security-constraint>
<web-resource-collection>
<web-resource-name>WSDL access - to anybody</web-resource-name>
<url-pattern>/services/MyService?wsdl</url-pattern>
</web-resource-collection>
<auth-constraint><role-name>*</role-name></auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Some authentification required</web-resource-name>
<url-pattern>/services/MyService</url-pattern>
</web-resource-collection>
<auth-constraint><role-name>somebody</role-name></auth-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)
我现在看到的唯一解决方案是创建额外的servlet并赋予访问WSDL的一个权限.servlet会将所需的wsdl传递给客户端,无论它是否经过身份验证.在这种情况下,WSDL URL不是obvius,所以我不喜欢这个解决方案.还有其他任何建议吗?
我是Maven和Axis2的新手.我的项目包括三个模块:客户端,接口和服务器.服务是基于POJO的.WSDL正在服务器模块上构建.接口模块包含服务接口和bean等常见内容.
我应该将WSDL生成(或手动复制)到接口模块中吗?我应该在客户端模块生成客户端代码吗?模块结构好吗?我想做的就是使构建过程自动化但严格结构化.
是否可以使用MVEL定义一些自定义预编译函数并在另一个编译表达式中使用一个?如果我尝试以下方法:
MVEL.compileExpression("function hello() { System.out.println(\"Hello!\"); hello(); return x * y;");
Run Code Online (Sandbox Code Playgroud)
Exception in thread "main" [Error: duplicate function: hello]当我第二次尝试施行它时,我得到了.
看起来我应该声明函数不在表达式本身,而是某种上下文.我和ParsedContext玩了一段时间,但总是得到Exception in thread "main" [Error: unable to access property (null parent): hello].
Internet上充满了涵盖不同MVEL语言使用主题的教程,但这些嵌入主题的文档记录很少.你能告诉我一些我做错了吗?
PS我不想从Java执行某些功能.我需要用MVEL动态定义它们.
java ×2
android ×1
axis2 ×1
embedding ×1
evaluation ×1
function ×1
maven ×1
mvel ×1
obfuscation ×1
security ×1
tomcat ×1
web-services ×1
wsdl ×1