WSDLs for an IDOC can be downloaded in transaction WE62.
Simply enter the IDOC type and click Documentation --> Download XML Schema
If you get the error "Segment X is unknown in release Y" (EA 257), it generally means that the segment in question has not been released. If it's a custom IDOC you've built or generated yourself, you can do the release in BDFG or WE30.
However, sometimes you're dealing with an enhanced standard IDOC. And here it gets a bit more complicated. In a recent case, I was came across with an enhanced equipment IDOC (COD_EQUIPMENT_SAVE). Checking the IDOC in BDFG, the system said it needs to be generated. But this is a red herring because according to SAP note 2177401, regeneration of standard segments is neither supported nor recommended. SAP has released note 1866413 to allow this, but again, it's not recommended, so we're not going to do it.
And it's not necessary, because you can download the WSDL with report SRT_IDOC_WSDL_NS (SE38).
Here, simply enter your Basic Type and Message Type - but leave the Release fields empty (important!). If you do the same in transaction WE62, it won't work - but here, simply press execute and you'll be offered to download the WSDL.