leejw51 / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

WCF method argument became 'null' - resolved, but not exactly sure how #171

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Today I ran into an issue when a WC

I use protobuf-net at work to optimize our WCF communication.

All was ok, but a 3rd WCF 'server' I made gave an annoying issue : the methods 
that I invoked were correctly transfered to the WCF server, 
but the method arguments were 'null'.

After looking for an hour I saw someone telling that most like the 'namespace' 
is incorrect causing WCF to not know how to map the parameters.

I do use a non-default namespace, and defined them in all spots where I need to 
define them (afaik).

I eventually solved the issue (jeej) but now I wonder: 

I added ProtoEndpointBehavior like this:

    endpoint.Behaviors.Add(new ProtoEndpointBehavior());
    endpoint.Binding.Namespace = WSDL.NAMESPACE;
    endpoint.Binding.Name = WSDL.NAME;

And I 'think' I solved it by making it so:

    endpoint.Binding.Namespace = WSDL.NAMESPACE;
    endpoint.Binding.Name = WSDL.NAME;
    endpoint.Behaviors.Add(new ProtoEndpointBehavior());

Could it be this? That I need to define the namespace (+name) first before 
adding the ProtoEndpointBehavior? Or should it not be related?

I do not dare to try trigger the issue again, as I wasted 2 hours+ on this 
already and was VERY happy to see my unit tests succeed once again ^^

==============

What steps will reproduce the problem?

* Unknown, except if its indeed what I said above

What is the expected output? What do you see instead?

 * That the arguments weren't always null.

What version of the product are you using? On what operating system?

 * The one that is currently available for upload (the installer)

Please provide any additional information below.

 * I use Visual Studio 2008, and create all my prototypes using .proto files and the installed custom tool to generate a .cs file. I do not use any non-proto objects at the WCF communication.
 * Great job! I had to wrap myself around things a bit, but I love the 'enforced' strictness of things, while still being 'lose'
 * I made a very nice PostSharp aspect for use with .proto generated classes and planning to release it soon (for free) - I'll get back to you once I do release it.

Original issue reported on code.google.com by tim@mylemans.com on 5 May 2011 at 1:38

GoogleCodeExporter commented 9 years ago
This is now fixed in r469

Original comment by marc.gravell on 2 Nov 2011 at 9:50