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
版权声明:本文标题:c# - Resolving imports in WSDL for code generation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744101970a2590902.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论