This script walks a WSDL definition and all of its dependencies and reduces it down to a single file, being careful to not repeat the same dependency twice. It is useful when attempting to import large, complicated WSDL definitions, for example, those generated by Microsoft WCF or those that import the NIEM Schemas.
There are several other tools out there that attempt to flatten WSDL, but they usually repeat definitions in dependencies each time a dependency is referenced, resulting in very large, unruly output that can break code generators or client libraries like Zeep and Suds.
Currently, the following types of references are supported:
- Import an XSD from a WSDL
- Include an XSD from a WSDL
- Include a WSDL from a WSDL
Importing a WSDL from a WSDL is not yet supported as the WSDL spec does not technically allow it (although I have a few workarounds for that I have been considering).
This package will install a utility called wsdl2file
. Call that tool with
the URL or pathname to your schema. It will flatten it and print the result
to stdout. Eg, to generate a standalone WSDL for the State of Minnesota's
Court Record Service:
wsdl2file "https://is.courts.state.mn.us/Prod/WebServices/ElectronicCourtFiling/CourtRecordService_4_0.svc?wsdl" > crs.wsdl
Written by Tyler MacDonald <tyler@macdonald.name>
Copyright 2024 Proof Technology, Inc
This is free software released under the Apache license, Version 2.0.