当前位置:网站首页>使用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. 以上文字演示视频
边栏推荐
猜你喜欢
随机推荐
W11或W10系统如何进行休眠?
STL——vector
大型连锁百货运维审计用什么软件好?有哪些功能?
D the author: d new features
超大规模的产业实用语义分割数据集PSSL与预训练模型开源啦!
Nanoprobes FluoroNanogold 偶联物的特色和应用
ideaIU-2020.1下载
ITSM软件与工单系统的区别是什么?
函数柯里化
365天挑战LeetCode1000题——Day 048 有序队列 脑筋急转弯
Petri网-2、有向网
Chrome browser corresponding driver_chrome mobile browser
Petri net-2, directed net
PCL 点云按时间进行分段
VLAN experiment
位级运算之提取位级表示的最高位
“杀猪盘”宰向环球影城
sessionStorage of BOM series
参数量仅0.5B,谷歌代码补全新方法将内部生产效率提升6%
数据分析(二)——numpy




![[Microservice] Multi-level cache](/img/58/72e01c789a862c058cba58b9113272.png)




![[OpenCV] Cascade classifier training model](/img/37/ba57190d3515432700ec97ad14d0b9.png)