我可能不是第一个提出这个问题的人,但我真的很挣扎。错误日志非常清楚,显然我需要在组件扫描组件中添加bean或include包。即使检查后仍然会得到相同的错误。我得到的错误是:
@Service("testService")
public class TestService {
private TestServiceClient service;
@Autowired
public TestService(TestServiceClient service){
this.service = service;
}
public void getData(DelegateExecution execution){
...
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("done", true); // Always ask for consent
execution.setVariables(variables);
}
}
这是我目前的实施:
@Service
public class OfferServiceClient implements Offer{
private Offer testPort;
@Autowired
public TestServiceClient(Test port) {
this.testPort = port;
}
public GetDataResponse getData(
GetDataRequest request) {
return offerPort.getData(request);
}
}
SOAP服务接口的实现:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
">
<context:annotation-config/>
<context:component-scan base-package="_1.camunda, _1, _1._2012._08.testservice"/>
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:spring/engine/spring-context.xml"/>
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor" id="logInInterceptor">
<property name="prettyLogging" value="true" />
</bean>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" id="logOutInterceptor">
<property name="prettyLogging" value="true" />
</bean>
<jaxws:client
serviceClass="_1._2012._08.testservice.Test"
address="${testService.url}" id="test">
<jaxws:inInterceptors>
<ref bean="logInInterceptor" />
</jaxws:inInterceptors>
<jaxws:outInterceptors>
<ref bean="logOutInterceptor" />
</jaxws:outInterceptors>
</jaxws:client>
Spring配置:
{{1}}