当前位置: 首页 > 工具软件 > Apache Woden > 使用案例 >

用Apache woden 的convert类将wsdl1.1转化为wsdl2.0

拓拔俊德
2023-12-01

    我在用Apache woden 的convert类将wsdl1.1转化为wsdl2.0时出现了个问题,当wsdl1.1包含扩展元素时,比如 <plnk:partnerLinkType >,程序就会抛出异常。  没有包含这样的element时,就能正常转化。
以下是所用的wsdl1.1文件:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="loanProcess"
xmlns:tns="http://www.example.org/loanProcess/"
targetNamespace="http://www.example.org/loanProcess/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns:loan="http://schemas.sia.org/sample/LoanRequest/2008/02/loanRequest.xsd"
xmlns:loanmsg="http://docs.sia.org/sample/wsdl/loanMessages/2008/02/loanMessages.wsdl">

<plnk:partnerLinkType name="LoanProcessLT">
<plnk:role name="loanProcessor" portType="tns:LoanProcess" />
</plnk:partnerLinkType>

<wsdl:import location="loanMessages.wsdl"    namespace="http://docs.sia.org/sample/wsdl/loanMessages/2008/02/loanMessages.wsdl" />

<wsdl:types>
<xsd:schema elementFormDefault="qualified">
<xsd:import
namespace="http://schemas.sia.org/sample/LoanRequest/2008/02/loanRequest.xsd"
schemaLocation="../schema/loanRequest.xsd">
</xsd:import>
</xsd:schema>
</wsdl:types>

<wsdl:portType name="LoanProcess">
<wsdl:operation name="request">
<wsdl:input message="loanmsg:creditInformationMessage" />
<wsdl:output message="loanmsg:approvalMessage" />
<wsdl:fault name="unableToHandleRequest" message="loanmsg:errorMessage" />
</wsdl:operation>
</wsdl:portType>

.......
</wsdl:definitions>

当调用convert类的convertFile()方法时:"convert.convertFile(null, filePath, ".", true, true);", 就会抛出异常:
java.lang.IllegalArgumentException: Encountered unknown extension element '{http
://docs.oasis-open.org/wsbpel/2.0/plnktype}partnerLinkType', as a child of a jav
ax.wsdl.Definition.
at org.apache.woden.tool.converter.Convert.convertExtensions(Convert.java:456)
at org.apache.woden.tool.converter.Convert.convertDefinition(Convert.java:224)
at org.apache.woden.tool.converter.Convert.convertDefinition(Convert.java:187)
at org.apache.woden.tool.converter.Convert.convertFile(Convert.java:284)
at org.apache.woden.tool.converter.TestConvert.testConvertFile(TestConvert.java
:79)
.
请看到文章的各位高手指点一下,问题出在哪里?该怎么解决?多谢了!

 类似资料: