Problem with generating WebService proxy using svcutil

后端 未结 3 532
-上瘾入骨i
-上瘾入骨i 2020-12-17 21:43

In our application we are forced to consume several WebServices. In the beginning we used just the \"Add Service Reference\" menu option, in order to create a WCF proxy.

3条回答
  •  失恋的感觉
    2020-12-17 22:34

    The schema used by the wsdl does not conform to the Data Contract Serializer's Schema Reference.

    Problems:

    1. "All elements must be qualified for a schema to be supported by DataContractSerializer".

      Your schema omits the elementFormDefault attribute on the tag so the default, "unqualified" is in effect. You need to add the following attribute name/value pair to the element so that the Data Contract Serializer (DCS) can resolve the local elements/types.

      elementFormDefault="qualified"

    2. maxOccurs and minOccurs attributes on tag must be 1 or omitted (default is 1).

      So, remove maxOccurs="unbounded" on the .

    3. Add maxOccurs="unbounded" on the tag to get a nested collection data contract generated for the DataSet field.

      For example,

提交回复
热议问题