Web services @webmethod-不将该方法公开为webservice(JAX-WS)
我有一个无状态会话bean,它作为webservice公开。有两种方法,都有@webmethod注释。但是,只有一个方法公开为webservice。任何人都可以指出这种行为的原因,请查找以下代码:Web services @webmethod-不将该方法公开为webservice(JAX-WS),web-services,wsdl,jax-ws,Web Services,Wsdl,Jax Ws,我有一个无状态会话bean,它作为webservice公开。有两种方法,都有@webmethod注释。但是,只有一个方法公开为webservice。任何人都可以指出这种行为的原因,请查找以下代码: @WebService(portName = "interfaceSoapHTTPPort", serviceName = "interfaceService", targetNamespace = "http://com.demo.service/interfaceservice", endpoin
@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 {
}
}
@WebService(portName=“interfacesaphttpport”,serviceName=“interfaceService”,targetNamespace=”http://com.demo.service/interfaceservice,endpointInterface=“com.demo.service.interfacePortType”)
@SOAPBinding(style=SOAPBinding.style.DOCUMENT)
@无状态(mappedName=“InterfaceBean”)
公共类接口{
@施工后
@激活后
public void initializeBean(){
}
@网络方法
public void processPathEvent(XngEvent pathXngEvent)引发WSException{
}
@网络方法
public void portAssignmentUpdate(WSHeader WSHeader,
PortAssignmentUpdateRequest PortAssignmentUpdateRequest,
负责人,
持有者portAssignmentUpdateResponse)
抛出WSException{
}
}
只有portAssignmentUpdate方法作为webservice公开,而不是processPathEvent方法
谢谢。我能解决这个问题 我们在@webservice注释中设置了“endpointInterface”属性。我忘记将processPathEvent()方法添加到此接口。因此,即使添加了@webmethod注释,该方法也没有公开