SOAP Web service HELP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johnjohnbytes
    New Member
    • Nov 2008
    • 1

    SOAP Web service HELP

    Hi,

    can someone help me on following issues:-

    i have a WebReference1 in my C# NET projects, and after i refererence, i can simply DOT OUT a function and pass in parameter. However I facing some problem. let see below:

    the function in my webreference CS file is like below:
    public Result function1(
    string loginname,
    string serviceid,
    string myurl,
    [System.Xml.Seri alization.XmlAr rayItemAttribut e("content")] Content[] contents) { object[] results = this.Invoke("fu nction1", new object[] {
    loginname,
    serviceid,
    url,
    contents});
    return ((Result)(resul ts[0]));


    THEN, in my NET project, i can webreference it and use the function

    it is function1(stiri ng loginname, string serviceid, string myurl, webreference.Co ntent[ ] contents)

    my question is how i pass in value for webreference.Co ntent[ ] contents???

    can someone help me?

    this is my current code how to use it

    string loginname= "john";
    string serviceid = "service";
    string myurl = "url";
    WebReference.Co ntent mycontent = new Webreference.Co ntent();

    mycontent.membe r1="xxx";
    mycontent.membe r2="xxx";

    then i dot the function

    webreference.fu nction1(loginna me,serviceid,my url,mycontent)

    error -> it said Cannot convert from my project 'mycontent' to webreference.Co ntent[ ] contents.

    error in last param i passed.

    please help
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    mycontent is a single instance of that class, the function wants you to pass in an array

    Try this:
    webreference.fu nction1(loginna me,serviceid,my url, new webreference.Co ntent[ ]{mycontent})

    Comment

    Working...