The most weird bug with WCF

I met this and feel so confused, ANY help?

I found i can not get int:-1 from WCF in Unity
So made a simple test to show what happened.
And I have to say this is totally crazy… please help

Host Code:

 public void testFunction(ref int num) {
            num = -1;           
        }
        public int testFunction2() {
            return -1;
        }

And test it… NICE

3909-vs_test.jpg

Client Code in Unity:

public class staticTest : MonoBehaviour {
	void Start () {	
		int num3=10;
		int num4=10;
		//connect to WCF
			EndpointAddress endpoint = new EndpointAddress("net.tcp://192.168.1.250:8910/UserService");
	        NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);			
			UserServiceClient client=new  UserServiceClient(binding,endpoint);	
		//GO!
		client.testFunction(ref stat.num1);
		Debug.Log("Ref Static signed int in mono returns :"+stat.num1);
		
		client.testFunction(ref stat.num2);
		Debug.Log("Ref Static UNsigned int in mono returns :"+stat.num2);
		
		client.testFunction(ref num3);
		Debug.Log("Ref Local int in mono returns :"+num3);
		
		client.testFunction2();
		Debug.Log("Can mono just accept a -1 from wcf?:"+stat.num1);
		
		Amethod(ref num4);
		Debug.Log("Local method ref is fine:"+num4);

	}
	void Amethod(ref int num){
		num=-1;		
	}	
}

public static class stat{
	public static int num1=1;
	public static int num2;
}

Very easy,just repeat some simple call.
But result is upset

alt text

A temp solution is set variables out of this range: [-128,-1]

interesting thing is:

-1 will return 255, and -2 return 254…

-127 return 129

-128 still return 128

-129 RETURN -129
And everything is fine after this.

So this bug affect [-128,-1];
But what’s the meaning of this?

Why this number? 128=2^7?