5

我想使用 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但这不起作用。

任何人都可以提供解决此问题的解决方案。

4

1 回答 1

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
于 2013-04-23T01:51:42.250 回答