wsdl2java(CXF)中的自定义包

时间:2013-04-22 11:27:09

标签: cxf

我想使用wsdl2java(CXF)命令生成自定义包。

我的WSDL结构是:

wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"   
xmlns:jms="http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS" 
xmlns:ns20="http://cdm.test.co.uk/marketing/Promotions/2.0"   
xmlns:jndi="http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi" 
xmlns:ns16="http://cdm.test.co.uk/common/CrossRef/2.0" 
xmlns:ns17="http://services.test.co.uk/service/CommonMessage/2.0" 
xmlns:ns14="http://cdm.test.co.uk/banking/Wallet/2.0"     
xmlns:ns15="http://cdm.test.co.uk/common/Currency/2.0" 
xmlns:ns18="http://cdm.test.co.uk/customer/Transaction/2.0" 
xmlns:ns19="http://cdm.test.co.uk/party/PartyRole/2.0" 
xmlns:ns9="http://cdm.test.co.uk/common/Channel/2.0" 
xmlns:soap1="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:ns12="http://cdm.test.co.uk/banking/Payment/2.0" 
xmlns:ns5="http://cdm.test.co.uk/common/InternationalMoney/2.0" 
xmlns:ns13="http://cdm.test.co.uk/customer/Account/2.0" 
xmlns:ns6="http://cdm.test.co.uk/common/Location/2.0" 
xmlns:ns10="http://cdm.test.co.uk/retail/RetailShop/2.0"  
xmlns:ns7="http://cdm.test.co.uk/party/Party/2.0" 
xmlns:ns11="http://cdm.test.co.uk/common/BaseType/2.0" 
xmlns:ns8="http://cdm.test.co.uk/product/Games/2.0" 
xmlns:ns2="http://cdm.test.co.uk/common/Country/2.0" 
xmlns:ns1="http://cdm.test.co.uk/customer/Customer/2.0" 
xmlns:ns4="http://cdm.test.co.uk/partner/Affiliate/2.0" 
xmlns:ns3="http:///common/ManagedEntity/2.0" 
xmlns:tns="http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0" 
xmlns:ns0="http://cdm.test.co.uk/producdm.test.co.ukct/Catalogue/2.0" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
targetNamespace="http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0"

我使用下面的命令来生成java文件:

wsdl2java -db xmlbeans -d“D:\ MY_PROJECT”wsdllocation

所以所有的java文件都是在uk.co.test.cdm和uk.co.test.services文件夹中创建的。

但我想在com.greeting.cdm和com.greeting.services文件夹下生成所有文件。意味着uk.co.test应该被com.greeting取代。

我在命令中使用此选项来更改包: -p com.greeting 但这不起作用。

任何人都可以提供解决方案来解决这个问题。

1 个答案:

答案 0 :(得分:8)

你应该使用很多-p选项。像这样:

wsdl2java -db xmlbeans -d "D:\MY_PROJECT" \
-p http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0=com.greeting.services \
-p http://cdm.test.co.uk/common/Country/2.0=com.greeting.cdm \
-p http://cdm.test.co.uk/customer/Customer/2.0=com.greeting.cdm \
... \
wsdllocation