Client receiving: "Web Service method name is not valid"

D

Daniel

I have a WinForm exe (client) connecting to an asmx WebService (server)

When I try to connect to WebMethod A, everything works fine.

But when I rename the WebMethod A to B, the client (actually,
SoapHttpClientProtocol.BeforeSerialize) throws:

ArgumentException "<B> Web Service method name is not valid"

What I do not understand is why the client process is not even sending
an http request to the server (I'm sniffing the connection) asking for
method B.

On the client, I modify the name in SoapDocumentMethodAttribute, and
the invoke method.

Any ideas?
 
D

Daniel

I found the problem :

The reason is that the method name at the proxy class MUST match the
webmethod name, so:

[SoapDocumentMethodAttribute("ns/B")...]
public int B()
{
object[] results = this.Invoke("B"...)
}

will work, but


[SoapDocumentMethodAttribute("ns/B")...]
public int BBB ()
{
object[] results = this.Invoke("B"...)
}

wont (note the mismatch between web method B, and proxy class method
BBB), throwing "Web Service method name is not valid".

This triggers the following two questions:

1) is there any way to circumvent this default behaviour?
2) do you know where can I find good documentation explaining all the
plumbing involved inside the WS black box?

Thxs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top