R
Robby Valles
Hello,
I have a webservice with a static signature, that we have a custom
request and result class to handle different webmethods/services.
[WebMethod]
public MyResult Process( MyRequest r )
Currently, we have one proxy class generated and all webservice calls
point to this Process method. I am trying to figure out if we can have
mulitple web methods and call them dynamically by changing the
MethodName at runtime in the web proxy. Right now all we do is change
the url ex( localhost/search.asmx | localhost/createcustomer.asmx )
and use the same Process method. This works nicely as we dont have to
keep refreshing the web reference everytime we add a webservice.
When i try to change the webmethod name at runtime. I'm getting an
ArugmentException saying "GetUserList Web Service method name is not
valid.". This is happening in the BeforeSerialize method of
SoapHttpClientProtocol
at
System.Web.Services.Protocols.SoapHttpClientProtocol.BeforeSerialize(WebRequest
request, String methodName, Object[] parameters)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at MyService.Process(MyRequest r) in
Is there anyway I can call different webmethods at runtime without
knowing the name at compile time and without regenerating the proxy
class, since all request contracts are the same?
Thanks,
Robby
I have a webservice with a static signature, that we have a custom
request and result class to handle different webmethods/services.
[WebMethod]
public MyResult Process( MyRequest r )
Currently, we have one proxy class generated and all webservice calls
point to this Process method. I am trying to figure out if we can have
mulitple web methods and call them dynamically by changing the
MethodName at runtime in the web proxy. Right now all we do is change
the url ex( localhost/search.asmx | localhost/createcustomer.asmx )
and use the same Process method. This works nicely as we dont have to
keep refreshing the web reference everytime we add a webservice.
When i try to change the webmethod name at runtime. I'm getting an
ArugmentException saying "GetUserList Web Service method name is not
valid.". This is happening in the BeforeSerialize method of
SoapHttpClientProtocol
at
System.Web.Services.Protocols.SoapHttpClientProtocol.BeforeSerialize(WebRequest
request, String methodName, Object[] parameters)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at MyService.Process(MyRequest r) in
Is there anyway I can call different webmethods at runtime without
knowing the name at compile time and without regenerating the proxy
class, since all request contracts are the same?
Thanks,
Robby