WebLogic环境下WebService开发过程

上传人:mg****2 文档编号:144930430 上传时间:2020-09-14 格式:DOC 页数:20 大小:3.58MB
返回 下载 相关 举报
WebLogic环境下WebService开发过程_第1页
第1页 / 共20页
WebLogic环境下WebService开发过程_第2页
第2页 / 共20页
WebLogic环境下WebService开发过程_第3页
第3页 / 共20页
WebLogic环境下WebService开发过程_第4页
第4页 / 共20页
WebLogic环境下WebService开发过程_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《WebLogic环境下WebService开发过程》由会员分享,可在线阅读,更多相关《WebLogic环境下WebService开发过程(20页珍藏版)》请在金锄头文库上搜索。

1、. . . . . . WebLogic环境下WebService开发过程一 WebService开发环境的创建1创建WebService工程开发工具采用WebLogic自带的Wokshop开发2.引入WebLogic下的webservices.jar包该jar包位于WebLogic的安装路径下的weblogic92serverlib目录,比如D:beaweblogic92serverlib3.创建WebService类3.1创建类3.2需要发布成WebService的类引入WebService的对应类import javax.jws.*;import weblogic.jws.WLHttpT

2、ransport;import weblogic.jws.WSDL;import javax.jws.soap.SOAPBinding;import javax.xml.namespace.QName;import javax.xml.rpc.soap.SOAPFaultException;import javax.xml.soap.Detail;import javax.xml.soap.Name;import javax.xml.soap.SOAPException;import javax.xml.soap.SOAPFactory;3.3 通过添加注释将类及方法暴露为WebService

3、接口WebService 和WebMethod这两个标示是必须的(1)添加类注释,比如:WebService(name = CrudTable, serviceName = CrudTableService, targetNamespace = .victorysoft.)WLHttpTransport(serviceUri = CrudTableService, portName = CrudTableSoapPort)WSDL(exposed = true)SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.U

4、se.LITERAL)(2)添加方法注释,比如:WebMethodWebResult(name = crudDataFromTableResponse, targetNamespace = .victorysoft.)4.开发环境下WebLogic服务器的配置4.1服务器视图4.2服务器配置4.3开发环境下的发布点击”发布”菜单找到对应的WSDL文件,在build/jws/weboutput/WEB-INF/目录下,比如CrudTableService.wsdl找到最下面的WSDL发布URL,比如localhost:7001/TableCrud/CrudTableService,然后在浏览器地

5、址栏输入对应的地址如localhost:7001/TableCrud/CrudTableService?WSDL如能看到容,则说明发布成功5.WebService的打WAR包方法和普通Web工程没啥区别二 WebService客户端开发环境的创建客户端需要创建一个普通的java工程就可,需要用Ant生成客户端代理程序。1. 相关用户库的创建创建用户库WebServiceClient,步骤点击“窗口”首选项”java”-”构建路径”“用户库”将weblogic.jar、webserviceclient.jar、apachexmlbeansutil.jar 加入到WebServiceClient用户库中2. 引入WebServiceClient用户库3. Ant类库的配置Ant 的主路径加入weblogic.jar点击“窗口”首选项”Ant”-“运行时“”类路径”Ant主目录条目“”添加外部JAR“4. Ant的bulid.xml的配置容如下: Build the SAAJ Client Files.Compile the generated client utility files.Compile the client source file.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号