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 @
    http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL

    I see the following section:
    <s:complexType name="Quote">
    <s:sequence>
    <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" />
    </s:sequence>
    </s:complexType>

    How do I get my service written in vb.net 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
    oleDbDataAdpater1.Fill(MyData)
    Dim dataDoc as new xmlDataDocument(MyData)
    return dataDoc

    Any suggestions?

    TIA
     
    Molalla Attenborough, Dec 23, 2003
    #1
    1. Advertising

  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
    http://www.ObjectSharp.com/Bruce

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    BruceJohnson, Dec 23, 2003
    #2
    1. Advertising

  3. Molalla Attenborough

    Mark Carver Guest

    "BruceJohnson" <> wrote in message
    news:...
    > 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
    > http://www.ObjectSharp.com/Bruce
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!


    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?

    Thanks.
     
    Mark Carver, Dec 23, 2003
    #3
  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.

    HTH

    Bruce Johnson
    http://www.ObjectSharp.com/Bruce

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    BruceJohnson, Dec 28, 2003
    #4
    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. Dark
    Replies:
    1
    Views:
    4,640
    milfar
    Nov 14, 2008
  2. Chris Bedford
    Replies:
    0
    Views:
    592
    Chris Bedford
    Aug 21, 2003
  3. Stephen Edgecombe

    WSDL.EXE: WSDL Import Directive

    Stephen Edgecombe, Aug 13, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    243
    Stephen Edgecombe
    Aug 13, 2003
  4. g.fiorentini

    PROBLEM: webservice, XmlNode return value, XMLSchema and WSDL

    g.fiorentini, Sep 10, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    200
    g.fiorentini
    Sep 10, 2003
  5. Replies:
    1
    Views:
    240
Loading...

Share This Page