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

  • Thread starter Thread starter Daniel
  • Start date Start date
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?
 
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
 
Back
Top