Russell Verdun wrote:
Is it possible from a vb.net application, to pass an command object to
web method in a web service. I want to be able to invoke a stored
procedure remotely and get a dataset back from the webservice. The
stored procedure has several parameters, so I figure if I can
construct the command object and append the parameters to it, I could
then pass the command object to the service and get my results. I'm
open for suggestions on other ways to accomplish this.
It's not possible to pass Microsoft's command object because it can't be serialized by the XmlSerializer. However it is possible to create your own schema definition for what features of the command object you'd like to accept and then take an instance of that document and translate it to a command object inside of your web method.
Something like:
<command text="SELECT * FROM SomeTable WHERE someField > @someValue">
<parameters>
<parameter name="@someValue" value="1" type="xsd:int"/>
</parameters>
</command>
HTH,
Drew