I encountered a problem when converting wsdl1.1 to wsdl2.0 using the convert class of Apache Woden. When wsdl1.1 contains extension elements, such as <plnk: partnerlinktype>, the program throws an exception. If such an element is not included, it can be converted normally.
The following are the wsdl1.1 files used:
<? 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>
When the convertfile () method of the convert class is called: "Convert. convertfile (null, filepath,". ", true, true);", an exception is thrown:
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 ).
Please refer to all the experts in this article for instructions. What is the problem? How can this problem be solved? Thank you!