开发时需要在src中新建META-INF=>xfire=>services.xml 这样编译出来就在classes文件夹下。
services.xml配置
<?xml version="1.0" encoding="UTF-8"?> <beans> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>DeviceService</name> <serviceClass>com.ws.service.IDevice</serviceClass> <implementationClass>com.ws.serviceImp.DeviceService</implementationClass> </service> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>RealWarnService</name> <serviceClass>com.ws.service.IRealWarn</serviceClass> <implementationClass>com.ws.serviceImp.RealWarnService</implementationClass> </service> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>RealDataService</name> <serviceClass>com.ws.service.IRealData</serviceClass> <implementationClass>com.ws.serviceImp.RealDataService</implementationClass> </service> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>BatteryService</name> <serviceClass>com.ws.service.IBatteryService</serviceClass> <implementationClass>com.ws.serviceImp.BatteryService</implementationClass> </service> <service xmlns="http://xfire.codehaus.org/config/1.0"> <name>DischargeService</name> <serviceClass>com.ws.service.IDischarge</serviceClass> <implementationClass>com.ws.serviceImp.DischargeService</implementationClass> </service> </beans>
测试网址:http://localhost:8080/ws/services/DischargeService?wsdl
.net调用:http://localhost:8080/ws/services/DischargeService?wsdl
java调用:http://localhost:8080/ws/services/DischargeService