Web Service Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web service that I have written and can't seem to get it working
properly. I have a function that is exposed as a WebMethod() that is working
great. The problem is that i have several variables that need to be set
before calling the function. How can I go about setting those variables?

Could I use a public function exposed as a webmethod such as:

<WebMethod()> Public Sub SetIncome(ByVal Value as Integer)
iIncome = Value
End Sub

I tried creating properties with Get and Set but could not figure out how to
expose those publically. Any help is greatly appreciated!
 
Keep in mind that the nature of web services or SOA is stateless, or should
be in most cases - that means that your operations, in most cases, should be
atomic. In other words, if you need to set properties when you call the
method, then pass them as parameters. If you are concerned about the number
of possible parameters, then serialize an object/structure that contains
those values. You can set the properties on the object before sending it
across the wire to the service.
 
Back
Top