Jeff Schneider continues his search for answers on how to do pass by reference in Web services.
I believe pass by reference is impossible when doing Web services.
Some time ago, I had a long and heated discussions with a customer and several colleagues about whether Java does pass by value or pass by reference, where we were evenly split among the views that there is only pass by value on the one hand, and only pass by reference on the other hand. (Incidentally, while looking for a normative definition, I came across an article that shares my point of view - Java does pass by value only. Really. Think about it.)
To me, pass by reference semantics only make sense in the case of programming languages - it’s a syntactical issue that you put a variable in place of a formal parameter, and the language implementation (compiled or interpreted) passes a pointer to the variable instead of the value. I believe anytime you make a copy of some data - which is unavoidable if caller and callee don’t reside in the same address space - you can’t do pass by reference.
Of course I concede that a Web services-based language might offer some sort of syntax to pass pointers under the covers, but that would probably be a bad idea and only lead to subtle bugs. Better to pass references - and pass them by value.