用xfire开发webservice(非spring)
我们的项目要开发一个webservice但是服务端没有用spring而全部用的servlet,不知道如何使用xfire来开发这个东东!!需要哪些jar文件?...
我们的项目要开发一个webservice但是服务端没有用spring而全部用的servlet,不知道如何使用xfire来开发这个东东!!
需要哪些jar文件? 展开
需要哪些jar文件? 展开
1个回答
展开全部
1.接口 import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; /** * * @author flytiger */ @WebService(name = "OrderService", targetNamespace = "urn:OrderService") @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) public interface IOrderService { @WebMethod(operationName = "updateOrders", action = "#updateOrders") public String updateOrders( @WebParam(name = "sUserKey", targetNamespace = "urn:OrderService") long sUserKey, @WebParam(name = "xmlEncrypt", targetNamespace = "urn:OrderService") String xmlEncrypt) throws Exception; } 实现 @WebService(serviceName = "OrderService", targetNamespace = "urn:OrderService", endpointInterface = "net.booksfly.ws.order.IOrderService") public class OrderServiceImpl implements IOrderService { public String updateOrders(long sUserKey, String xmlEncrypt)throws Exception { //...里面用struts2 hibernates实现功能。 } } 在 WEB-INF/META-INF/xfire/services.xml中配置xfire webservice <beans xmlns=""> <service> <name>OrderService</name> <namespace>urn:OrderService</namespace> <serviceClass>包名..OrderServiceImpl</serviceClass> <serviceFactory> org.codehaus.xfire.jaxb2.JaxbServiceFactory </serviceFactory> <style>document</style> <use>literal</use> <scope>application</scope> </service>
蓝屏
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询