locked
WCF Sync Service Reference Methods not Handled Properly RRS feed

  • Question

  •  

    I'm kind of new to the WCF, so I might've just screwed something up horribly, but I can't figure out what the issue is here.

     

    In my ServiceContract, I have the OperationContract:

     

    Code Snippet

    void GetSyncBatchParameters(out uint batchSize, out SyncKnowledge knowledge);

     

    In the Service Implementation, it's implemented correctly:

     

    Code Snippet

    public void GetSyncBatchParameters(out uint batchSize, out SyncKnowledge knowledge)

     

    However, when I create a Service Reference, the intellisense claims that the function is "GetSyncBatchParameters(out SyncKnowledge knowledge)", and the batchsize is completely gone! The other methods that are in the Service Contract are fine, except that for one other method the parameters are out of order, but all are present. I've tried updating the service reference (though that method was never built in that state.) This is very strange. Does anyone have any idea what could be going on? Thanks in advance.

     

    -A Chapin

    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:12 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Thursday, March 27, 2008 7:03 PM

Answers

  •  

    I figured it might be an issue with out, but the method

     

    Code Snippet

    Microsoft.Synchronization.ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever);

     

     

     

    is seen by intellisense as

     

    GetChangeBatch( out object changeDataRetriever, uint batchSize, SyncKnowledge destinationKnowledge);

     

    Everything's there, but it's in the wrong order. This is very strange and confusing. At first I thought the WCF might only let you have one "out" parameter, but my CTP 1 version of this method had both "out" parameters as well.

    Friday, March 28, 2008 2:05 PM

All replies

  • I faced this problem before....my solution is avoid using "out" in WCF.

    "out" in WCF can be replace with the solution below:

    make batchSize and knowledge as a member in a message contact or data contact. Let called it "Info"

    public Info GetSyncBatchParameters(Info parameter);


    Hope this help!


    -Owen-






    Friday, March 28, 2008 1:44 PM
  •  

    I figured it might be an issue with out, but the method

     

    Code Snippet

    Microsoft.Synchronization.ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever);

     

     

     

    is seen by intellisense as

     

    GetChangeBatch( out object changeDataRetriever, uint batchSize, SyncKnowledge destinationKnowledge);

     

    Everything's there, but it's in the wrong order. This is very strange and confusing. At first I thought the WCF might only let you have one "out" parameter, but my CTP 1 version of this method had both "out" parameters as well.

    Friday, March 28, 2008 2:05 PM