Question

I've looked in SO and elsewhere and seen questions posed about this along with some answers that still make no sense to me in my case.

I'm refactoring my working VStudio 2010 solution which has:

  • one project with an ASMX webservice
  • another separate project for the proxy class (no code here except what is generated by Add Web Reference
  • another separate project for the client (contains a reference to the ProxyClass.dll

The new VStudio 2010 solution has:

  • one project of type WCF service library for the contract by itself (IFileService.cs) one project of type WCF service library for the implementation of the contract (FileService.cs)
  • another separate project for the proxy class (no code here except what is generated by Add Service Reference
  • another separate project for the client (contains a reference to the WCFProxyClass.dll)

Here is the contract which ends with 3 out parameters (and the implementation of same is the same order):

[ServiceContract(Name = "IFileService", Namespace =  "http://www.cbmiweb.com/TrimWCF/2011/11")]
public interface IFileService
{
    [OperationContract]
        public string DownloadFile(string trimURL
         , string TrimRecordNumber
         , string CallerPC
         , string RequestorID
         , out byte[] docContents
         , out string returnFiletype
         , out string returnFilename)
    {

Here is what Add Service Reference generated in my proxy class project:

public string DownloadFile(
  out byte[] docContents
, out string returnFiletype
, out string returnFilename
, string trimURL
, string TrimRecordNumber
, string CallerPC
, string RequestorID) 
{
    return base.Channel.DownloadFile(out docContents, out returnFiletype, out returnFilename, trimURL, TrimRecordNumber, CallerPC, RequestorID);
}

I have read answers ranging from "you cannot use out parms in WCF" to "you should not use Add Service Reference but instead use svcutil.exe" to "the order of the parameters do not matter...it will still work".

I am confused about what to do here (and what I've done wrong that led to this re-arranged order and WHY that happened).

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top