My webservice WSDL doesn't return any information about the elements.

Discussion in 'ASP .Net Web Services' started by Molalla Attenborough, Dec 23, 2003.

  1. If I go to the following public service WSDL @

    I see the following section:
    <s:complexType name="Quote">
    <s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="StockTicker" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="StockQuote" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="LastUpdated" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Change" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="OpenPrice" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="DayHighPrice" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="DayLowPrice" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="Volume" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="MarketCap" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="YearRange" type="s:string" />

    How do I get my service written in to return this info in the
    autogenerated WSDL?

    I am currently using code that looks like this:

    <WebMethod()> Public Function GetContacts() as XmlDataDocument
    Dim MyData as New Dataset1
    Dim dataDoc as new xmlDataDocument(MyData)
    return dataDoc

    Any suggestions?

    Molalla Attenborough, Dec 23, 2003
    1. Advertisements

  2. Molalla Attenborough

    BruceJohnson Guest

    Have you tried returning a Quote objects instead of an XMLDataDocument
    from your GetContacts() method. Although it seems a little strange to
    me that GetContacts would return a quote.

    If you don't want to return Quote, then add the attribute
    <XmlInclude("Quote")> to the declaraction of the GetContacts method.
    This would cause the schema that defines the Quote class to be placed
    into the WSDL.

    Don't know if either of these answers is what you're looking for.

    Bruce Johnson
    BruceJohnson, Dec 23, 2003
    1. Advertisements

  3. Molalla Attenborough

    Mark Carver Guest

    I should clarify a bit. I want my own service to return detailed data about the
    fields in my dataset. I used the public server in my post an as example of the
    kind of detail I want.

    As it stands, My own service returns no information at all about the
    fields. This makes my WSDL almost useless for my purposes.

    My own project has a dataset that has a number of fields.
    I want my own WSDL to return information as a complex type
    and not as a dataset.

    Does this make sense at all?

    Mark Carver, Dec 23, 2003
  4. Molalla Attenborough

    BruceJohnson Guest

    It does make sense. I can think of one way to accomplish your aim
    quickly. There may be others that I'm missing

    My suggestions would be to create an object that has public properties
    defined that match the fields in the dataset. Then have the web service
    method return the object (after having the properties populated with
    values from the dataset, of course). This technique will also have the
    schema for the complex object automatically included in the WSDL file.


    Bruce Johnson
    BruceJohnson, Dec 28, 2003
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.