[Mono-bugs] [Bug 696784] New: Call a wcf method with a ref DataContract as parameter, eg: ref Customer makes the parameter null after the call

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat May 28 03:13:13 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=696784

https://bugzilla.novell.com/show_bug.cgi?id=696784#c0


           Summary: Call a wcf method with a ref DataContract as
                    parameter, eg: ref Customer makes the parameter null
                    after the call
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: 32bit
        OS/Version: openSUSE 11.3
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: WCF
        AssignedTo: atsushi at ximian.com
        ReportedBy: 65rnov at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=431973)
 --> (http://bugzilla.novell.com/attachment.cgi?id=431973)
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.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list