SvcUtil does not generate code for imported XSDs
- Dominant language
- C#
- Stars
- 1.8k
- Forks
- 576
- Avg merge
- 6d 9h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
I'm trying to generate a service from a WSDL that uses requests/responses defined in imported XSDs, and although SvcUtil is reading the XSDs, no code is generated for them and the generated request/response classes are empty.
**To Reproduce**
Run dotnet-svcutil with a WSDL similar to this one:
```xml
...
```
Please let me know if you need the full WSDL with the XSD files, I may be able to share it privately.
The generated code looks like this:
```cs
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "8.0.0")]
[System.ServiceModel.MessageContractAttribute(WrapperName="ValidateRequest", WrapperNamespace="http://www.w3.org/2002/03/xkms#", IsWrapped=true)]
internal partial class validateRequest
{
public validateRequest()
{
}
}
```
**Expected behavior**
dotnet-svcutil should generate code for the referenced XSD files.
**Additional context**
Although I was able to use xsd.exe to generate classes for the referenced XSDs, it is missing a significant amount of attributes. I was able to fix it up somewhat but still cannot produce the XML I want. This would also be very hard to maintain.
Contributor guide
Research direction
Start by reproducing the issue with the WSDL and imported XSD structure shown in the report using dotnet-svcutil, then compare its output with the xsd.exe result. The work is done when referenced XSD types generate correctly in the request and response classes, including the XML attributes needed to produce the expected XML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100