初次使用axis2,面对要自定义 address location的路径,和axis2-web, index.jsp 的链接,混弄了1天,幸好顺利解决。
因为我的项目部署在web容器是jboss(port:8080),而外面的web容器是Apache(port:80)。当外面通过80端口访问我的项目时,必需先通过apache,再到JBOSS.
而axis2会自动生成address location,路径与端口为当前的JBOSS.
出来效果如下
<wsdl:service name="Gate">
<wsdl:port name="GateSoap12" binding="tns:GateSoap12">
<soap12:address location="http://myhost.com:8080/project/services/Gate.GateSoap12/"/>
</wsdl:port>
<wsdl:port name="GateSoap" binding="tns:GateSoap">
<soap:address location="http://myhost.com:8080/project/services/Gate.GateSoap/"/>
</wsdl:port>
</wsdl:service>
为了去掉8080端口,有两种方法,
1.自定义 service.xml,它在project/WEB-INF/services/Gate/META-INF/下面
只要把这句设置为false值,就可以默认读取同路劲下的Gate.wsdl的文件 <parameter name="modifyUserWSDLPortAddress">false</parameter>
那个WSDL任你自定。
2. 我们可以修改 axis2.xml 位于project/WEB-INF/conf/下面
查找这句 <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
你可以随便定义你想要的hostname 和 port.
例如我想要80端口的,就可以这样: <parameter name="httpFrontendHostUrl">http://myhost.com/project</parameter>
这个修改是全局的,你设置<parameter name="modifyUserWSDLPortAddress">true</parameter>时,就可以自动生成的WSDL,包含了http://myhost.com/project的URL了。
同时,axis2-web里面的所有路径都以http://myhost.com/project开头了。
最后,我想要的效果出来了,
<wsdl:service name="Gate">
<wsdl:port name="GateSoap12" binding="tns:GateSoap12">
<soap12:address location="http://myhost.com/project/services/Gate.GateSoap12/"/>
</wsdl:port>
<wsdl:port name="GateSoap" binding="tns:GateSoap">
<soap:address location="http://myhost.com/project/services/Gate.GateSoap/"/>
</wsdl:port>
</wsdl:service>
Thank you.
分享到:
相关推荐
axis2-idea-plugin-1.7.9
axis2-eclipse-codegen-plugin-1.6.2.zip和axis2-eclipse-service-plugin-1.6.2.zip,解压即可使用
目前axis2最高版本是2.0以上的版本,但是eclipse和myeclipse都不支持,无奈只能使用低版本的插件1.6.3;经实验,可以安装成功; 安装方法:右键解压到当前文件夹,Copy解压的文件到eclipse安装目录dropins下,重启...
共四个文件,都是最先版的,希望可以帮助大家。axis2-eclipse-service-archiver-wizard和axis2-eclipse-codegen-wizard和axis2-1.6.1-bin和axis2-1.6.1-war
axis2-kernel-1.3.jar axis2-kernel-1.3.jar
axis2c-bin-1.6.0-linux.tar.gz axis2c-bin-1.6.0-win32.zip axis2c-src-1.6.0.tar.gz axis2c-src-1.6.0.zip 加md5
axis2-std-1.0-bin.zip与axis2.war axis2-std-1.0-bin.zip与axis2.war
axis2-1.5.1-bin.zip axis2-1.5.1-war.zip webservice部署axis所需要是包
绝对可以用,里面配有myeclipse10安装AXIS2插件的步骤,希望大家工作愉快,谢谢,给好评哦
axis2-1.6.0-bin和axis2-1.6.0-war相关资源
包括两个工具包axis2-1.4.1-bin.zip,和axis2-1.4.1-war.zip
Axis2-1.6.2-bin和Axis2-1.6.2-war
axis2-1.5.4-bin axis2-1.5.4-war
axis2-eclipse-codegen-plugin-1.6.0和axis2-eclipse-service-plugin-1.6.0有关jar包下载,解压后直接将这两个jar包放到eclips下的plugins目录下,重启eclipse即可
axis2-1.5.3-bin.zip axis2-1.5.3-bin.zip axis2-1.5.3-bin.zip axis2-1.5.3-bin.zip
axis2-eclipse-codegen-plugin-1.6.2+axis2-eclipse-service-plugin-1.6.2
axis2-1.6.2-war、axis2-1.6.1-war、axis2-1.6.2-bin
axis2-eclipse-service-archiver-wizard.zip
axis2-adb-1.4.1.jar axis2-adb-1.4.1.jar
axis2-1.6.1-bin.zip axis2-1.6.1-bin.zip axis2-1.6.1-bin.zip axis2-1.6.1-bin.zip