Re: How do I pass a message or variable to a web service?



If you look at my first response to your question and the last thing I
wrote, you'll see that I had already suggested that:

"Are you sure that your web service project has been re-built and than your
web service reference has been refreshed?"


<needin4mation@xxxxxxxxx> wrote in message
news:1157118879.138422.162500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

needin4mation@xxxxxxxxx wrote:
I have this in my web service:

public XmlDocument GetDataFromDB(string name)
{
...
do some stuff with name variable..on the database...
return the XmlDocument to my datagrid;
}

Now, in my client default.aspx I have a button that calls this
function:

public void DataBindFrmWS(string name)
{
try
{
XmlDocument myServiceDoc = new XmlDocument();
System.Xml.XmlNode neNode;
//Adding the resulting XML from WebMethod to a user created
XmlNode
neNode = myService1.GetDataFromDB(name); //from above
...

It breaks on this last line when compiling saying:

"No overload for method "GetDataFromDB' takes '1' arguments."

What does this mean?

I read that I should think not of this as passing variables as in
functions calls, but sending messages. I can't figure out how to send
this simple message. I only want to send a simple string with a last
name.

Thank you for any help.

I finally got it working. I looked at the WSDL and found this:

<s:element name="GetDataFromDB">
<s:complexType />
</s:element>

So I went to Visual Studio and updated my web reference and it produced
this:

<s:element name="GetDataFromDB">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="name"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>

I guess I need understand how all the pieces work together better.
Thanks.



.


Loading