webService调用spring配置文件中的bean为空问题!!
问题:
A项目中有配置好的spring bean文件(该文件配置没问题,在A项目中使用正常)。
部分bean文件代码:
<bean id="guaranteeApplyService" class="com.supporter.prj.bm.guarantee.service.GuaranteeApplyService">
</bean>
现在A项目中添加基于cxf的webservice接口:
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<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="bm_guarantee-service.xml"/>
<jaxws:endpoint id="GuaranteeApplyWebServiceZjMa"
address="/GuaranteeApplyWebServiceZjMa"
implementor="com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMaImpl">
</jaxws:endpoint>
</beans>
接口实现类代码:
@WebService(endpointInterface = "com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMa", serviceName = "GuaranteeApplyWebServiceZjMa")
public class GuaranteeApplyWebServiceZjMaImpl implements GuaranteeApplyWebServiceZjMa {
@Autowired
GuaranteeApplyService guaranteeApplyService;
@Override
public String getGuaranteeApplyRecord() {
System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService);
}
项目启动不报错,只是System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService); 输出调用的guaranteeApplyService为空!!
在线急等,求帮助,万分感谢!!!
A项目中有配置好的spring bean文件(该文件配置没问题,在A项目中使用正常)。
部分bean文件代码:
<bean id="guaranteeApplyService" class="com.supporter.prj.bm.guarantee.service.GuaranteeApplyService">
</bean>
现在A项目中添加基于cxf的webservice接口:
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<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="bm_guarantee-service.xml"/>
<jaxws:endpoint id="GuaranteeApplyWebServiceZjMa"
address="/GuaranteeApplyWebServiceZjMa"
implementor="com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMaImpl">
</jaxws:endpoint>
</beans>
接口实现类代码:
@WebService(endpointInterface = "com.supporter.prj.bm.webservice.guaranteeApply.GuaranteeApplyWebServiceZjMa", serviceName = "GuaranteeApplyWebServiceZjMa")
public class GuaranteeApplyWebServiceZjMaImpl implements GuaranteeApplyWebServiceZjMa {
@Autowired
GuaranteeApplyService guaranteeApplyService;
@Override
public String getGuaranteeApplyRecord() {
System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService);
}
项目启动不报错,只是System.out.println("aaaaaaaaaaaaa"+guaranteeApplyService); 输出调用的guaranteeApplyService为空!!
在线急等,求帮助,万分感谢!!!
...全文
相关推荐
使用spring远程调用服务端接口实现WebService功能
适合有spring框架的javaEE平台,出自spring的HttpInvokerServiceExporter导出器,依赖Spring.jar
webservice7 spring的bean发布为webservice
webservice7 spring的bean发布为webservice
spring下webservice的配置及实例
主要描述了s2sh框架下xfire配置webservice的方法,以及实例。绝对是处于本人之手,并且验证过,绝对真实.
webservice cxf spring整合返回list,bean,string,json,xml项目完整实例
webservice cxf spring整合返回list,bean,string,json,xml项目完整实例
在自己的项目中利用axis2+spring发布webservice与客户端调用包括session
NULL 博文链接:https://lichaobao.iteye.com/blog/2142754


