WebService笔记

WebService笔记

ID:37905895

大小:75.54 KB

页数:8页

时间:2019-06-02

WebService笔记_第1页
WebService笔记_第2页
WebService笔记_第3页
WebService笔记_第4页
WebService笔记_第5页
资源描述:

《WebService笔记》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、发布服务的几种方式:1、纯JDK发布ProjectManagerprojectManager=newProjectManagerImpl();Stringaddress="http://localhost:8080/ProjectManager";//参数1服务的发布地址,参数2服务的实现者Endpoint.publish(address,projectManager);2、使用JaxServiceFactoryBean发布CXF的web服务,需要CXF框架jar包必须加入WebService注解,如果不加,虽然不报错,但是

2、所有的方法都无法暴露.与父类ServerFactoryBean发布方式相同JaxWsServerFactoryBeanbean=newJaxWsServerFactoryBean();bean.setAddress("http://localhost:8080/cxfhello");bean.setServiceClass(HelloServiceI.class);bean.setServiceBean(newHelloServiceImpl());//加入请求的消息拦截器bean.getInInterceptors().a

3、dd(newLoggingInInterceptor());//加入输出的消息拦截器bean.getOutInterceptors().add(newLoggingOutInterceptor());bean.create();System.out.println("helloServiceready...");3、使用spring+Servlet在tomcat中发布:cxf-servlet-spring.xml配置文件中的内容

4、http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"xmlns:jaxws="http://cxf.apache.org/jaxws"xsi:schemaLocation="http://cxf.apache.org/transports/http/

5、configurationhttp://cxf.apache.org/schemas/configuration/http-conf.xsdhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd">

7、"HelloService"implementor="com.lwl.ee.HelloService"address="/hello">

8、interceptor.LoggingOutInterceptor">

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。