-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataContract containing IList<struct> produces invalid WSDL #346
Comments
DataContract containing IList<struct> produces invalid WSDL #346
@kotovaleksandr While the original issue is gone, which was the empty Also, FaultContracts are not working with a similar message. Message:
Still not valid WSDL to use in the WCF Test Client. Full WSDL <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" targetNamespace="http://tempuri.org/" name="MyService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:import namespace="http://schemas.datacontract.org/2004/07/WebApplication3" />
<xs:element name="Do">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="input" nillable="true" type="q1:DTO" xmlns:q1="http://schemas.datacontract.org/2004/07/WebApplication3" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DoResponse">
<xs:complexType>
<xs:sequence />
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType" />
<xs:element name="anyURI" nillable="true" type="xs:anyURI" />
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
<xs:element name="boolean" nillable="true" type="xs:boolean" />
<xs:element name="byte" nillable="true" type="xs:byte" />
<xs:element name="dateTime" nillable="true" type="xs:dateTime" />
<xs:element name="decimal" nillable="true" type="xs:decimal" />
<xs:element name="double" nillable="true" type="xs:double" />
<xs:element name="float" nillable="true" type="xs:float" />
<xs:element name="int" nillable="true" type="xs:int" />
<xs:element name="long" nillable="true" type="xs:long" />
<xs:element name="QName" nillable="true" type="xs:QName" />
<xs:element name="short" nillable="true" type="xs:short" />
<xs:element name="string" nillable="true" type="xs:string" />
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
<xs:element name="char" nillable="true" type="tns:char" />
<xs:simpleType name="char">
<xs:restriction base="xs:int" />
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration" />
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
<xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
<xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid" />
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName" />
<xs:attribute name="Id" type="xs:ID" />
<xs:attribute name="Ref" type="xs:IDREF" />
</xs:schema>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/WebApplication3" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/WebApplication3" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:import namespace="http://schemas.datacontract.org/2004/07/System" />
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<xs:complexType name="DTO" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:sequence>
<xs:element minOccurs="0" name="MyStructs" nillable="true" type="tns:ArrayOfAnyStruct" />
</xs:sequence>
</xs:complexType>
<xs:element name="DTO" nillable="true" type="tns:DTO" />
<xs:complexType name="ArrayOfAnyStruct" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="AnyStruct" type="q1:AnyStruct" />
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfAnyStruct" nillable="true" type="tns:ArrayOfAnyStruct" />
<xs:complexType name="AnyStruct" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:annotation>
<xs:appinfo>
<IsValueType xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</IsValueType>
</xs:appinfo>
</xs:annotation>
<xs:sequence />
</xs:complexType>
<xs:element name="AnyStruct" nillable="true" type="tns:AnyStruct" />
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
</xs:schema>
</wsdl:types>
<wsdl:message name="IMyService_Do_InputMessage">
<wsdl:part name="parameters" element="tns:Do" />
</wsdl:message>
<wsdl:message name="IMyService_Do_OutputMessage">
<wsdl:part name="parameters" element="tns:DoResponse" />
</wsdl:message>
<wsdl:portType name="IMyService">
<wsdl:operation name="Do">
<wsdl:input wsam:Action="http://tempuri.org/IMyService/Do" message="tns:IMyService_Do_InputMessage" />
<wsdl:output wsam:Action="http://tempuri.org/IMyService/DoResponse" message="tns:IMyService_Do_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding" type="tns:IMyService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Do">
<soap:operation soapAction="http://tempuri.org/IMyService/Do" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyService">
<wsdl:port name="BasicHttpBinding" binding="tns:BasicHttpBinding">
<soap:address location="https://localhost:44366/mex" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions> |
DataContract containing IList<struct> produces invalid WSDL #346
@bartbovendeerdt Check again on develop branch, please |
@kotovaleksandr No, it still comes back with an error.
|
#346: DataContract containing IList<struct> produces invalid WSDL
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
If you have a DataContract containing a property of type
IList<T>
whereT
is astruct
, the WSDL that is generated is invalid.Example
The code above will yield the following WSDL.
Please note the
name
attribute has no value.Adding a
[FaultContract(typeof(InvalidOperationException))]
attribute will also cause this behavior.The WSDL cannot be imported into the WCF Test Client or Visual Studio 2019. Given that in the actual problem case, I do not own the type, is there any way around this?
Thanks in advance,
-Bart
Full WSDL
The text was updated successfully, but these errors were encountered: