admin管理员组

文章数量:1394774

I'm trying to generate a service from a WSDL that uses imported XSDs. The message types are defined within those imports, but seemingly not taken into account.

I was able to generate code with svcutil.exe, dotnet-svcutil and the Visual Studio "Add Connected Service" function, but all three do not generate code for the imported XSD and instead just generate empty classes with no properties. I was able to generate code using xsd.exe for the imported XSDs, but connecting the generated classes is not trivial and I'd like a solution with fewer error-prone steps for maintenance.

Is there a way to resolve the imports when generating the service code?
Alternatively, is it possible to resolve those imports manually to make an all-in-one WSDL?

Here's a shortened form of the WSDL:

<?xml version='1.0' encoding='UTF-8'?>
<definitions
  xmlns:...
  xmlns:xkms=";
  xmlns:tns="some/namespace"
  name="XKMSValidate"
  targetNamespace="some/namespace">
  <types>
    <xsd:schema
      xmlns:...
      xmlns:xkms=";
      xmlns:tns="some/namespace"
      elementFormDefault="qualified"
      targetNamespace="some/namespace">
      <xsd:import namespace="; schemaLocation="http://.../xkms.xsd" />
    </xsd:schema>
  </types>
  <message name="validateResult">
    <part element="xkms:ValidateResult" name="parameters"></part>
  </message>
  <message name="validateRequest">
    <part element="xkms:ValidateRequest" name="parameters"></part>
  </message>
  <portType name="SOAPEntryEUPortType">
    <operation name="validate">
      <input message="tns:validateRequest"></input>
      <output message="tns:validateResult"></output>
    </operation>
  </portType>
  <binding name="SOAPEntryEUServiceBinding" type="tns:SOAPEntryEUPortType">
    <soap12:binding style="document" transport="/" />
    <operation name="validate">
      <soap12:operation soapAction="" />
      <input><soap12:body use="literal" /></input>
      <output><soap12:body use="literal" /></output>
    </operation>
  </binding>
  <service name="xkms_soap_1_1">...</service>
</definitions>

本文标签: cResolving imports in WSDL for code generationStack Overflow