Really basic Web Service question

  • Thread starter Thread starter Sahil Malik [MVP]
  • Start date Start date
That doesn't really make sense, but oddly enough it is supported. The reason
I say that it doesn't make sense is that ref is a programming concept to
stack based method invocations, whereas web services are about XML message
passing. It seems that if there's a element in the top level Request and
Response XML documents passed back and forth to the [WebMethod] then the
..NET framework will map that onto a ref parameter. Go figure.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Shocking !! And yes it doesn't make sense - maybe it shouldn't be done !!

Okay so let me clearly understand what you mean by -

"It seems that if there's a element in the top level Request and
Response XML documents passed back and forth to the [WebMethod] then the
.NET framework will map that onto a ref parameter."

Are you saying Custom XML embedded in a custom SOAPHeader will act as a Ref
parameter? Can you pan your explanation out to code?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Brock Allen said:
That doesn't really make sense, but oddly enough it is supported. The
reason I say that it doesn't make sense is that ref is a programming
concept to stack based method invocations, whereas web services are about
XML message passing. It seems that if there's a element in the top level
Request and Response XML documents passed back and forth to the
[WebMethod] then the .NET framework will map that onto a ref parameter. Go
figure.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Is there anyway at all, to do something like ByRef/ref parameter
passing in Web Services?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
Ok I figured it out !!! Also this is specified in the SoapSpec.

I have a follow up question though. I'll post that as a seperate message.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/




Sahil Malik said:
Shocking !! And yes it doesn't make sense - maybe it shouldn't be done !!

Okay so let me clearly understand what you mean by -

"It seems that if there's a element in the top level Request and
Response XML documents passed back and forth to the [WebMethod] then the
.NET framework will map that onto a ref parameter."

Are you saying Custom XML embedded in a custom SOAPHeader will act as a
Ref parameter? Can you pan your explanation out to code?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/



Brock Allen said:
That doesn't really make sense, but oddly enough it is supported. The
reason I say that it doesn't make sense is that ref is a programming
concept to stack based method invocations, whereas web services are about
XML message passing. It seems that if there's a element in the top level
Request and Response XML documents passed back and forth to the
[WebMethod] then the .NET framework will map that onto a ref parameter.
Go figure.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Is there anyway at all, to do something like ByRef/ref parameter
passing in Web Services?

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/
 
Back
Top