2012-04-17 65 views
0

我有一个无状态的会话bean,它暴露为web服务。有两种方法,都有@webmethod注释。但是,只有一种方法暴露为web服务。任何人都可以指出原因行为,请看下面的代码:@webmethod - 不公开该方法作为web服务(JAX-WS)

@WebService(portName = "interfaceSoapHTTPPort", serviceName = "interfaceService", targetNamespace = "http://com.demo.service/interfaceservice", endpointInterface = "com.demo.service.interfacePortType") 
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) 
@Stateless(mappedName = "InterfaceBean") 

public class InterfaceBean { 
    @PostConstruct 
    @PostActivate 
    public void initializeBean() { 

    } 

    @WebMethod 
    public void processPathEvent(XngEvent pathXngEvent) throws WSException { 

    } 

    @WebMethod 
    public void portAssignmentUpdate(WSHeader wsHeader, 
      PortAssignmentUpdateRequest portAssignmentUpdateRequest, 
      Holder<WSResponseHeader> wsResponseHeader, 
      Holder<PortAssignmentUpdateResponse> portAssignmentUpdateResponse) 
      throws WSException { 

    } 
} 

只有portAssignmentUpdate方法公开为Web服务,而不是processPathEvent方法。

谢谢。

回答

0

我能解决这个问题。

我们在@webservice注释中设置了“endpointInterface”属性。我忘记了将processPathEvent()方法添加到此接口。因此,即使添加了@webmethod注解,该方法也不会暴露。