我正在将作为Web服务公开的无状态EJB从JBoss7 AS迁移到WildFly 10(当然,我来得有点晚)。
http://localhost:8080/vmwWS/vmw曾经可以访问该Web服务,现在迁移到WildFly使我http://localhost:8080/ / vmwWS / WSVMWBean,但我还没有找到改变它的方法。
这是网络服务类
[...]
@Interceptors(TracingInterceptor.class)
@Stateless
@WebService(endpointInterface = "com.mydomain.WSVMW")
@WebContext(contextRoot="/vmwWS", urlPattern ="/vmw", authMethod="BASIC", secureWSDLAccess = false)
@SecurityDomain("JBossWS")
@RolesAllowed({ "Read", "Write" })
public class WSVMWBean implements WSVMW {
[...]
接口:
[...]
@WebService(name = "vmw")
@SOAPBinding(style = Style.DOCUMENT)
@Local
public interface WSVMW {
[...]
还有jboss-webservice.xml:
<?xml version="1.0" encoding="UTF-8"?>
<webservices xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee/jbossws-web-services_1_0.xsd"
version="1.1">
<context-root>vmwWS</context-root>
<port-component>
<ejb-name>WSVMWBean</ejb-name>
<port-component-name>WSVMWBean</port-component-name>
<port-component-uri>/vmw</port-component-uri>
<auth-method>BASIC</auth-method>
</port-component>
</webservices>
日志说:
22:16:59,520 INFO [org.jboss.ws.cxf.metadata] (MSC service thread 1-8) JBWS024061: Adding service endpoint metadata: id=WSVMWBean
address=http://localhost:8080/<ejb-jar-name>/vmwWS/WSVMWBean
implementor=com.mydomain.WSVMWBean
serviceName={http://vmw.mydomain.com/}/vmwWS
portName={http://vmw.mydomain.com/}WSVMWBeanPort
annotationWsdlLocation=null
wsdlLocationOverride=null
mtomEnabled=false
如何恢复以前的行为?
最佳答案
简而言之,这是固定它的差异:
-import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.ws.api.annotation.WebContext;
从这里:
https://developer.jboss.org/wiki/JBossWS4MigrationGuide