java csf_WebService CSF使用详解 | 学步园

一建立service:

1)CxfService:

@WebService

publicinterfaceCxfService {

@WebMethod

public@WebResultList getTasksByActor(

@WebParam(name="actor") String actor);

@WebMethod

publicvoidcreateAndStartProcessInstance(

@WebParam(name="processName") String processName,

@WebParam@XmlJavaTypeAdapter(MapAdapter.class) Map variables);

}

2)CxfServiceImpl:

@WebService(endpointInterface ="com.CxfService")

publicclassCxfServiceImplimplementsCxfService {

@Override

publicvoidcompleteTask(String taskId) {

JbpmHelper.taskService.completeTask(taskId);

}

@Override

publicvoidcreateAndStartProcessInstance(String processName,

Map variables) {

if(variables ==null){

JbpmHelper.executionService.startProcessInstanceByKey(processName);

}else{

JbpmHelper.executionService.startProcessInstanceByKey(processName, variables);

}

}

}

二web.xml:

contextConfigLocation

classpath:/applicationContext.xml

org.springframework.web.context.ContextLoaderListener

CXFServlet

org.apache.cxf.transport.servlet.CXFServlet

1

CXFServlet

/service/*

三spring的配置文件:applicationContext.xml

xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:p="http://www.springframework.org/schema/p"

xmlns:jaxws="http://cxf.apache.org/jaxws"

xsi:schemaLocation="http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"

default-autowire="byName"

default-lazy-init="true">

implementor="com.CxfServiceImpl"/>

address="/CxfService ">

四客户端调用:

JaxWsProxyFactoryBean jwfb =newJaxWsProxyFactoryBean();

jwfb.setServiceClass(CxfService.class);

jwfb.setAddress("http://132.94.135.15:8080/service/CxfService");

CxfService client = (CxfService) jwfb.create();

调用方法:

client.createAndStartProcessInstance("question",varMap);

List list =client.getTasksByActor("custom");

-------------------------------------------------------------------

JDK:jdk1.6.0_13(jdk1.6.0_4版本以下可能用)

Jar包:(不十分准确,可能有些包并不需要)

commons-dbcp-1.2.2.jar

commons-logging-1.1.1.jar

commons-pool-1.5.4.jar

cxf-2.2.6.jar

geronimo-activation_1.1_spec-1.0.2.jar

geronimo-annotation_1.0_spec-1.1.1.jar

geronimo-javamail_1.4_spec-1.6.jar

geronimo-ws-metadata_2.0_spec-1.1.2.jar

ibatis-2.3.4.726.jar(不需要)

jaxb-api-2.1.jar

jaxb-impl-2.1.13.jar

jaxws-api.jar

log4j-1.2.15.jar

neethi-2.0.4.jar

ojdbc14.jar

spring.jar

spring-beans-2.5.6.jar

spring-context-2.5.6.jar

spring-core-2.5.6.jar

spring-web-2.5.6.jar

stax-api-1.0.1.jar

wsdl4j-1.6.2.jar

wstx-asl-3.2.0.jar

xercesImpl.jar

xercesSamples.jar

xml-apis.jar

xmlParserAPIs.jar

xml-resolver-1.2.jar

XmlSchema-1.4.5.jar

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值