Problem in WebReference of WebService?

Discussion in 'ASP .Net' started by owais, Dec 18, 2003.

  1. owais

    owais Guest

    I have problem in Web Reference of Xml webservice. I have webservice service1.asmx which has one [WebMethod]public XmlDocument HelloWorld()().

    The WebService compiled and runs in browser well. But when I add the web reference of 'service1.asmx' in windows application and call the method HelloWorld and assigning the returning object to XmlDocument i.e.
    XmlDocument xd = service1.HelloWorld();
    it gives me error on compile time

    "C:\WindowsApplication2\Form1.cs(91): Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.XmlDocument'"

    The tool generates the reference signature of 'Helloworld' method is shown below

    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/HelloWorld", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    public System.Xml.XmlNode HelloWorld() {
    object[] results = this.Invoke("HelloWorld", new object[0]);
    return ((System.Xml.XmlNode)(results[0]));
    }

    Please let me know why it will not generate the right datatype.

    Thanks


    ---
    Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
     
    owais, Dec 18, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    395
  2. Rory Becker

    Webreference XYZ.datasource file

    Rory Becker, Dec 4, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    1,225
  3. Peter van der Veen

    how to use ssl certificates with a wsdl webreference?

    Peter van der Veen, Aug 20, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    423
    Peter van der Veen
    Aug 20, 2003
  4. JK

    beginner: add webreference at runtime

    JK, Dec 17, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    138
    Jan Tielens
    Dec 17, 2003
  5. Shaun Wilson

    VSDISCO/WebReference Woes

    Shaun Wilson, Jun 13, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    122
    Shaun Wilson
    Jun 13, 2005
Loading...

Share This Page