本文整理匯總了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);
}