Bug 696784 - Call a wcf method with a ref DataContract as parameter, eg: ref Customer makes the parameter null after the call
Summary: Call a wcf method with a ref DataContract as parameter, eg: ref Customer make...
Status: NEW
Alias: None
Product: Mono: Class Libraries
Classification: Mono
Component: WCF (show other bugs)
Version: 2.10.x
Hardware: 32bit openSUSE 11.3
: P5 - None : Major
Target Milestone: ---
Assignee: Atsushi Enomoto
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-28 07:13 UTC by A vR
Modified: 2011-05-28 07:13 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
WCF service and Winform Application that can reproduce the problem (83.03 KB, application/x-zip)
2011-05-28 07:13 UTC, A vR
Details

Note You need to log in before you can comment on or make changes to this bug.
Description A vR 2011-05-28 07:13:11 UTC
Created attachment 431973 [details]
WCF service and Winform Application that can reproduce the problem

User-Agent:       Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

Creating a simple wcf service with a method like 

public class CustomerService : ICustomerService
    {
        public void AddUpdateCustomer(ref Customer customer)
        {
            customer.Id = 1;            
        }

        public void AddUpdateCustomer2(Customer customer)
        {
            customer.Id = 1;
        }
    }

Calling the first method from a winform application, AddUpdateCustomer(ref Customer customer), causes the parameter to be null after the call

CustomerService.Customer customer  = new TestMonoWCFApplication.CustomerService.Customer();
customer.Firstname = "John";
customer.Surname = "Doe";

CustomerService.CustomerServiceClient c = new TestMonoWCFApplication.CustomerService.CustomerServiceClient("BasicHttpBinding_ICustomerService");
c.AddUpdateCustomer(ref customer);

After this call the customer object is null, it should not be null

Reproducible: Always

Steps to Reproduce:
1. Create a simple wcf service, with a Ref parameter in the method
2. Add this service's service reference to a simple winform application
3. Call the method in 1, and after the method the parameter is null
Actual Results:  
A Ref Parameter is always null after a WCF service call.
c.AddUpdateCustomer(ref customer);
Trying to use customer object is useless, as it is null 


Expected Results:  
The customer object above should not be null, and contain the values that were set in the service. (Like customer.Id)

This error, makes the wcf library included with mono 2.10.2, not useful, as this error was not present in mono 2.10.1.