当前位置:网站首页>使用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. 以上文字演示视频
边栏推荐
- 投资75亿卢比!印度宣布建首座存储芯片组装和封测工厂,将于12月量产
- js \n\r 换行失败 :【white-space: pre-line;】${} Template Literals
- Golang dictionary map
- D the author: d new features
- Huffman树
- 第07章 InnoDB数据存储结构【2.索引及调优篇】【MySQL高级】
- 162_Power Query 快速合并文件夹中表格之自定义函数 TableXlsxCsv_2.0
- Nanoprobes FluoroNanogold 偶联物的特色和应用
- MSF编码与upx加壳过杀软
- [A summary of the sorting and use of activation functions in deep learning]
猜你喜欢
《深度学习》-学习笔记-1-机器学习基础
MSF编码与upx加壳过杀软
第二讲 软件生命周期
如何合理安排一天,做到高效备考?
PyTorch builds a neural network to predict temperature (dataset comparison, CPU vs GPU comparison)
硬件业务收入下滑,为了赚钱,苹果暧昧对待流氓软件和增加广告了
农产品企业如何进行全网营销?
细胞图像数据的主动学习
苹果终于认清现实,销量成为优先考虑,iPhone14将不涨价
CVPR 2022 | Predicting Skeletons from Human Meshes, True Physiological Skeletons!
随机推荐
如何使用matlab实现分段函数「建议收藏」
js单线程及事件循环、宏任务和微任务
GDB调试CoreDump文件
STL——vector
利用 NFT 释放网站的潜力
The maximum number of sliding window
Insert or Merge
D the author: d new features
LARS(最小角回归)
MySQL数据表操作实战
GMapping原理分析[通俗易懂]
驻尼日利亚使馆发布阿布贾祖玛岩附近地区紧急安全预警
Nanoprobes 金纳米颗粒标记试剂丨1.4 nm Nanogold 标记试剂
硬件业务收入下滑,为了赚钱,苹果暧昧对待流氓软件和增加广告了
tinymce 如何实现动态国际化
The embassy in Iceland reminds Chinese citizens in Iceland to strengthen safety protection
PMP每日一练 | 考试不迷路-8.3(包含敏捷+多选)
鸿湖万联扬帆富设备开发板正式合入OpenHarmony主干
系统学习Shell之正则表达式
如何合理安排一天,做到高效备考?