Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

WCF - returning an strongly typed array/list with basicHttpBinding

$
0
0

Hello Folks,

In process of building/modifying WCF service and client.

There are TWO requirements:

  • must be used binding=basicHttpBinding
  • must be used customer types

So, I do wrote a code for a class returned by the service:

[DataContract]
public class TPartialReport
{
  [DataMember]
  public List<TFile> Files1 { get; set; }

  [DataMember]
  public TFileList Files2 { get; set; }
}

A TFileList are a simple coverage for second requirement

[DataContract]
public class TFileList 
  : List<TFile>
{
}

TFile: 

[DataContract]
public class TFile
{
  [DataMember]
  public string RelativeFilename { get; set; }
}

Problem is:

  • if I use List<TFile> - I do violate second requirement,
  • if I use TFileList - I can't satisfy first requirement as content type changed from application/xml to application/soap+xml and this require different binding type.

Question is : is there a possibility to satisfy BOTH requirements? 

If - Yes - how to define TFileList?


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>