Hi,
I have a WCF service, in it i have a method that takes a MessageContracts as input parameter and returns a MessageContract as out parameter. Please find the method defination below
[OperationContract(IsOneWay = false)]
FileDownloadReturnMessage DownloadFile(FileDownloadMessage request);
But when i create the proxy on the client and try to access this method i get a different definition of the method. Below is what i see when i try to access the method
DownloadFile(FileMetaData metadata, out stream outStream)
Complete code of the web service is below :
[ServiceContract(Namespace = "http://schemas.acme.it/2009/04/01")]
public interface IFileTransferService
{
[OperationContract(IsOneWay = false)]
FileDownloadReturnMessage DownloadFile(FileDownloadMessage request);
[OperationContract()]
string HellowWorld(string name);
}
[MessageContract]
public class FileDownloadMessage
{
[MessageHeader(MustUnderstand = true)]
public FileMetaData FileMetaData;
}
[MessageContract]
public class FileDownloadReturnMessage
{
public FileDownloadReturnMessage(FileMetaData metaData, Stream stream)
{
this.DownloadedFileMetadata = metaData;
this.FileByteStream = stream;
}
[MessageHeader(MustUnderstand = true)]
public FileMetaData DownloadedFileMetadata;
[MessageBodyMember(Order = 1)]
public Stream FileByteStream;
}
[DataContract(Namespace = "http://schemas.acme.it/2009/04/01")]
public class FileMetaData
{
public FileMetaData(string [] productIDs, string authenticationKey)
{
this.ids = productIDs;
this.authenticationKey= authenticationKey;
}
[DataMember(Name = "ProductIDsArray", Order = 1, IsRequired = true)]
public string[] ids;
[DataMember(Name = "AuthenticationKey", Order = 2, IsRequired = true)]
public string authenticationKey;
}
Please advise.