本文整理汇总了Java中me.kafeitu.activiti.chapter15.leave.ws.LeaveWebService类的典型用法代码示例。如果您正苦于以下问题:Java LeaveWebService类的具体用法?Java LeaveWebService怎么用?Java LeaveWebService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LeaveWebService类属于me.kafeitu.activiti.chapter15.leave.ws包,在下文中一共展示了LeaveWebService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startServer
import me.kafeitu.activiti.chapter15.leave.ws.LeaveWebService; //导入依赖的package包/类
/**
* 发布Webservice
*/
public static void startServer() {
if (server != null) {
System.out.println("WebService服务正在运行。。。");
return;
}
LeaveWebService leaveWebService = new LeaveWebServiceImpl();
/*JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(LeaveWebService.class);
svrFactory.setAddress(WEBSERVICE_URL);
svrFactory.setServiceBean(leaveWebService);
svrFactory.getInInterceptors().add(new LoggingInInterceptor());
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
server = svrFactory.create();
server.start();*/
Endpoint.publish(WEBSERVICE_URL, leaveWebService);
System.out.println("请假Webservice已发布:" + WEBSERVICE_URL + "?wsdl");
}
示例2: testTrue
import me.kafeitu.activiti.chapter15.leave.ws.LeaveWebService; //导入依赖的package包/类
/**
* 需要总经理审批
* @throws ParseException
*/
@Test
public void testTrue() throws ParseException, MalformedURLException {
/*
// CXF方式
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(LeaveWebService.class);
factory.setAddress(LeaveWebserviceUtil.WEBSERVICE_URL);
LeaveWebService leaveWebService = (LeaveWebService) factory.create();*/
// 标准方式
URL url = new URL(LeaveWebserviceUtil.WEBSERVICE_WSDL_URL);
QName qname = new QName(LeaveWebserviceUtil.WEBSERVICE_URI, "LeaveWebService");
Service service = Service.create(url, qname);
LeaveWebService leaveWebService = service.getPort(LeaveWebService.class);
boolean audit = leaveWebService.generalManagerAudit("2013-01-01 09:00", "2013-01-05 17:30");
assertTrue(audit);
}
示例3: testFalse
import me.kafeitu.activiti.chapter15.leave.ws.LeaveWebService; //导入依赖的package包/类
/**
* 不需要总经理审批
* @throws ParseException
*/
@Test
public void testFalse() throws ParseException {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
factory.setServiceClass(LeaveWebService.class);
factory.setAddress(LeaveWebserviceUtil.WEBSERVICE_URL);
LeaveWebService leaveWebService = (LeaveWebService) factory.create();
boolean audit = leaveWebService.generalManagerAudit("2013-01-01 09:00", "2013-01-04 17:30");
assertFalse(audit);
}