我正在使用 Eclipse Juno 和 WildFly 8.2,并尝试使用 ws-security 部署肥皂 Web 服务。这是我的参考网站。
https://docs.jboss.org/author/display/JBWS/WS-Security#WS-Security-Authenticationandauthorization https://docs.jboss.org/author/display/JBWS/WS-Security#WS-Security-Authenticationandauthorization
部署没问题!但问题似乎是Eclipse的客户端。我用eclipse ide做了一些jsp代码
<%@ page import="javax.xml.ws.BindingProvider"%>
<%@ page import="javax.xml.namespace.QName"%>
<%@ page import="java.net.URL"%>
<%@ page import="javax.xml.ws.Service"%>
<%@ page import="org.apache.cxf.ws.security.SecurityConstants"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>WildFly SOAP Security test</title>
</head>
<body>
<%
String SERVICE_URL = "http://localhost:8080/SOAPSecureWeb/HelloWorld";
try {
QName serviceName = new QName("http://soap.aaa.com/", "HelloWorldService");
URL wsdlURL;
wsdlURL = new URL(SERVICE_URL + "?wsdl");
Service service = Service.create(wsdlURL, serviceName);
IHelloWorld port = (IHelloWorld) service.getPort(IHelloWorld.class);
上面的代码抛出简单的异常,
生成的 java 文件中第 12 行发生错误:只能导入类型。 org.apache.cxf.ws.security.SecurityConstants 解析为一个包
所以我将cxf-rt-ws-security-2.7.13.jar复制到/WEBContent/WEB-INF/lib,然后它抛出这个异常,部署甚至失败。
导致:org.jboss.as.server.deployment.DeploymentUnitProcessingException:JBAS015599:在 ws 端点部署中检测到 Apache CXF 库(cxf-rt-ws-security-2.7.13.jar);要么提供一个正确的部署,用容器模块依赖项替换嵌入式库,要么为当前部署禁用 Web 服务子系统,并向其添加正确的 jboss-deployment-struct.xml 描述符。建议使用前一种方法,因为后一种方法会导致大多数 Web 服务 Java EE 和任何 JBossWS 特定功能被禁用。
我做了谷歌搜索和一些类似的问题。
无法处理部署的阶段 PARSE https://stackoverflow.com/questions/27380360/failed-to-process-phase-parse-of-deployment
Wildfly 上基于 WSDL 的 Web 服务 https://stackoverflow.com/questions/26162595/wsdl-based-webservices-on-wildfly
我在哪里可以得到一些有用的答案?