Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Invoke methods dinamically with out parameters in c#

Reply
Thread Tools

Invoke methods dinamically with out parameters in c#

 
 
cchasqueira@hotmail.com
Guest
Posts: n/a
 
      05-31-2004
Hi,
I'm trying to call a web service dinamically that has a method with out parameters. The way I'm calling the method is passing an object array with the parameters to invoke the method, but I can't specify which of these are out parameters. Is there any way of doing that?
This is the code I'm using to invoke the method. I'm also showing the method definition as it may help shed some light on the subject.

Thanks

Code:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute...]
public bool LaunchIncident(string strUserName, string strSummary, Variable[] varList, out int nIncidentNo, out string strError) {
object[] results = this.Invoke("LaunchIncident", new object[] {
strUserName,
strSummary,
varList});
nIncidentNo = ((int)(results[1]));
strError = ((string)(results[2]));
return ((bool)(results[0]));
}

object []args = {"Someone", "", varlist, nIncidentNo, strError}; //Launch Incident
object ox = type.InvokeMember("LaunchIncident",System.Reflecti on.BindingFlags.InvokeMethod,null,sc,args);




************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Reply With Quote
 
 
 
 
Jan Tielens
Guest
Posts: n/a
 
      06-01-2004
You can't work with weakly typed parameters or return values (e.g. object
types) on web services, unless you use the XMLInclude attribute. This is
because all the types you will be using as a parameter or return value
should be described in the WSDL.

If you want to call web services dynamically, I suggest you take a look at
Christian's tool:
http://weblogs.asp.net/cweyer/archiv...7/07/9769.aspx

--
Greetz
Jan
________________
Read my weblog: http://weblogs.asp.net/jan


"Catia CC" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> Hi,
> I'm trying to call a web service dinamically that has a method with out

parameters. The way I'm calling the method is passing an object array with
the parameters to invoke the method, but I can't specify which of these are
out parameters. Is there any way of doing that?
> This is the code I'm using to invoke the method. I'm also showing the

method definition as it may help shed some light on the subject.
>
> Thanks
>
> Code:
>
> [System.Web.Services.Protocols.SoapDocumentMethodAt tribute...]
> public bool LaunchIncident(string strUserName, string strSummary,

Variable[] varList, out int nIncidentNo, out string strError) {
> object[] results = this.Invoke("LaunchIncident", new object[]

{
> strUserName,
> strSummary,
> varList});
> nIncidentNo = ((int)(results[1]));
> strError = ((string)(results[2]));
> return ((bool)(results[0]));
> }
>
> object []args = {"Someone", "", varlist, nIncidentNo, strError}; //Launch

Incident
> object ox =

type.InvokeMember("LaunchIncident",System.Reflecti on.BindingFlags.InvokeMeth
od,null,sc,args);
>
>
>
>
> ************************************************** ********************
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &

ASP.NET resources...


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
out parameters for Web Service methods =?Utf-8?B?ZGF2aWQ=?= ASP .Net 2 06-22-2007 06:37 PM
Java invoke a .NET Web method whose parameters are passed by reference Shadi Rafeh ASP .Net Web Services 0 06-09-2006 09:26 AM
invoke a method by reflection£¨the method's parameters can not be ArrayList? jerry051 ASP .Net 2 08-02-2005 10:35 AM
Dinamically assigning handler methods to controls on the page =?Utf-8?B?Vmk=?= ASP .Net 2 11-02-2004 03:17 AM



Advertisments