最近在研究ProcessMaker,ProcessMaker 2.5版本是用php发布的webservice,所以需要采用java 的cxf调用php的webservice过程。 要了解Web Service,关键的是wsdl。 步骤一: http://blog.163.com/kangle0925@126/blog/static/27758198201363111718168) 1、先
最近在研究ProcessMaker,ProcessMaker 2.5版本是用php发布的webservice,所以需要采用java 的cxf调用php的webservice过程。
要了解Web Service,关键的是wsdl。
步骤一:http://blog.163.com/kangle0925@126/blog/static/27758198201363111718168)
1、先下载cxf包:http://cxf.apache.org/download.html,现在cxf包。
2、解压缩包,通过cmd命令进入到bin目录下
在命令行执行wsdl2java -p com.winssage.demo.service -d d:\pmws -clientd:\pmws\wsdl2.xml (只需生成WebService客户端相关的代码即可)
wsdl2java用法:
wsdl2java -p com -d src -all aa.wsdl
-p 指定其wsdl的命名空间,也就是要生成代码的包名:
-d 指定要产生代码所在目录
-client 生成客户端测试web service的代码
-server 生成服务器启动web service的代码
-impl 生成web service的实现代码
-ant 生成build.xml文件
-all 生成所有开始端点代码:types,service proxy,,service interface, server mainline, client mainline, implementation object, and an Ant build.xml file.
步骤二:修改cxf的bean配置文件(spring集成)
ProcessMakerServiceSoap:为从wsdl生成的webservice 接口类(interface),必须赋值予工厂类org.apache.cxf.jaxws.JaxWsProxyFactoryBean的serviceClass属性。
工厂类org.apache.cxf.jaxws.JaxWsProxyFactoryBean的address属性:必须取自wsdl.xml文件中的service配置,如下
service
name="ProcessMakerService">
port name="ProcessMakerServiceSoap" binding="xs0:ProcessMakerServiceSoap">
soap12:address
location="http://192.168.1.215:80/sysworkflow/en/classic/services/soap2"/>
port>
service>
错误解决:A class/interface with the same name "XXX**" is already in use.
http://chenlin10058.iteye.com/blog/1558591)
1.使用-autoNameResolution自动处理
wsdl2java -autoNameResolution http://localhost:8060/soa/services/otherTrackedVehicleSoapService?wsdl
or
wsimport -p com.test.client -keep http://localhost:8060/soa/services/otherTrackedVehicleSoapService?wsdl-B-XautoNameResolution
错误解决:super相关代码编译报错:
- //This
constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 -
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 -
//compliant code instead. -
public IcpBusinessService(WebServiceFeature ... features) { -
super(WSDL_LOCATION, SERVICE, features); -
} -
-
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 -
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 -
//compliant code instead. -
public IcpBusinessService(URL wsdlLocation, WebServiceFeature ... features) { -
super(wsdlLocation, SERVICE, features); -
} -
-
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2 -
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1 -
//compliant code instead. -
public IcpBusinessService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) { -
super(wsdlLocation, serviceName, features); -
} $
其不能正常编译通过是由于jax-ws2.2规约与java6冲突,执行命令:
wsdl2java -frontend jaxws21 -client *.xml

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

Atom編輯器mac版下載
最受歡迎的的開源編輯器

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

ZendStudio 13.5.1 Mac
強大的PHP整合開發環境