当前位置:网站首页>使用Jetty服务器和Axis2框架技术发布Webservice接口
使用Jetty服务器和Axis2框架技术发布Webservice接口
2022-08-03 13:58:00 【51CTO】
1.所需要的工具
1.1 Ant工具 ,axis2-bin文件,axis2-war文件
这些工具和jar都可以从网上下载
2.下面我在eclipse中编写一个测试类,就是这么简单。
3.我们把axis2-war这个文件 解压之后,把axis2文件放入到jetty容器中的webapps目录下,D:\jetty-6.1.9\webapps
4.ant执行命令
D:\caseone\test>ant generate.wsdl
D:\caseone\test>ant generate.service
执行成功之后 生成build文件
4.
.
5.把Add文件复制到
6.service.xml文件
<!--
~ Licensed to the Apache Software Foundation ( ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 ( the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http: //www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
< service name = "Add" scope = "application" targetNamespace = "http://add/" >
< description >
Add
< /description>
< messageReceivers >
< messageReceiver mep = "http://www.w3.org/2004/08/wsdl/in-only"
class = "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" / >
< messageReceiver mep = "http://www.w3.org/2004/08/wsdl/in-out"
class = "org.apache.axis2.rpc.receivers.RPCMessageReceiver" / >
< /messageReceivers>
< schema schemaNamespace = "http://Add/xsd" / >
< parameter name = "ServiceClass" > Add < /parameter>
< /service>7.bulid.xml文件
< project name = "quickstart" basedir = "." default = "generate.service" >
< property environment = "env" / >
< property name = "AXIS2_HOME" value = "../.." / >
< property name = "build.dir" value = "build" / >
< path id = "axis2.classpath" >
< fileset dir = "${AXIS2_HOME}/lib" >
< include name = "*.jar" / >
< /fileset>
< /path>
< target name = "compile.service" >
< mkdir dir = "${build.dir}" / >
< mkdir dir = "${build.dir}/classes" / >
<!--First let's compile the classes-->
< javac debug = "on"
fork = "true"
destdir = "${build.dir}/classes"
srcdir = "${basedir}/src"
classpathref = "axis2.classpath" >
< /javac>
< /target>
< target name = "generate.wsdl" depends = "compile.service" >
< taskdef name = "java2wsdl"
classname = "org.apache.ws.java2wsdl.Java2WSDLTask"
classpathref = "axis2.classpath" / >
< java2wsdl className = "Add"
outputLocation = "${build.dir}"
targetNamespace = "http://add/"
schemaTargetNamespace = "http://add/xsd" >
< classpath >
< pathelement path = "${axis2.classpath}" / >
< pathelement location = "${build.dir}/classes" / >
< /classpath>
< /java2wsdl>
< /target>
< target name = "generate.service" depends = "compile.service" >
<!--aar them up -->
< copy toDir = "${build.dir}/classes" failοnerrοr = "false" >
< fileset dir = "${basedir}/resources" >
< include name = "**/*.xml" / >
< /fileset>
< /copy>
< jar destfile = "${build.dir}/add.aar" >
< fileset excludes = "**/Test.class" dir = "${build.dir}/classes" / >
< /jar>
< /target>
< target name = "clean" >
< delete dir = "${build.dir}" / >
< /target>
< /project>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
8.最后启动jetty
9. 以上文字演示视频
边栏推荐
- 不卷不pua,早9晚6,这个招聘深得我心
- Chrome browser corresponding driver_chrome mobile browser
- Golang sync.WaitGroup
- 升级农企业务运营建设,智慧供应链管理平台打造“共赢生态链”
- MSF编码与upx加壳过杀软
- 张乐:研发效能的黄金三角及需求与敏捷协作领域的实践|直播回顾
- CVPR 2022 | Predicting Skeletons from Human Meshes, True Physiological Skeletons!
- 如何在 UE4 中制作一扇自动开启的大门
- 【二叉树】从二叉树一个节点到另一个节点每一步的方向
- GMapping原理分析[通俗易懂]
猜你喜欢
随机推荐
Relia Tech活性VEGFR重组蛋白丨小鼠 VEGF120实例展示
MySQL数据表操作实战
ideaIU-2020.1下载
sessionStorage of BOM series
背后的力量 | 提升医疗服务“速度“和“温度” 华云数据助力上海国际医学中心加速智慧医院建设
MSF编码与upx加壳过杀软
不卷不pua,早9晚6,这个招聘深得我心
中英文说明书丨Abbkine AbFluor 488-鬼笔环肽
微服务的快速开始(nacos)最全快速配置图解
Nanoprobes金脂质偶联物的相关应用
函数在结构体中的应用练习
VLAN experiment
D the author: d new features
Forrester:行业云帮助中国企业更快适应未来的发展
Ansible中的角色使用
美国拟对华禁售128层以上NAND Flash制造设备
The embassy in Iceland reminds Chinese citizens in Iceland to strengthen safety protection
【框架】idea找不到xxx依赖项怎么办
利用 NFT 释放网站的潜力
有哪些好用的IT资产管理平台?