Disconnected Service Agent and Nullable or Out parameters

Topics: CAB & Smart Client Software Factory
Sep 5, 2007 at 2:24 AM
Edited Sep 5, 2007 at 2:31 AM
I am consuming a WCF Service that has methods with both nullable and out parameters.
When I generate a DSA for this service I get (what appears to be) IL code in the generated Agent.cs class for these parameters.
Any nullable parameter (eg int? customerID) is generated as Nullable'1 customerID and any out parameter (eg out int count) is generated as Int32& count
Assuming a bug, I tried manually updating the method parameters in the Agent class, but then find that I still can't pass the out parameters through the DSA's parameter Array.
Two questions then:
Why is the DSA generating the parameters the way it is?
How can I pass output parameters through the agent?
Regards and thanks in advance for any advice.

Sep 5, 2007 at 11:27 PM
As an example, this is the contract in the WCF Service:
Suburb GetBySuburbStateIdRegionId(string suburb, int stateId, int? regionId, int start, int pageLength, out int count);

The Disconnected Service Agent then creates a method with this interface:
public Guid GetBySuburbStateIdRegionId(String suburb, Int32 stateId, Nullable`1 regionId, Int32 start, Int32 pageLength, Int32& count)
Feb 18, 2008 at 1:51 PM
Did you find any solution to this problem? I'm facing the same issue now.
Feb 26, 2008 at 12:26 PM
You can solve the issue by using the svcutil to generate the proxy on the client, rather than using "Add Service Reference" from Visual studio 2005

use the /messageContract and /namespace:*,MyNamespace switches on svcutil.exe to generate the proxy correctly, and the Disconnected Service Agent works correctly.